// TOGGLE FUNCTIONALITY
function otherStateCheck() {
   vState = document.contact.StateProvince;
   if ( vState.selectedIndex != -1 && vState.options[vState.selectedIndex].value == 'OTHER' ) {
		toggleLayer('otherStateDiv');
      return false;
   }
	return true;
}
function toggleLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	}
	else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
	else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
}

//VALIDATE CONTACT FORM DATA
function valButton(btn) {
	var cnt = -1;
	for (var i=btn.length-1; i > -1; i--) {
		if (btn[i].checked) {cnt = i; i = -1;}
	}
	if (cnt > -1) return btn[cnt].value;
	else return null;
}
function DataValidation() {
	if (document.contact.FirstName.value == "") {
      alert("Please supply a first name.");
      return false;
   }
   if (document.contact.LastName.value == "") {
      alert("Please supply a last name.");
      return false;
   }
   if (document.contact.Title.value == "") {
      alert("Please supply a job title.");
      return false;
   }
   if (document.contact.CompanyName.value == "") {
      alert("Please supply a library name.");
      return false;
   }
   myCompanyType = document.contact.CompanyType;
   if ( myCompanyType.selectedIndex != -1 && myCompanyType.options[myCompanyType.selectedIndex].value == '' ) {
      alert("Please supply a library type.");
      return false;
   }
   myLeadSource = document.contact.LeadSource;
   if ( myLeadSource.selectedIndex != -1 && myLeadSource.options[myLeadSource.selectedIndex].value == '' ) {
      alert("Please let us know how you heard about us.");
      return false;
   }
	myILSvendor = document.contact.ILSvendor;
   if ( myILSvendor.selectedIndex != -1 && myILSvendor.options[myILSvendor.selectedIndex].value == '' ) {
      alert("Please let us know who your current ILS vendor is.  Choose NONE if the answer is none.");
      return false;
   }
	if ( valButton(document.contact.CustomerYN) == null ) {
      alert("Please let us know if you are currently a BIP or GBIP customer.");
      return false;
   }
	if (document.contact.EmailAddress.value == "") {
      alert("Please supply a valid e-mail address.");
      return false;
   }
	if (document.contact.Street1.value == "") {
      alert("Please supply a street address.");
      return false;
   }
   if (document.contact.City.value == "") {
      alert("Please supply a city.");
      return false;
   }
   if (document.contact.StateProvince.value == "") {
      alert("Please supply a state or province.");
      return false;
   }
   if (document.contact.PostalCode.value == "") {
      alert("Please supply a zip or postal code.");
      return false;
   }
   myCountry = document.contact.CountryName;
   if ( myCountry.selectedIndex != -1 && myCountry.options[myCountry.selectedIndex].value == '' ) {
      alert("Please supply a country or region.");
      return false;
   }
   if (document.contact.PhoneVoiceNumber.value == "") {
      alert("Please supply a phone number.");
      return false;
   }
   return true;
}
// -->
