﻿function setforgotpass()
{document.getElementById('hcEvent').value=3;document.forms[0].submit();return false;}
function ValForgotPassForm()
{if(document.getElementById('txtEmailAddress').value=="")
{alert('Enter Email Address');return false;}
if(echeck(document.getElementById('txtEmailAddress').value)==false)
{alert('Enter valid Your Email');return false;}
document.getElementById('hcEvent').value=4;document.forms[0].submit();}
function requireFriMsgText()
{if(document.getElementById('txtSiteSearch')!=null)
{if((document.getElementById('txtSiteSearch').value=="")||(document.getElementById('txtSiteSearch').value=="Search...")||(document.getElementById('txtSiteSearch').value=="Søk ..."))
{if(document.getElementById('txtFriendName').value=="")
{alert('Enter Friend Name');return false;}
if(document.getElementById('txtYourName').value=="")
{alert('Enter your Name');return false;}
if(echeck(document.getElementById('txtFriendEmail').value)==false)
{alert('Enter valid Your Friend Email');return false;}
if(echeck(document.getElementById('txtYourEmail').value)==false)
{alert('Enter valid Your Email');return false;}
if(document.getElementById('txtMessage').value=="")
{alert('Enter Message');return false;}
document.getElementById('hcTipmsg').value=1;document.forms[0].submit();return true}}
else
{if(document.getElementById('txtFriendName').value=="")
{alert('Enter Friend Name');return false;}
if(document.getElementById('txtYourName').value=="")
{alert('Enter your Name');return false;}
if(echeck(document.getElementById('txtFriendEmail').value)==false)
{alert('Enter valid Your Friend Email');return false;}
if(echeck(document.getElementById('txtYourEmail').value)==false)
{alert('Enter valid Your Email');return false;}
if(document.getElementById('txtMessage').value=="")
{alert('Enter Message');return false;}
document.getElementById('hcTipmsg').value=1;document.forms[0].submit();return true}
return false;}
function valPageLogin()
{if(document.getElementById('txtusername').value=="")
{alert('Enter User Name');return false;}
if(document.getElementById('txtPassword').value=="")
{alert('Enter Password');return false;}
document.forms[0].submit();return true}
function requireNlReg()
{if(document.getElementById('txtSmsName').value=="")
{alert('Enter Your Name');return false;}
if(document.getElementById('txtMobileNum').value=="")
{alert('Enter Password');return false;}
document.forms[0].submit();return true}
function requireMobReg()
{if(document.getElementById('txtSmsName').value=="")
{alert('Enter Your Name');return false;}
if(document.getElementById('txtMobileNum').value=="")
{alert('Enter Password');return false;}
document.forms[0].submit();return true}
function valNewsLogin()
{if(document.getElementById('txtusernamenews').value=="")
{alert('Enter User Name');return false;}
if(document.getElementById('txtPasswordnews').value=="")
{alert('Enter Password');return false;}
document.forms[0].submit();return true}
function valTraderecordLogin()
{if(document.getElementById('txtusernametrade').value=="")
{alert('Enter User Name');return false;}
if(document.getElementById('txtPasswordtrade').value=="")
{alert('Enter Password');return false;}
document.forms[0].submit();return true}
function ValCommentForm()
{if(document.getElementById('txtname').value=="")
{alert('Enter Name');return false;}
if(document.getElementById('txtemail').value=="")
{alert('Email id Require');return false;}
if(echeck(document.getElementById('txtemail').value)==false)
{alert('Enter valid Email');return false;}
if(document.getElementById('txtComment').value=="")
{alert('Enter Comment');return false;}
document.forms[0].submit();return true}
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 ID")
return false}
if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr){alert("Invalid E-mail ID")
return false}
if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr){alert("Invalid E-mail ID")
return false}
if(str.indexOf(at,(lat+1))!=-1){alert("Invalid E-mail ID")
return false}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){alert("Invalid E-mail ID")
return false}
if(str.indexOf(dot,(lat+2))==-1){alert("Invalid E-mail ID")
return false}
if(str.indexOf(" ")!=-1){alert("Invalid E-mail ID")
return false}
return true}
function ValLoginForm()
{if(document.getElementById('txtEmailAddress').value=="")
{alert('Email id Require');return false;}
if(echeck(document.getElementById('txtEmailAddress').value)==false)
{alert('Enter valid Email');return false;}
if(document.getElementById('txtPassword').value=="")
{alert('Enter Password');return false;}
document.getElementById('hcEvent').value=1;document.forms[0].submit();return true}
function ValResetPassForm()
{if(document.getElementById('txtEmailAddress').value=="")
{alert('Email id Require');return false;}
if(echeck(document.getElementById('txtEmailAddress').value)==false)
{alert('Enter valid Email');return false;}
if(document.getElementById('txtPassword').value=="")
{alert('Enter Password');return false;}
if(document.getElementById('txtConfirmPassword').value=="")
{alert('Enter Confirm Password');return false;}
if(document.getElementById('txtConfirmPassword').value!=document.getElementById('txtPassword').value)
{alert('Enter Confirm Password');return false;}
document.getElementById('hcEvent').value=5;document.forms[0].submit();return true}
function ValRegistrationForm()
{if(document.getElementById('txtNewEmailAddress').value=="")
{alert('Email id Require');return false;}
if(echeck(document.getElementById('txtNewEmailAddress').value)==false)
{alert('Enter valid Email');return false;}
if(document.getElementById('txtNewPassword').value=="")
{alert('Enter Password');return false;}
if(document.getElementById('txtConfirmPassword').value=="")
{alert('Enter Confirm Password');return false;}
if(document.getElementById('txtConfirmPassword').value!=document.getElementById('txtNewPassword').value)
{alert('Confirm Password and Password not match');return false;}
if(document.getElementById('txtFirstName').value=="")
{alert('Enter First Name');return false;}
if(document.getElementById('txtLastName').value=="")
{alert('Enter Last Name');return false;}
if(document.getElementById('txtAddress1').value=="")
{alert('Enter Billing Address');return false;}
if(document.getElementById('cmbCountry').value=="0")
{alert('Select Country');return false;}
if(document.getElementById('txtPhone').value=="")
{alert('Enter Phone');return false;}
document.getElementById('hcEvent').value=2;document.forms[0].submit();return true}
function ValRegistrationEditForm()
{if(document.getElementById('txtEmailAddress').value=="")
{alert('Email id Require');return false;}
if(echeck(document.getElementById('txtEmailAddress').value)==false)
{alert('Enter valid Email');return false;}
if(document.getElementById('txtFirstName').value=="")
{alert('Enter First Name');return false;}
if(document.getElementById('txtLastName').value=="")
{alert('Enter Last Name');return false;}
if(document.getElementById('txtAddress1').value=="")
{alert('Enter Billing Address');return false;}
if(document.getElementById('cmbCountry').value=="0")
{alert('Select Country');return false;}
if(document.getElementById('txtAddress2').value=="")
{alert('Enter delivery Address');return false;}
if(document.getElementById('cmbCountry1').value=="0")
{alert('Select delivery Country');return false;}
if(document.getElementById('txtPhone').value=="")
{alert('Enter Phone');return false;}
document.getElementById('hcEvent').value=2;document.forms[0].submit();return true}
function ValidateForm(txtCnt){var emailID=txtCnt;if((emailID.value==null)||(emailID.value=="")){alert("Please Enter your Email ID")
return false}
if(echeck(emailID.value)==false){emailID.value=""
return false}
return true}
function enablelnk(){ var e=document.getElementsByTagName("a"); for(var i=0;i<e.length;i++) {  if(e[i].rel=='lightbox[')  {   e[i].onclick = ''; }  }}
function keypressEve(e,search,checkval){if(checkval != '0')	{var keynum;var keychar;if(window.event){keynum = e.keyCode;}else if(e.which){keynum = e.which;}if(keynum==13){if(document.getElementById('txtSiteSearch').value != 'search'){document.forms[0].submit()}}}}
function tellerror(err){ return true;}window.onerror=tellerror;
