<!--
function expand(x) 
{
	if (document.all) 
	{     
		if (document.all[x].style.display == 'none') 
		{
			document.all[x].style.display = '';
			//alert("document.all[x].style.display == none: " + (document.all[x].style.display == 'none') + " " + );
		}
		else if (document.all[x].style.display == '') 
		{
			document.all[x].style.display = 'none';
			//alert("document.all[x].style.display == blank: " + (document.all[x].style.display == ''));
		}
	} 
	else 
	{
	        if (document.getElementById(x).style.display == 'none') 
		{
			document.getElementById(x).style.display = '';
			//alert("1. " + x + " document.getElementById(x).style.display == none: " + (document.getElementById(x).style.display == 'none') + " " + (document.getElementById(x).style.display == ''));
		}
		else if (document.getElementById(x).style.display == '') 
		{
			document.getElementById(x).style.display = 'none';
			//alert("2. " + x + " document.getElementById(x).style.display == blank: " + (document.getElementById(x).style.display == '') + " " + (document.getElementById(x).style.display == 'none') );
		}
	}
}
// collapse - exactly like expand, except it only hides elements - JFY
function collapse(x) {
  if (document.all) {
    if (document.all[x].style.display == '') {
      document.all[x].style.display = 'none';
    }
  } 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 == '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('memberBox').style.display == 'none' ) {
				//document.getElementById('haveResBox').style.display == 'none';
				//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 = true; //area collapsed by default
var up4 = false;
var up5 = true;

function swapArrow1() {
  if (up1) {
    document.arrow_up.src = '/budgetWeb/images/common/arrow_down.gif';
    up1 = false;
  } else {
    document.arrow_up.src = '/budgetWeb/images/common/arrow_in.gif';
    up1 = true;
  }
}

function swapArrow2() {
  if (up2) {
    document.arrow_up2.src = '/budgetWeb/images/common/arrow_down.gif';
    up2 = false;
  } else {
    document.arrow_up2.src = '/budgetWeb/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 = '/budgetWeb/images/common/arrow_down_wht.gif';
    up3 = false;
  } else {
    document.arrow_up3.src = '/budgetWeb/images/common/arrow_in_wht.gif';
    up3 = true;
  }
}

// this is for the collaspe/expand arrows on the deals landing pages
function swapArrow4() {
	
	var imgElement = document.getElementById("arrow_up4");
  	
  if (up4) {
    imgElement.src = '/budgetWeb/images/common/arrow_down_blue.gif';
    up4 = false;
  } else {
    imgElement.src = '/budgetWeb/images/common/arrows.gif';
    up4 = true;
  }
}

function swapArrow4(styleId)
{
	var imgElement = document.getElementById(styleId);
  	
  if (imgElement == null || imgElement == '')
  {
  	return;
  }

	  if (imgElement.src.indexOf('arrows.gif') >= 0) 
	  {
	    imgElement.src = '/budgetWeb/images/common/arrow_down_blue.gif';
	  } 
	  else 
	  {
	    imgElement.src = '/budgetWeb/images/common/arrows.gif';
	  }
}

function swapArrow5() {
  if (up5) {
    document.arrow_up5.src = '/budgetWeb/images/common/wht_arrow_down.gif';
    up5 = false;
  } else {
    document.arrow_up5.src = '/budgetWeb/images/common/wht_arrow_in.gif';
    up5 = 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].dolDesc.value == document.forms[0].pulDesc.value ) 
        {        	
		document.forms[0].dolDesc.value = "";
		
		if (document.forms[0].chkReturn.checked == false) 
		{
			document.forms[0].dolDesc.focus();
		}		
	}
		
}

// 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);
}


//-->
