/***** BROWSER DETECTION *****/
var g_UA = navigator.userAgent.toLowerCase();
var g_NETSCAPE = (g_UA.indexOf("netscape")>0);
var g_NETSCAPE8 = (g_UA.indexOf("netscape/8")>0);
var g_NETSCAPE_LESS8 = (g_NETSCAPE && !g_NETSCAPE8);
var g_FIREFOX = (g_UA.indexOf("firefox")>0) 
var g_OPERA = (g_UA.indexOf("opera")>0)
var g_WEBTV = (g_UA.indexOf("webtv")>0)
var g_IE = (!g_OPERA && !g_WEBTV && g_UA.indexOf("msie")>0); //navigator.userAgent contains "msie" for Opera and WebTv too!!
var g_SAFARI = (g_UA.indexOf("safari") != -1);
var g_KONQUEROR = (g_UA.indexOf("konqueror") != -1);
var g_USE_NEW_CONTENT_MANAGER = (document.getElementById && document.designMode && !g_SAFARI && !g_KONQUEROR && !g_NETSCAPE_LESS8);
var g_USE_FCK_CONTENT_MANAGER = (!g_SAFARI && !g_KONQUEROR && !g_NETSCAPE_LESS8 && !g_OPERA);
var g_FormatDate = "MM/DD/YYYY";
var g_IE_VERSION5 = g_IE && (g_UA.charAt(navigator.appVersion.indexOf("msie") + 5) >= 5);
var g_WIN16 = (navigator.platform.indexOf("Win16") > 0);
var g_MAC = (g_UA.indexOf("mac")>0);

/***** GENERAL FUNCTIONS *****/
function validateUSPhone( strValue ) 
{
	if((isPhone(strValue)) || (isPhone2Format(strValue))){
		return true;
	}
	else{
		return false;
	}
}
function isEmail(str)
{
	var tmp = str + "";
	if(tmp!="")
	{		
		var exclude=/[^@\-\.\[A-Za-z0-9]]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;				
		var check=/@[\w\-]+\./;
		var checkend=/\.[a-zA-Z]{2,5}$/;

		if(((tmp.search(exclude) != -1)||(tmp.search(check)) == -1)||(tmp.search(checkend) == -1))
			return false;	
	}
	return true;	
}

function isPhone(str) //format: NNN-NNN-NNNN
{
	if (str.length != 12)     
	{		
		return false;
	}		
	
	for (var i=0; i<12; i++)
	{
		if ((i == 3 || i == 7) && str.charAt(i) != "-")
		{
			return false;
		}
		if (i!=3 && i!=7 && parseInt(str.charAt(i)) != str.charAt(i))
		{				
			return false;
		}		
	}
	
	return true;                     
}

function isPhone2Format(str) //format: (NNN) NNN-NNNN
{
	return /^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/.test(str);                   
}

function isZip (str) // format NNNNN or NNNNN-NNNN
{
	if (str.length!=5 && str.length!=10)
	{	
		return false;
	}
		
	for (var i=0; i < str.length; i++) 
	{
		if(str.length == 5 && parseInt(str.charAt(i)) != str.charAt(i))
		{
			return false;
		}
		if(str.length == 10 && str.charAt(5) != "-")
		{
			return false;
		}			
		if(str.length == 10 && (i != 5 && parseInt(str.charAt(i)) != str.charAt(i)))		
		{		
			return false;
		}
	}

	return true;
}
function StripSpaces(sValue)
{
	return sValue.replace((/\s/g), ""); 
}

function doAssociateObjects( oSource, oTarget, bAssociate )
{
	if(bAssociate)
		oTarget.value = oSource.value;
}

function doClearObject(obj, clearvalue)
{
	obj.value = clearvalue;
}

function isEmpty(str)
{		
	if(g_IE)
	{		
		if(str=="")
			return true;
		var re = /(\S+)/gi;
		var t = re.test(str);
		return !t;
	}
	else
	{		
		if(str=="")	
			return true;
		return false;
	}
}

function changeClass(Elem, myClass) 
{
	if(document.getElementById(Elem))
		document.getElementById(Elem).className = myClass;
}
function isInteger( strValue ) {
	var objRegExp  = /(^-?\d\d*$)/;
	return objRegExp.test(strValue);
}

/***** CUSTOM FUNCTIONS *****/
function CheckSameAsBill ( oChkSame ){
	var objForm = document.forms.frmOnlineDonation;
	if( oChkSame.checked ){
		
		if (!isEmpty(objForm.txtDonorFirstName))
		{
			doAssociateObjects ( objForm.txtDonorFirstName, objForm.txtBillingFirstName, true );
			checkRequired ( objForm.txtDonorFirstName );
			checkRequired ( objForm.txtBillingFirstName );
		}
			
		if (!isEmpty(objForm.txtDonorLastName))
		{
			doAssociateObjects( objForm.txtDonorLastName, objForm.txtBillingLastName, true);
			checkRequired ( objForm.txtDonorLastName );
			checkRequired ( objForm.txtBillingLastName );
		}
			
		if (!isEmpty(objForm.txtDonorAddress1))
		{
			doAssociateObjects( objForm.txtDonorAddress1, objForm.txtBillingAddress1, true);
			checkRequired ( objForm.txtDonorAddress1 );
			checkRequired ( objForm.txtBillingAddress1 );
		}
		
		if (!isEmpty(objForm.txtDonorAddress2))
		{
			doAssociateObjects( objForm.txtDonorAddress2, objForm.txtBillingAddress2, true);
		}
		
		if (!isEmpty(objForm.selDonorState))
		{
			doAssociateObjects( objForm.selDonorState, objForm.selBillingState, true);
			checkRequired ( objForm.selDonorState );
			checkRequired ( objForm.selBillingState );
		}
		
		if (!isEmpty(objForm.txtDonorCity))
		{
			doAssociateObjects( objForm.txtDonorCity, objForm.txtBillingCity, true );
			checkRequired ( objForm.txtDonorCity );
			checkRequired ( objForm.txtBillingCity );
		}
		
		if (!isEmpty(objForm.txtDonorZip))
		{
			doAssociateObjects( objForm.txtDonorZip, objForm.txtBillingZip, true );
			checkRequired ( objForm.txtDonorZip );
			checkRequired ( objForm.txtBillingZip );
		}
		
		if (!isEmpty(objForm.txtDonorPhone))
		{
			doAssociateObjects( objForm.txtDonorPhone, objForm.txtBillingPhone, true );
			checkRequired ( objForm.txtDonorPhone );
			checkRequired ( objForm.txtBillingPhone );
		}
	}
	else{
		/*doClearObject(objForm.txtBillingAddress1, "");
		doClearObject(objForm.txtBillingAddress2, "");
		doClearObject(objForm.selBillingState, 0);
		doClearObject(objForm.txtBillingCity, "");
		doClearObject(objForm.txtBillingZip, "");*/
	}
}

function doCheckCountry( oCountrySource, oStateTarget )
{
	if ( oCountrySource.value != "United States of America" ) {
		oStateTarget.value = "N/A";
	}
	else
	{
		if (oStateTarget.value == "N/A")
			oStateTarget.value = "Texas";
	}
}

function doCheckUSState( oStateSource, oCountryTarget )
{
	if ( oStateSource.value != "N/A" ) {
		oCountryTarget.value = "United States of America";
	}
}

function checkLimit(iLimit, LimitedAreaID, CounterID, showAlert) {
	var oCounter = document.getElementById(CounterID);
	var oText = document.getElementById(LimitedAreaID);
	var prevCounter = iLimit - oCounter.value;
	oCounter.value = iLimit - oText.value.length;
	if(oCounter.value < 0){
		oCounter.value=0;
		if(showAlert){
			alert('The limit of ' + iLimit + ' characters is exceeded!');
		}
		oText.value = oText.value.substring(0,iLimit);
		return false;
	}
	return true;
}
function checkRequired( objCurrent )
{
	if(!isEmpty(objCurrent.value))
	{
		changeClass(objCurrent.id,'formField');
	}
	else
	{
		changeClass(objCurrent.id,'errformField');
	}
}
function checkRequiredSelect( objCurrent )
{
	if(objCurrent.value != "0")
	{
		changeClass(objCurrent.id,'formField');
	}
	else
	{
		changeClass(objCurrent.id,'errformField');
	}
}
function doSincroRequired( objAssociated, isAssociated )
{
	if ( isAssociated )
	{
		checkRequired(objAssociated);
	}
}
function doSincroReset( objAssociated, isAssociated, isAssocieatedRequired )
{
	if ( isAssociated )
	{
		resetCSS ( objAssociated ) ;
		
		if ( isAssocieatedRequired ) 
			checkRequired ( objAssociated );
	}
}
function checkRequiredMoney( objCurrent )
{
	if((!isEmpty(objCurrent.value)) && (objCurrent.value!="$0.00"))
	{
		changeClass(objCurrent.id,'formField');
	}
	else
	{
		changeClass(objCurrent.id,'errformField');
	}
}
function resetCSS( objCurrent )
{
	changeClass(objCurrent.id,'formField');
}

function doValidateForm()
{
	
	var objForm = document.forms.frmOnlineDonation;
	var objCurrent;
	var isValid = true;
	var AlertMessage = "";
	var FirstErrField;
	
	/* AMOUNT */
	objCurrent = objForm.txtDonationAmount;
	if((isEmpty(objCurrent.value)) || (objCurrent.value=="$0.00"))
	{
		changeClass('txtDonationAmount','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donation amount.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	
	var amount = (objCurrent.value.indexOf('$')>-1)? objCurrent.value.substr(1,objCurrent.value.length-1):objCurrent.value ;
	amount = amount.replace(/,/g,'');
	if (parseFloat(amount)<parseFloat(1))
	{
		changeClass('txtDonationAmount','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Smallest donation amount is $1.00";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	
	/* DONOR */
	objCurrent = objForm.txtDonorFirstName;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtDonorFirstName','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donor first name.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtDonorLastName;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtDonorLastName','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donor last name.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtDonorZip;
	if(!isEmpty(objCurrent.value))
	{
		if(!isZip(objCurrent.value))
		{
			changeClass('txtDonorZip','errformField');
			if ( isValid ) 
			{
				AlertMessage = "Please, enter a valid zip code.";
				FirstErrField = objCurrent;
			}
			isValid = false;
		}
	}
	
	objCurrent = objForm.txtDonorEmail;
	objCurrent.value = StripSpaces(objCurrent.value);
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtDonorEmail','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donor email address.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	if(!isEmail(objCurrent.value)) 
	{
		changeClass('txtDonorEmail','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter a valid email address.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtDonorPhone;
	if(!isEmpty(objCurrent.value))
	{
		if(!validateUSPhone(objCurrent.value))
		{
			changeClass('txtDonorPhone','errformField');
			if ( isValid ) 
			{
				AlertMessage = "Please, enter a valid phone number. (e.g. 555-555-5555)";
				FirstErrField = objCurrent;
			}
			isValid = false;
		}
	}
	
	/* BILLING */
	objCurrent = objForm.txtBillingFirstName;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtBillingFirstName','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter billing first name.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtBillingLastName;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtBillingLastName','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter billing last name.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.selBillingCountry;
	if(objCurrent.value == "0")
	{
		changeClass('selBillingCountry','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter billing country.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtBillingAddress1;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtBillingAddress1','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter billing address.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtBillingCity;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtBillingCity','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter billing city.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtBillingZip;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtBillingZip','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter billing zip/postal code.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	else
	{
		if((!isZip(objCurrent.value)) && (objForm.selBillingCountry.value == "United States of America"))
		{
			changeClass('txtBillingZip','errformField');
			if ( isValid ) 
			{
				AlertMessage = "Please, enter a valid zip code.";
				FirstErrField = objCurrent;
			}
			isValid = false;
		}
	}
	
	objCurrent = objForm.txtBillingPhone;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtBillingPhone','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter billing phone number.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	else
	{
		if((!validateUSPhone(objCurrent.value)) && (objForm.selBillingCountry.value == "United States of America"))
		{
			changeClass('txtBillingPhone','errformField');
			if ( isValid ) 
			{
				AlertMessage = "Please, enter a valid phone number. (e.g. 555-555-5555)";
				FirstErrField = objCurrent;
			}
			isValid = false;
		}
	}
	
	
	// general err mgmt
	if ( !isValid ) 
	{
		objForm.hidAction.value = "";
		if(FirstErrField) FirstErrField.focus();
		alert('' + AlertMessage + '');
	}
	else
	{
		if(confirm("This will start Secure Payment process. Please make sure that the billing information is accurate.\n\rContinue?")){
			objForm.btnSubmit.value = "Please Wait...";
			//objForm.btnSubmit.disabled = true;
			objForm.hidAction.value = "send";
		}
		else
		{
			isValid = false;
		}
	}
	return isValid; 	
}
function autoNumber(CtrlID) 
{			
	var oCtrl = eval("document.forms.frmOnlineDonation." + CtrlID);
	if(oCtrl){
		if(oCtrl.value.length > 0){
			oCtrl.value = oCtrl.value.replace(/-/,"");
		}
		
		var num = new NumberFormat();
		num.setInputDecimal('.');
		num.setNumber(oCtrl.value);
		num.setPlaces('2', false);
		num.setCurrencyValue('$');
		num.setCurrency(true);
		num.setCurrencyPosition(num.LEFT_OUTSIDE);
		num.setNegativeFormat(num.LEFT_DASH);
		num.setNegativeRed(false);
		num.setSeparators(true, ',', ',');
		oCtrl.value = num.toFormatted();
		
		
		/*oCtrl.value = new NumberFormat(oCtrl.value).toFormatted();*/
	}
}
/*** CAR DONATION RELATED FUNCTIONS ***/
function CheckSameAsDonor ( oChkSame )
{
	var objForm = document.forms.frmCarDonation;
	if( oChkSame.checked ){
		
		if (!isEmpty(objForm.txtDonorAddress))
		{
			doAssociateObjects( objForm.txtDonorAddress, objForm.txtLocationAddress, true);
			checkRequired ( objForm.txtDonorAddress );
		}
		
		if (!isEmpty(objForm.selDonorState))
		{
			doAssociateObjects( objForm.selDonorState, objForm.selLocationState, true);
			checkRequiredSelect ( objForm.selDonorState );
		}
		
		if (!isEmpty(objForm.txtDonorCity))
		{
			doAssociateObjects( objForm.txtDonorCity, objForm.txtLocationCity, true );
			checkRequired ( objForm.txtDonorCity );
		}
		
		if (!isEmpty(objForm.txtDonorZip))
		{
			doAssociateObjects( objForm.txtDonorZip, objForm.txtLocationZip, true );
			checkRequired ( objForm.txtDonorZip );
		}
		
	}
	else{
		doClearObject(objForm.txtLocationAddress, "");
		doClearObject(objForm.selLocationState, 0);
		doClearObject(objForm.txtLocationCity, "");
		doClearObject(objForm.txtLocationZip, "");
	}
}
function checkedPrograms()
{
	var bChecked = false;
	for( i=1; i<= document.forms.frmCarDonation.chkGroup.length; i++ )
	{
		eval('var tmpChk = document.forms.frmCarDonation.chkGroup' + i);
		
		if (tmpChk.checked) 
		{
			bChecked = true;
		}
	}
	return bChecked;
}
function checkedAll(oChk)
{
	if (oChk.checked)
	{
		for( i=1; i<= document.forms.frmCarDonation.chkGroup.length-1; i++ )
		{
			eval('var tmpChk = document.forms.frmCarDonation.chkGroup' + i);
			tmpChk.checked = true;
		}
	}
	else
	{
		for( i=1; i<= document.forms.frmCarDonation.chkGroup.length-1; i++ )
		{
			eval('var tmpChk = document.forms.frmCarDonation.chkGroup' + i);
			tmpChk.checked = false;
		}
	}
}
function doValidateCarForm()
{
	var objForm = document.forms.frmCarDonation;
	var objCurrent;
	var isValid = true;
	var AlertMessage = "";
	var FirstErrField;
	
	if(!checkedPrograms())
	{
		AlertMessage = "Please, select at least one Program that you'd like your car donation to support.";
		FirstErrField = objForm.chkGroup1;
		isValid = false;
	}
	
	
	
	/* VEHICLE */
	objCurrent = objForm.selVehicleMake;
	if(objCurrent.value == "0")
	{
		changeClass('selVehicleMake','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, select vehicle make.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	objCurrent = objForm.selVehicleModel;
	if(objCurrent.value == "0")
	{
		changeClass('selVehicleModel','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, select vehicle model.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	objCurrent = objForm.selVehicleColor;
	if(objCurrent.value == "0")
	{
		changeClass('selVehicleColor','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, select vehicle color.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtVehicleYear;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtVehicleYear','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter vehicle year.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	else
	{
		if(!isInteger(objCurrent.value))
		{
			changeClass('txtVehicleYear','errformField');
			if ( isValid ) 
			{
				AlertMessage = "Please, enter a valid year.";
				FirstErrField = objCurrent;
			}
			isValid = false;
		}
		else
		{
			if((objCurrent.value < 1800 )||(objCurrent.value > (new Date()).getFullYear())){
				changeClass('txtVehicleYear','errformField');
				if ( isValid ) 
				{
					AlertMessage = "Please, enter a valid year.";
					FirstErrField = objCurrent;
				}
				isValid = false;
			}
		}
	}
	
	/* DONOR */
	objCurrent = objForm.selDonorSalutation;
	if(objCurrent.value == "0")
	{
		changeClass('selDonorSalutation','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donor salutation.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtDonorFirstName;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtDonorFirstName','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donor first name.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtDonorLastName;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtDonorLastName','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donor last name.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtDonorEmail;
	objCurrent.value = StripSpaces(objCurrent.value);
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtDonorEmail','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donor email address.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	else{
		if(!isEmail(objCurrent.value)) 
		{
			changeClass('txtDonorEmail','errformField');
			if ( isValid ) 
			{
				AlertMessage = "Please, enter a valid email address.";
				FirstErrField = objCurrent;
			}
			isValid = false;
		}
	}
	
	objCurrent = objForm.txtDonorAddress;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtDonorAddress','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donor mailing address.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtDonorCity;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtDonorCity','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donor city.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.selDonorState;
	if(objCurrent.value == "0")
	{
		changeClass('selDonorState','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donor state.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	
	objCurrent = objForm.txtDonorZip;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtDonorZip','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donor zip code.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	else
	{
		if(!isZip(objCurrent.value))
		{
			changeClass('txtDonorZip','errformField');
			if ( isValid ) 
			{
				AlertMessage = "Please, enter a valid zip code.";
				FirstErrField = objCurrent;
			}
			isValid = false;
		}
	}
	
	objCurrent = objForm.txtDonorHomePhone;
	if(isEmpty(objCurrent.value))
	{
		changeClass('txtDonorHomePhone','errformField');
		if ( isValid ) 
		{
			AlertMessage = "Please, enter donor phone number.";
			FirstErrField = objCurrent;
		}
		isValid = false;
	}
	else
	{
		if(!validateUSPhone(objCurrent.value))
		{
			changeClass('txtDonorHomePhone','errformField');
			if ( isValid ) 
			{
				AlertMessage = "Please, enter a valid phone number. (e.g. 555-555-5555)";
				FirstErrField = objCurrent;
			}
			isValid = false;
		}
	}
	
	objCurrent = objForm.txtDonorWorkPhone;
	if(!isEmpty(objCurrent.value))
	{
		if(!validateUSPhone(objCurrent.value))
		{
			changeClass('txtDonorWorkPhone','errformField');
			if ( isValid ) 
			{
				AlertMessage = "Please, enter a valid phone number. (e.g. 555-555-5555)";
				FirstErrField = objCurrent;
			}
			isValid = false;
		}
	}
	
	/* VEHICLE Location */
	objCurrent = objForm.txtLocationZip;
	if(!isEmpty(objCurrent.value))
	{
		if(!isZip(objCurrent.value))
		{
			changeClass('txtDonorZip','errformField');
			if ( isValid ) 
			{
				AlertMessage = "Please, enter a valid zip code.";
				FirstErrField = objCurrent;
			}
			isValid = false;
		}
	}
	
	// general err mgmt
	if ( !isValid ) 
	{
		objForm.hidAction.value = "";
		if(FirstErrField) FirstErrField.focus();
		alert('' + AlertMessage + '');
	}
	else
	{
		objForm.btnSubmit.value = "Please Wait...";
		//objForm.btnSubmit.disabled = true;
		objForm.hidAction.value = "send";
	}
	return isValid; 	
}