<!--

var digits = "0123456789";
var phoneNumberDelimiters = "()- ";
var validWorldPhoneChars = phoneNumberDelimiters + "+";
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

var emailFilter=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;

function checkForm()
{
   var ch_name, ch_company, ch_country, ch_email;   
   
   with(window.document.iform)
   {
      ch_name = pname;    
	  ch_company = company;     
	  ch_country = country;	 
	  ch_email = email;	
	  //ch_contact = contact;	 
	 // ch_ans = answer;
   }
  		var at="@"
		var dot="."
		var str=ch_email.value
		var lat=str.lastIndexOf(at)
		var lstr=str.length
		var ldot=str.lastIndexOf(dot)		
		var atpos=str.lastIndexOf(at)
		var dotpos=str.lastIndexOf(dot)
		var dname= str.substring(atpos+1, dotpos)

   if(trim(ch_name.value) == '')
   {
      alert('Please enter your Name');
      ch_name.focus();
      return false;	 
   }   
   
   else if(trim(ch_company.value) == '')
   {
      alert('Please enter your Company Name');
      ch_company.focus();
      return false;	  
   } 
    else if(trim(ch_country.value) == '-')
   {
      alert('Please select your Cuntry');
      ch_country.focus();
      return false;	 
   }  
   else if(trim(ch_email.value) == '')
   {
      alert('Please enter your Email');
      ch_email.focus();
      return false;	  
   } 
   else if (!(emailFilter.test(ch_email.value))) { 
       alert("Please enter a valid email address.");
	   ch_email.focus()
	   return false;
	}
	/*
	else if(trim(ch_contact.value) == '')
   {
      alert('Please enter your Telephone Number');
      ch_contact.focus();
      return false;	  
   }  
   else if (checkInternationalPhone(ch_contact.value)==false){
		alert("Please Enter a Valid Phone Number")
		ch_contact.focus()
		return false
	}*/
   else
   {     
	 iform.submit();
      return true;
	  
   }
}

function trim(str)
{
   return str.replace(/^\s+|\s+$/g,'');
}

//-->