function checkForm()
{
	myObj = document.form1.name;
	if(myObj.value == "")
	{
		alert("Please enter your Name.");
		myObj.focus();
		return false;
	}
	
	myObj = document.form1.address;
	if(myObj.value == "")
	{
		alert("Please enter your Address.");
		myObj.focus();
		return false;
	}
	
	myObj = document.form1.company;
	if(myObj.value == "")
	{
		alert("Please enter your Company Name.");
		myObj.focus();
		return false;
	}	

	myObj = document.form1.designation;
	if(myObj.value == "")
	{
		alert("Please enter your Designation.");
		myObj.focus();
		return false;
	}

	myObj = document.form1.tel_countrycode;
	if(myObj.value == "") 
	{
		alert("Please enter Phone Country Code");
		myObj.focus();
		return false;
	}

	myObj = document.form1.tel;
	if(myObj.value == "")
	{
		alert("Please enter Phone No");
		myObj.focus();
		return false;
	}	

	myObj = document.form1.email;
	if(myObj.value == "")
	{
		alert("Please enter Email");
		myObj.focus();
		return false;
	}	   	

	val6 = document.form1.tel_countrycode;
	val8 = document.form1.tel;	
	
	if(val6!= "" && !IsNumeric(val6.value))
	{
		alert("Please enter numeric value");
		val6.focus();
		return false;
	}

	if(val8!= "" && !IsNumeric(val8.value))
	{
		alert("Please enter numeric value");
		val8.focus();
		return false;
	}
}

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("Please enter valid E-mail ID");
	   return false;
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Please enter valid E-mail ID");
		return false;
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("Please enter valid E-mail ID");
		return false;
	}

	if (str.indexOf(at,(lat+1))!=-1){
		alert("Please enter valid E-mail ID");
		return false;
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("Please enter valid E-mail ID");
		return false;
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		alert("Please enter valid E-mail ID");
		return false;
	 }

	 if (str.indexOf(" ")!=-1){
		alert("Please enter valid E-mail ID");
		return false;
	 }

	 return true;
}

//-------------------------
// Check if its a number
//-------------------------

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;       
}

//-------------------------
// Check if its a number
//-------------------------

function chkIsNumeric(myObj)
{
	if(!IsNumeric(myObj.value))
	{
		alert("Please enter numeric value");
		myObj.focus();
	}
}