var counter=0;

function TrimChar (inputString, removeChar){
var returnString = inputString;
if (removeChar.length){
while(''+returnString.charAt(0)==removeChar){
returnString=returnString.substring(1,returnString.length);
}
while(''+returnString.charAt(returnString.length-1)==removeChar){ returnString=returnString.substring(0,returnString.length-1); 
  }
 }
return returnString;
}

//=======================================
function CheckField(Fld,Msge){
Fld.value=TrimChar(Fld.value," ");
if(TrimChar(Fld.value," ")==""){
alert(Msge);Fld.focus(); return false;} 
else { return true;}  
}

//=================================================================
//=================================================================
function Validate(){
var tmp, Msge;

tmp=eval('document.contactform.full_name');
Msge='Please provide your full name';
if(!CheckField(tmp, Msge)){return false; }

tmp=eval('document.contactform.city');
Msge='What City?';
if(!CheckField(tmp, Msge)){return false; }

tmp=eval('document.contactform.phone');
Msge='What is your phone number?';
if(!CheckField(tmp, Msge)){return false; }

tmp=eval('document.contactform.event_date');
Msge='What is the date of your event?';
if(!CheckField(tmp, Msge)){return false; }

tmp=eval('document.contactform.start_time');
Msge='What time will your event start?';
if(!CheckField(tmp, Msge)){return false; }

tmp=eval('document.contactform.setup_time');
Msge='What time would you like for \n'+
'the beverage machine(s) to be in place?';
if(!CheckField(tmp, Msge)){return false; }

tmp=eval('document.contactform.pickup_time');
Msge='What is the pick up time of the \n'+
'margarita machine(s)?(end of the event)';
if(!CheckField(tmp, Msge)){return false; }

tmp=eval('document.contactform.other_info');
TrimChar (tmp.value, ' ');

if(counter<1){
if(confirm("Would you like to provide additional information\n"+
"such as drink flavors, number of bottles...?")){
counter=1;
tmp.focus();
return false;
}
}

document.contactform.submit();
return true;
}