<!--
function expand(x) {
  if (document.all) {
    if (document.all[x].style.display == 'none') {
      document.all[x].style.display = ''
    } else if (document.all[x].style.display == '') {
      document.all[x].style.display = 'none';
    }
  } else {
    if (document.getElementById(x).style.display == 'none') {
      document.getElementById(x).style.display = ''
    } else if (document.getElementById(x).style.display == '') {
      document.getElementById(x).style.display = 'none';
    }
  }
}

// used on the Home Page.
// the haveResBox is the "i already have a res" table.
function expandIncludingHaveResBox(x) {
	if (x == 'discountBox' || x == 'memberBox') {
		if (document.getElementById(x).style.display == 'none') {
			document.getElementById(x).style.display = '';
			document.getElementById('haveResBox').style.display = 'none';
			if (!up3) { swapArrow3(); }
		} else {
			document.getElementById(x).style.display = 'none';
			if ( document.getElementById('discountBox').style.display == 'none' &&
				 document.getElementById('memberBox').style.display == 'none' ) {
				document.getElementById('haveResBox').style.display = '';
				if (up3) { swapArrow3(); }
			}
		}
	}
}

function expandFromCheckbox(chkbx, x, showIfChecked) {
  var showContent = !chkbx.checked;
  if (showIfChecked) {
    showContent = chkbx.checked;
  }
  if (document.all) {
    if (showContent) {
      document.all[x].style.display = ''
    } else {
      document.all[x].style.display = 'none';
    }
  } else {
    if (showContent) {
      document.getElementById(x).style.display = ''
    } else {
      document.getElementById(x).style.display = 'none';
    }
  }
}

var up1 = true;
var up2 = true;
var up3 = false; // area expanded by default

function swapArrow1() {
  if (up1) {
    document.arrow_up.src = '/images/common/arrow_down.gif';
    up1 = false;
  } else {
    document.arrow_up.src = '/images/common/arrow_in.gif';
    up1 = true;
  }
}

function swapArrow2() {
  if (up2) {
    document.arrow_up2.src = '/images/common/arrow_down.gif';
    up2 = false;
  } else {
    document.arrow_up2.src = '/images/common/arrow_in.gif';
    up2 = true;
  }
}

// this is a white arrow
// this is used on the i already have a res section of the Home Page
function swapArrow3() {
  if (up3) {
    document.arrow_up3.src = '/images/common/arrow_down_wht.gif';
    up3 = false;
  } else {
    document.arrow_up3.src = '/images/common/arrow_in_wht.gif';
    up3 = true;
  }
}

// ==========================================================
// driver methods for some expand/collapse areas of the site
// ==========================================================

function doDropOffOnClickTasks(checkBoxClicked) {
	if (!checkBoxClicked) {
		changeBox('document.forms[0].chkReturn');
	}
	expandFromCheckbox(document.forms[0].chkReturn,'dropoffBox',false);
	// empty value out of field and put cursor there
	if (document.forms[0].chkReturn.checked == true ||
	    document.forms[0].dropoffLocation.value == document.forms[0].pickupLocation.value ) {
		document.forms[0].dropoffLocation.value = "";
		if (document.forms[0].chkReturn.checked == false) {
		}
	}
}

// Home Page has unique name for this checkbox
function doHomePageCountryOfResOnClickTasks(checkBoxClicked) {
	if (!checkBoxClicked) {
		changeBox('document.forms[0].USResident');
	}
	expandFromCheckbox(document.forms[0].USResident,'countryOfResBox',false);
	if (document.forms[0].USResident.checked == true) {
		document.forms[0].countryOfResidence.options.selectedIndex = 0;
	}
}

// Step 1 has unique name for this checkbox
function doStep1CountryOfResOnClickTasks(checkBoxClicked) {
	if (!checkBoxClicked) {
		changeBox('document.forms[0].chkResident');
	}
	expandFromCheckbox(document.forms[0].chkResident,'countryOfResBox',false);
	if (document.forms[0].chkResident.checked == true) {
		document.forms[0].countryOfResidence.options.selectedIndex = 0;
	}
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
