function fnLoadQuestion()    {    var pstrLocation = new String(location.href);	try	{		//alert(pstrLocation.toLowerCase().indexOf('sendmail=true'));		if(pstrLocation.toLowerCase().indexOf('sendmail=true') == -1)		{			document.getElementById('divMail').style.display = "";			document.getElementById('divSuccess').style.display = "none";		}		else		{			document.getElementById('divMail').style.display = "none";			document.getElementById('divSuccess').style.display = "";		}	}	catch(Exec){}  //Check for automated spambot  var spam1=Math.floor(Math.random()*5);  var spam2=Math.floor(Math.random()*5);  var spam_result=spam1 + spam2;  if (spam1==0){spam1="zero"};  if (spam1==1){spam1="one"};  if (spam1==2){spam1="two"};  if (spam1==3){spam1="three"};  if (spam1==4){spam1="four"};  if (spam1==5){spam1="five"};  if (spam2==0){spam2="zero"};  if (spam2==1){spam2="one"};  if (spam2==2){spam2="two"};  if (spam2==3){spam2="three"};  if (spam2==4){spam2="four"};  if (spam2==5){spam2="five"};  document.getElementById('question').innerHTML= "What is " + spam1 + " + " + spam2 +"?";  //alert(document.getElementById('question').innerHTML);  var bdiv=document.getElementById('spam_ans');  bdiv.value=spam_result;  }  function fnValidatePage()  {    var strError = new Array();    if(document.getElementById('txtName').value == '')        strError.push("Please enter the name");    if(document.getElementById('txtEmail').value == '')        strError.push("Please enter the email");    if(fnEmailCheck(document.getElementById('txtEmail').value) == false)        strError.push("Invalid email");    if(document.getElementById('txtDetails').value == '')        strError.push("Please enter the enquiry details");    if(document.getElementById('mgsfld1').value == '')        strError.push("Please enter the answer");    if(document.getElementById('spam_ans').value == document.getElementById('mgsfld1').value)    {    }    else        strError.push("Incorrect answer");    for(var _var_ArrCnt=0;_var_ArrCnt<strError.length;_var_ArrCnt++)	{		$.prompt(strError[_var_ArrCnt]);		strError.unshift(_var_ArrCnt);		break;	}	//$.prompt(strError.length);	if(strError.length == 0)	{	    return true;	}	else	{	    return false;	}  }  /******************************************************************** PROCEDURE		: fnEmailCheck* PURPOSE		: Function Call to Validate EmailId* NOTES			:* CREATED		: Shankara Subramanian.M - 24 Mar 2009*------------------------------------------------------------------**					MODIFIED* DATE		AUTHOR			DESCRIPTION*------------------------------------------------------------------*{date}		{developer}	{brief modification description}********************************************************************///=======================================================================================//Function to validate the EMailfunction fnEmailCheck (emailStr){    var checkTLD=1;    var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;    var emailPat=/^(.+)@(.+)$/;    var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";    var validChars="\[^\\s" + specialChars + "\]";    var quotedUser="(\"[^\"]*\")";    var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;    var atom=validChars + '+';    var word="(" + atom + "|" + quotedUser + ")";    var userPat=new RegExp("^" + word + "(\\." + word + ")*$");    var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");    var matchArray=emailStr.match(emailPat);    if (matchArray==null) {    //$.prompt("Email address seems incorrect (check @ and .'s)");    return false;    }    var user=matchArray[1];    var domain=matchArray[2];    for (i=0; i<user.length; i++) {    if (user.charCodeAt(i)>127) {    //$.prompt("Ths username contains invalid characters.");    return false;       }    }    for (i=0; i<domain.length; i++) {    if (domain.charCodeAt(i)>127) {    //$.prompt("Ths domain name contains invalid characters.");    return false;       }    }    if (user.match(userPat)==null) {    //$.prompt("The username doesn't seem to be valid.");    return false;    }    var IPArray=domain.match(ipDomainPat);    if (IPArray!=null) {    for (var i=1;i<=4;i++) {    if (IPArray[i]>255) {    //$.prompt("Destination IP address is invalid!");    return false;       }    }    return true;    }    var atomPat=new RegExp("^" + atom + "$");    var domArr=domain.split(".");    var len=domArr.length;    for (i=0;i<len;i++) {    if (domArr[i].search(atomPat)==-1) {    //$.prompt("The domain name does not seem to be valid.");    return false;       }    }    if (checkTLD && domArr[domArr.length-1].length!=2 &&    domArr[domArr.length-1].search(knownDomsPat)==-1) {    //$.prompt("The address must end in a well-known domain or two letter " + "country.");    return false;    }    if (len<2) {    //$.prompt("This address is missing a hostname!");    return false;    }    return true;}//======================================================================================function CheckKeyPressMobile($char, $mozChar,Type){    if($char != null && $char == 13)        $RetVal = false;    if($mozChar != null && $mozChar == 13)    {        $RetVal = false;        return false;    }    if($mozChar != null)    {	// Look for a Mozilla-compatible browser        if(($mozChar >= 48 && $mozChar <= 57) || $mozChar == 0 || $mozChar == 8 || $mozChar == 13 || $mozChar == 43)        $RetVal = true;    else    {        $RetVal = false;        $.prompt('Please enter numeric value or +');    }    }    else    {	 // Must be an IE-compatible Browser        if(($char >= 48 && $char <= 57) || $char == 13 || $char == 43)            $RetVal = true;        else        {            $RetVal = false;            $.prompt('Please enter numeric value or +');        }    }    return $RetVal;}
