///////////////////////////////////////////////////////////////////////////////////////
function validate()
{

var txt_cn = document.getElementById("cn"),
    txt_ph = document.getElementById("ph"),
	txt_nm = document.getElementById("nm"),
	txt_pos = document.getElementById("pos"),
	txt_email = document.getElementById("em");

		
	if(txt_cn.value == ""){
		alert("Please specify your Company Name !")
		txt_cn.focus();
		return false;
	}
	if(txt_nm.value == ""){
		alert("Please specify your name!")
		txt_nm.focus();
		return false;
	}

	if(txt_pos.value == ""){
		alert("Please specify your position / job !")
		txt_pos.focus();
		return false;
	}
	if(txt_email.value==""){
		alert("Your email address does not seems to be valid!")
		txt_email.focus();
		return false;
	}
	
	var at=txt_email.value.indexOf("@");
	var dot=txt_email.value.lastIndexOf(".");	
	if(dot<=at){
		alert("Your email address does not seems to be valid!")
		txt_email.focus();
		return false;
	}
	if(txt_ph.value == ""){
		alert("Please specify your phone number!")
		txt_ph.focus();
		return false;
	}

return true	
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function validate0()
{

var txt_ph = document.getElementById("ph"),
	txt_nm = document.getElementById("nm"),
	txt_email = document.getElementById("em");

		
	if(txt_nm.value == ""){
		alert("Please specify your name!")
		txt_nm.focus();
		return false;
	}
	if(txt_email.value==""){
		alert("Your email address does not seems to be valid!")
		txt_email.focus();
		return false;
	}
	
	var at=txt_email.value.indexOf("@");
	var dot=txt_email.value.lastIndexOf(".");	
	if(dot<=at){
		alert("Your email address does not seems to be valid!")
		txt_email.focus();
		return false;
	}
	if(txt_ph.value == ""){
		alert("Please specify your phone number!")
		txt_ph.focus();
		return false;
	}

return true	
}
