function requestsubmit()
{
	var f=document.resumefrm;
	if(trim(f.companyName.value)=='')
		{
			alert('Please enter company name');
			f.companyName.focus();
			return false;
		}
   	checkEmail=f.email.value;
	if(trim(f.email.value)=='')
		{
			alert('Please enter your email address');
			f.email.focus();
			return false;
		}
	
	if (emailCheck(checkEmail)==false)
	{
		alert('Please enter your email address');
		f.email.focus();			
		return false;
	}											
	if(trim(f.telephone.value)=='')
		{
			alert('Please enter your telephone no');
			f.telephone.focus();
			return false;
		}
	
	if(trim(f.customerName.value)=='')
		{
			alert('Please enter your name');
			f.customerName.focus();
			return false;
		}
	
	if(trim(f.title.value)=='')
		{
			alert('Please enter title');
			f.title.focus();
			return false;
		}
	
	if(trim(f.city.value)=='')
		{
			alert('Please enter city');
			f.city.focus();
			return false;
		}
	
	if(trim(f.state.value)=='')
		{
			alert('Please enter state');
			f.state.focus();
			return false;
		}
	
	if(trim(f.zip.value)=='')
		{
			alert('Please enter zip');
			f.zip.focus();
			return false;
		}
	if(trim(f.address.value)=='')
		{
			alert('Please enter address');
			f.address.focus();
			return false;
		}
	
	if(trim(f.annualusage.value)=='')
		{
			alert('Please enter Expected Annual Usage');
			f.annualusage.focus();
			return false;
		}
	
	if(f.security_code.value=='')
		{
		 alert('Please enter security code');
		 f.security_code.focus();			
		return false;
		 }
	return true;
}

function trim(str, chars) {
    return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}
function emailCheck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    
		    return false
		 }
				
	}


function isUnsinged (InString)  {
    if(InString.length==0) return (false);
    var RefString="1234567890";
    for (Count=0; Count < InString.length; Count++)  {
        TempChar= InString.substring (Count, Count+1);
        if (RefString.indexOf (TempChar, 0)==-1)  
            return (false);
    }
    return (true);
}



