function trim1(inputString)
{
    if (typeof inputString != "string")
    {
        return inputString;
    }
    var retValue = inputString;
    var ch = retValue.substring(0, 1);
    while (ch == " ")
    { // Check for spaces at the beginning of the string
        retValue = retValue.substring(1, retValue.length);
        ch = retValue.substring(0, 1);
    }
    ch = retValue.substring(retValue.length-1, retValue.length);
    while (ch == " ")
    { // Check for spaces at the end of the string
        retValue = retValue.substring(0, retValue.length-1);
        ch = retValue.substring(retValue.length-1, retValue.length);
    }
    //while (retValue.indexOf(" ") != -1) { // Note that there are two 
 //spaces in the string - look for multiple spaces within the string
    //retValue = retVal
//}
return retValue;
}
    var vld_Email =  
/^(([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,5}|[0-9]{1,3})(\]?))?$/;
 
function temp(){
}
     function validate()
    {
	if(trim1(document.form1.name.value)=="")
	{
	alert("Please enter your first name")
	document.form1.name.focus();
	return false;
	}
	
	else if(trim1(document.form1.lname.value)=="")
	{
	alert("Please enter your last name")
	document.form1.lname.focus();
	return false;
	}
	
	else if(trim1(document.form1.cname.value)=="")
	{
	alert("Please enter your company name")
	document.form1.cname.focus();
	return false;
	}
	
	else if(trim1(document.form1.add1.value)=="")
	{
	alert("Please enter your address")
	document.form1.add1.focus();
	return false;
	}
	
	else if(trim1(document.form1.city.value)=="")
	{
	alert("Please enter your city")
	document.form1.city.focus();
	return false;
	}
	
	else if(trim1(document.form1.state.value)=="")
	{
	alert("Please enter your state")
	document.form1.state.focus();
	return false;
	}	
    
	else if(trim1(document.form1.zip.value)=="")
	{
	alert("Please enter zip")
	document.form1.zip.focus();
	return false;
	}
					
	else
	{
	document.form1.submit();
	}
	}

	
	
function resetForm()
{
	document.form1.reset();
	document.form1.name.focus();
}

function CheckallreadInterset()
{
bcheck = false;
if(document.form1.chkAll.checked)
bcheck =true;

    document.form1.chkDrivers.checked= bcheck;
    document.form1.chkWarehousepersonnel.checked= bcheck;
    document.form1.chkPackaging.checked= bcheck;
    document.form1.chkCustomerService.checked= bcheck;
   
}

