function setCookTemp(){createCookie('loginBarData','1',7);}function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else var expires="";document.cookie=name+"="+value+expires+"; path=/";}function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}return null;}function eraseCookie(name){createCookie(name,"",-1);}function regValidation(){var success=true;if(document.eLearnRegForm1.name.value==""){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Please enter your First Name.";document.eLearnRegForm1.name.focus();success=false;return false;}else if(document.eLearnRegForm1.ulName.value==""){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Please enter your Last Name";document.eLearnRegForm1.uLName.focus();success=false;return false;}else if(document.eLearnRegForm1.day.value==""){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Please select a Day.";document.eLearnRegForm1.day.focus();success=false;return false;}else if(document.eLearnRegForm1.month.value==""){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Please select a Month.";document.eLearnRegForm1.month.focus();success=false;return false;}else if(document.eLearnRegForm1.year.value==""){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Please select a Year.";document.eLearnRegForm1.year.focus();success=false;return false;}else if(document.eLearnRegForm1.address1.value==""){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Please enter your Address";document.eLearnRegForm1.address1.focus();success=false;return false;}else if(document.eLearnRegForm1.address2.value==""){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Please enter your City";document.eLearnRegForm1.address1.focus();success=false;return false;}else if(document.eLearnRegForm1.Zip.value==""){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Please enter your Zip Code";document.eLearnRegForm1.Zip.focus();success=false;return false;}else if(document.eLearnRegForm1.loc.value==""){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Please select your Location";document.eLearnRegForm1.loc.focus();success=false;return false;}else if(document.eLearnRegForm1.Contact.value==""){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Please enter your Contact No.";document.eLearnRegForm1.Contact.focus();success=false;return false;}else if(document.eLearnRegForm1.from.value==""){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Please enter your Email Id";document.eLearnRegForm1.from.focus();success=false;return false;}else{success=emailCheck(document.eLearnRegForm1.from.value)if(success){document.eLearnRegForm1.submit();var lin='';lin=readCookie('chackingL');if(lin==null){window.location="default.aspx";}else if(lin=='111'){window.location="e-welcome.aspx";}else if(lin=='1'){window.location="e-welcome.aspx";}else{window.location="default.aspx";}}}}function emailCheck(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){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* 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){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Ths username contains invalid characters.";return false;}}for(i=0;i<domain.length;i++){if(domain.charCodeAt(i)>127){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* Ths domain name contains invalid characters.";return false;}}if(user.match(userPat)==null){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* 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){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* 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){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* 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){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* The address must end in a well-known domain or two letter "+"country.";return false;}if(len<2){document.getElementById("errorMSGtd").innerHTML="";document.getElementById("errorMSGtd").innerHTML="* This address is missing a hostname!";return false;}return true;}