
function ButtonAutoSelect(elem)
{
  elem.checked=true;
}

function ButtonAutoDeselect(elem)
{
  elem.checked=false;
}

function ClearOnSelect(str,str2)
{
  if (document.getElementById(str).value==str2)
  {
    document.getElementById(str).value="";
  }
}

function displaySwap(str)
{
  if (document.getElementById(str).style.display=="none")
  {
    document.getElementById(str).style.display="block";
  }
  else
  {
    document.getElementById(str).style.display="none";
  }
}

function submitform(str)
{
  document.getElementById(str).submit();
}

function FCKeditor_OnComplete( editorInstance )
{
  if(document.getElementById('description___Frame'))
  {
    document.getElementById('description___Frame').style.height = "400px";
  }
  if(document.getElementById('content___Frame'))
  {
    document.getElementById('content___Frame').style.height = "400px";
  }
}

function dsp2(loc) {
   var plusImageName="plus-sign.gif";
   var minusImageName="minus-sign.gif";
   if(document.getElementById) {
      var foc=loc.firstChild;
      foc=loc.firstChild.src?
         loc.firstChild:
         loc.firstChild.nextSibling;
      var srcLength = foc.src.length;
      var srcRIndex = foc.src.indexOf('/img/');
      var srcRight = foc.src.substr(srcRIndex,srcLength - 1);
      var srcLeft = foc.src.substr(0,srcRIndex);
      var srcPlus = srcLeft + "/img/" + plusImageName;
      var srcMinus = srcLeft + "/img/" + minusImageName;
      foc.src=foc.src==srcPlus?srcMinus:srcPlus;
      foc.alt=foc.alt=='+'?'-':'+';
      foc=loc.parentNode.nextSibling.style?
         loc.parentNode.nextSibling:
         loc.parentNode.nextSibling.nextSibling;
      foc.style.display=foc.style.display=='block'?'none':'block';
   }
}

function checkCarPool() {
	if (document.carpool.p_fullname.value == "") {
		alert("Please enter the Primary Driver's Name.");
		document.carpool.p_fullname.focus();
		document.carpool.p_fullname.select();
		return false;
	}
	if (document.carpool.p_home_address.value == "") {
		alert("Please enter the Primary Driver's Home Address.");
		document.carpool.p_home_address.focus();
		document.carpool.p_home_address.select();
		return false;
	}
	if (document.carpool.p_city.value == "") {
		alert("Please enter the Primary Driver's City.");
		document.carpool.p_city.focus();
		document.carpool.p_city.select();
		return false;
	}
	if (document.carpool.p_zip.value == "") {
		alert("Please enter the Primary Driver's Postal Code.");
		document.carpool.p_zip.focus();
		document.carpool.p_zip.select();
		return false;
	}
	if (document.carpool.p_home_email.value == "") {
		alert("Please enter the Primary Driver's Work or Home Email Address.");
		document.carpool.p_home_email.focus();
		document.carpool.p_home_email.select();
		return false;
	}
	if (document.carpool.p_employer.value == "") {
		alert("Please enter the Primary Driver's Employer/Agency.");
		document.carpool.p_employer.focus();
		document.carpool.p_employer.select();
		return false;
	}
	if (document.carpool.p_emp_address.value == "") {
		alert("Please enter the Primary Driver's Employer/Agency Street Address.");
		document.carpool.p_emp_address.focus();
		document.carpool.p_emp_address.select();
		return false;
	}
	if (document.carpool.p_emp_city.value == "") {
		alert("Please enter the Primary Driver's Employer/Agency City.");
		document.carpool.p_emp_city.focus();
		document.carpool.p_emp_city.select();
		return false;
	}
	if (document.carpool.p_emp_zip.value == "") {
		alert("Please enter the Primary Driver's Employer/Agency Postal Code.");
		document.carpool.p_emp_zip.focus();
		document.carpool.p_emp_zip.select();
		return false;
	}
	if (document.carpool.p_home_phone.value == "" && document.carpool.p_emp_phone.value == "" && document.carpool.p_cell_phone.value == "") {
		alert("Please enter the Primary Driver's home phone number, cell phone number or work phone number.");
		document.carpool.p_home_phone.focus();
		document.carpool.p_home_phone.select();
		return false;
	}
	if (document.carpool.s_fullname.value == "") {
		alert("Please enter the Secondary Driver's Name.");
		document.carpool.s_fullname.focus();
		document.carpool.s_fullname.select();
		return false;
	}
	if (document.carpool.s_home_address.value == "") {
		alert("Please enter the Secondary Driver's Home Address.");
		document.carpool.s_home_address.focus();
		document.carpool.s_home_address.select();
		return false;
	}
	if (document.carpool.s_city.value == "") {
		alert("Please enter the Secondary Driver's City.");
		document.carpool.s_city.focus();
		document.carpool.s_city.select();
		return false;
	}
	if (document.carpool.s_zip.value == "") {
		alert("Please enter the Secondary Driver's Postal Code.");
		document.carpool.s_zip.focus();
		document.carpool.s_zip.select();
		return false;
	}
	if (document.carpool.s_home_email.value == "") {
		alert("Please enter the Secondary Driver's Work or Home Email Address.");
		document.carpool.s_home_email.focus();
		document.carpool.s_home_email.select();
		return false;
	}
	if (document.carpool.s_employer.value == "") {
		alert("Please enter the Secondary Driver's Employer/Agency.");
		document.carpool.s_employer.focus();
		document.carpool.s_employer.select();
		return false;
	}
	if (document.carpool.s_emp_address.value == "") {
		alert("Please enter the Secondary Driver's Employer/Agency Street Address.");
		document.carpool.s_emp_address.focus();
		document.carpool.s_emp_address.select();
		return false;
	}
	if (document.carpool.s_emp_city.value == "") {
		alert("Please enter the Secondary Driver's Employer/Agency City.");
		document.carpool.s_emp_city.focus();
		document.carpool.s_emp_city.select();
		return false;
	}
	if (document.carpool.s_emp_zip.value == "") {
		alert("Please enter the Secondary Driver's Employer/Agency Postal Code.");
		document.carpool.s_emp_zip.focus();
		document.carpool.s_emp_zip.select();
		return false;
	}
	if (document.carpool.s_home_phone.value == "" && document.carpool.s_emp_phone.value == "" && document.carpool.s_cell_phone.value == "") {
		alert("Please enter the Secondary Driver's home phone number, cell phone number or work phone number.");
		document.carpool.s_home_phone.focus();
		document.carpool.s_home_phone.select();
		return false;
	}
	
	if (document.carpool.days_carpool.value == "") {
		alert("Please enter How many days per week do you carpool?");
		document.carpool.days_carpool.focus();
		document.carpool.days_carpool.select();
		return false;
	}
	if (!document.carpool.add_riders[0].checked && !document.carpool.add_riders[1].checked) {
		alert("Please check Do you want additional riders?");
		return false;
	}
	if (document.carpool.hear_cics.value == "") {
		alert("Please select a Where did you hear about CICS?");
		document.carpool.hear_cics.focus();
		return false;
	}
}

function checkCommuter() {
	if (document.commuter.p_fullname.value == "") {
		alert("Please enter the Commuter's Name.");
		document.commuter.p_fullname.focus();
		document.commuter.p_fullname.select();
		return false;
	}
	if (document.commuter.p_home_address.value == "") {
		alert("Please enter the Commuter's Home Address.");
		document.commuter.p_home_address.focus();
		document.commuter.p_home_address.select();
		return false;
	}
	if (document.commuter.p_city.value == "") {
		alert("Please enter the Commuter's City.");
		document.commuter.p_city.focus();
		document.commuter.p_city.select();
		return false;
	}
	if (document.commuter.p_zip.value == "") {
		alert("Please enter the Commuter's Postal Code.");
		document.commuter.p_zip.focus();
		document.commuter.p_zip.select();
		return false;
	}
	if (document.commuter.p_home_email.value == "") {
		alert("Please enter the Commuter's Work or Home Email Address.");
		document.commuter.p_home_email.focus();
		document.commuter.p_home_email.select();
		return false;
	}
	if (document.commuter.p_employer.value == "") {
		alert("Please enter the Commuter's Employer/Agency.");
		document.commuter.p_employer.focus();
		document.commuter.p_employer.select();
		return false;
	}
	if (document.commuter.p_emp_address.value == "") {
		alert("Please enter the Commuter's Employer/Agency Street Address.");
		document.commuter.p_emp_address.focus();
		document.commuter.p_emp_address.select();
		return false;
	}
	if (document.commuter.p_emp_city.value == "") {
		alert("Please enter the Commuter's Employer/Agency City.");
		document.commuter.p_emp_city.focus();
		document.commuter.p_emp_city.select();
		return false;
	}
	if (document.commuter.p_emp_zip.value == "") {
		alert("Please enter the Commuter's Employer/Agency Postal Code.");
		document.commuter.p_emp_zip.focus();
		document.commuter.p_emp_zip.select();
		return false;
	}
	if (document.commuter.p_home_phone.value == "" && document.commuter.p_emp_phone.value == "" && document.commuter.p_cell_phone.value == "") {
		alert("Please enter the Communter's home phone number, cell phone number or work phone number.");
		document.commuter.p_home_phone.focus();
		document.commuter.p_home_phone.select();
		return false;
	}
	
	if (!document.commuter.mode_trans[0].checked && !document.commuter.mode_trans[1].checked && !document.commuter.mode_trans[2].checked) {
		alert("Please check Mode of Transportation.");
		return false;
	}
	if (document.commuter.times_week.value == "") {
		alert("Please enter How Many Times per Week?");
		document.commuter.times_week.focus();
		document.commuter.times_week.select();
		return false;
	}
	if (document.commuter.hear_cics.value == "") {
		alert("Please select a Where did you hear about CICS?");
		document.commuter.hear_cics.focus();
		return false;
	}
}

if(!document.getElementById)
   document.write('<style type="text/css"><!--\n'+
      '.dspcont{display:block;}\n'+
      '//--></style>');

