// JavaScript Document
		function echeck(str) 
	{
			var at="@"
			var dot="."
			var lat=str.indexOf(at)
			var lstr=str.length
			var ldot=str.indexOf(dot)
			if (str.indexOf(at)==-1){
			   alert("Invalid E-mail Address...")
			   return false
			}
	
			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			   alert("Invalid E-mail Address...")
			   return false
			}
	
			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
				alert("Invalid E-mail Address...")
				return false
			}
	
			 if (str.indexOf(at,(lat+1))!=-1){
				alert("Invalid E-mail Address...")
				return false
			 }
			 //alert(str.indexOf(dot,(ldot+1)))
			 //alert(ldot+1);
			 //alert(lstr);
			 if (str.indexOf(dot,(ldot+1))>0)
			 {
				if(ldot+1 == str.indexOf(dot,(ldot+1)))
				{
					alert("Invalid E-mail Address...")
					return false
				}
				else if(str.indexOf(dot,(ldot+1))>=lstr-1)
				{
					alert("Invalid E-mail Address...")
					return false
				}
			  }
	
			 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
				alert("Invalid E-mail Address...")
				return false
			 }
	
			 if (str.indexOf(dot,(lat+2))==-1){
				alert("Invalid E-mail Address...")
				return false
			 }
	
			 if (str.indexOf(" ")!=-1){
				alert("Invalid E-mail Address...")
				return false
			 }
	
			 return true
	}
	
	
	function validate1(form)
	{
		if(form.name.value == "")
		{
			alert("Please Enter Your First Name...")
			form.name.focus();
			return false;
		}
		if(form.lname.value == "")
		{
			alert("Please Enter Your Last Name...")
			form.lname.focus();
			return false;
		}
		if(form.company.value == "")
		{
			alert("Please Enter Company Name...")
			form.company.focus();
			return false;
		}
		if(form.country.value == "")
		{
			alert("Please select your country...")
			form.country.focus();
			return false;
		}
		if(form.contactno.value == "")
		{
			alert("Please Enter Contact No...")
			form.contactno.focus();
			return false;
		}	
		
		if (!IsNumeric(form.contactno.value)) 
   		{ 
      		alert('Please enter only numbers in the Telephone field...') 
      		form.contactno.focus(); 
      		return false; 
   		} 
		
		if(form.email.value == "")
		{
			alert("Please key in Email Address...")
			form.email.focus();
			return false;
		}
		if(echeck(form.email.value) == 0)
		{
			form.email.select();
			return false;
		}
		
		if(form.comment.value == "")
		{
			alert("Please Enter Your Enquiry...")
			form.comment.focus();
			return false;
		}	
	}
	
	function validate2(form)
	{
		if(form.name.value == "")
		{
			alert("Please Enter Your Name...")
			form.name.focus();
			return false;
		}
		
		if(form.company.value == "")
		{
			alert("Please enter Company Name...")
			form.company.focus();
			return false;
		}
		if(form.country.value == "")
		{
			alert("Please select your country...")
			form.country.focus();
			return false;
		}
		if(form.contactno.value == "")
		{
			alert("Please enter Contact No...")
			form.contactno.focus();
			return false;
		}	
		
		if (!IsNumeric(form.contactno.value)) 
   		{ 
      		alert('Please enter only numbers in the Telephone field...') 
      		form.contactno.focus(); 
      		return false; 
   		} 
		
		if(form.email.value == "")
		{
			alert("Please key in Email Address...")
			form.email.focus();
			return false;
		}
		if(echeck(form.email.value) == 0)
		{
			form.email.select();
			return false;
		}
		
//		if(!valButton(form.needhosting)) 
//  		{ 
//     		alert('Do you need web hosting?') 
//      		//form.name.focus(); 
//      		return false; 
//   		} 
		
//		if(!valButton(form.needdomain)) 
//  		{ 
//      		alert('Do you need domain name?') 
//      		//form.name.focus(); 
//      		return false; 
//   		} 
	}
	
	function valButton(btn) {
    var cnt = -1;
    for (var i=btn.length-1; i > -1; i--) {
        if (btn[i].checked) {cnt = i; i = -1;}
    }
    if (cnt > -1) return btn[cnt].value;
    else return null;
	}
	
	function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }