
function header(path,showViewCartFlag){if(path==null)path="./";if(showViewCartFlag==null)showViewCartFlag=true;document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');document.write('<tr><td width="100%">');document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');document.write('<tr><td width="606" style="background-image:url(\'../images/top-1.gif\');background-repeat:no-repeat" height="77" ></td>');document.write('<td width="217" style="padding-right:70px" align=right valign="top"><img src="../images/internal/satisfaction.gif" height=91 width=93 >&nbsp;&nbsp;<!-- START SCANALERT CODE --><a target="_blank" href="https://www.mcafeesecure.com/RatingVerify?ref=www.tobeapirate.com"><img width="94" height="54" border="0" src="//images.scanalert.com/meter/www.tobeapirate.com/13.gif" alt="McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams" oncontextmenu="alert(\'Copying Prohibited by Law - McAfee Secure is a Trademark of McAfee, Inc.\'); return false;"></a><!-- END SCANALERT CODE -->  </td>');document.write('</tr></table></td></tr>');document.write('<tr><td width="100%">');document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" height="197">');document.write('<tr><td width="90" background="../images/internal/top-left.gif"></td>');document.write('<td width="219" background="../images/internal/top-1.gif" valign="top">');document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');document.write('<tr><td width="50%" height="20"></td><td width="50%" height="20"></td></tr>');document.write('<tr><td width="50%" align="center"><a href="http://www.tobeapirate.com/index.php"><img border="0" src="../images/internal/home-text.gif" width="69" height="24"></a></td>');document.write('<td width="50%" align="center"><a href="http://www.tobeapirate.com/aboutus.php"><img border="0" src="../images/internal/aboutus-text.gif" width="88" height="24"></a></td>');document.write('</tr></table></td>');document.write('<td width="364" background="../images/internal/top-2.gif" valign="top">');document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');document.write('<tr><td width="50%" height="20"></td><td width="50%" height="20"></td></tr>');document.write('<tr><td width="50%" align="center"><a href="http://www.tobeapirate.com/cart/viewCart.php?action=show"><img border="0" src="../images/internal/vewcart-text.gif" width="94" height="24"></a></td>');document.write('<td width="50%" align="center"><a href="http://www.tobeapirate.com/bulk-buyer.php"><img border="0" src="../images/internal/bulkbuyer-text.gif" width="129" height="24"></a></td>');document.write('</tr></table></td>');document.write('<td width="214" background="../images/internal/top-3.gif" valign="top">');document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');document.write('<tr><td width="50%" height="20"></td><td width="50%" height="20"></td></tr>');document.write('<tr><td width="50%" align="center"><a href="http://www.tobeapirate.com/contactus.php"><img border="0" src="../images/internal/contactus-text.gif" width="104" height="24"></a></td>');document.write('<td width="50%" align="right" id="loginlogout"><td>');document.write('</tr></table></td>');document.write('<td width="113" background="../images/internal/top-right.gif">&nbsp;</td>');document.write('</tr></table></td></tr></table>');document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td width="90" background="../images/left2.gif">&nbsp;</td><td width="797"  id="searcharea" bgcolor="#E7DEBD" valign="bottom"></td><td width="113" background="../images/right2.gif">&nbsp;</td></tr></table></form>');}
function home(path,showViewCartFlag){if(path==null)path="./";if(showViewCartFlag==null)showViewCartFlag=true;document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');document.write('<tr><td width="100%">');document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');document.write('<tr><td width="673" style="background-image:url(\'../images/top-1.gif\');background-repeat:no-repeat" height="77" align="right"></td>');document.write('<td style="padding-right:70px" width="94"><!-- START SCANALERT CODE --><a target="_blank" href="https://www.mcafeesecure.com/RatingVerify?ref=www.tobeapirate.com"><img width="94" height="54" border="0" src="//images.scanalert.com/meter/www.tobeapirate.com/13.gif" alt="McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams" oncontextmenu="alert(\'Copying Prohibited by Law - McAfee Secure is a Trademark of McAfee, Inc.\'); return false;"></a><!-- END SCANALERT CODE --> </td>');document.write('</tr></table></td></tr>');document.write('<tr><td width="100%">');document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" height="205">');document.write('<tr><td width="90" background="../images/left1.gif"></td>');document.write('<td width="219" background="../images/top1.gif" valign="top">');document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');document.write('<tr><td width="50%" height="20"></td><td width="50%" height="20"></td></tr>');document.write('<tr><td width="50%" align="center"><a href="http://www.tobeapirate.com/index.php"><img border="0" src="../images/internal/home-text.gif" width="69" height="24"></a></td>');document.write('<td width="50%" align="center"><a href="http://www.tobeapirate.com/aboutus.php"><img border="0" src="../images/internal/aboutus-text.gif" width="88" height="24"></a></td>');document.write('</tr></table></td>');document.write('<td width="364" background="../images/top2.gif" valign="top">');document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');document.write('<tr><td width="50%" height="20"></td><td width="50%" height="20"></td></tr>');document.write('<tr><td width="50%" align="center"><a href="http://www.tobeapirate.com/cart/viewCart.php?action=show"><img border="0" src="../images/internal/vewcart-text.gif" width="94" height="24"></a></td>');document.write('<td width="50%" align="center"><a href="http://www.tobeapirate.com/bulk-buyer.php"><img border="0" src="../images/internal/bulkbuyer-text.gif" width="129" height="24"></a></td>');document.write('</tr></table></td>');document.write('<td width="214" background="../images/top3.gif" valign="top">');document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');document.write('<tr><td width="50%" height="20"></td><td width="50%" height="20"></td></tr>');document.write('<tr><td width="50%" align="center"><a href="http://www.tobeapirate.com/contactus.php"><img border="0" src="../images/internal/contactus-text.gif" width="104" height="24"></a></td>');document.write('<td width="50%" align="right" id="loginlogout"></td>');document.write('</tr></table></td>');document.write('<td width="113" background="../images/top4.gif"></td>');document.write('</tr></table></td></tr>');document.write('<tr><td width="100%">');document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');document.write('<tr><td width="90" background="../images/left2.gif"></td>');document.write('<td width="797" background="../images/top-bg.jpg" height="50" valign="middle"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td width="30%" id="searchbg"></td><td width="70%" id="userpass" align="right"></td></tr></table></td>');document.write('<td width="113" background="../images/right2.gif"></td></tr></table></td></tr></table>');}
function validSearch()
{if(document.frm_se.keywords.value==''||document.frm_se.keywords.value=='Enter Search Keywords')
{alert("Please Enter Keywords for search");document.frm_se.keywords.focus();return false;}}
function leftpanel(path){if(path==null)path="./";document.write('<TABLE WIDTH=150 CELLPADDING=0 CELLSPACING=0 ><TR><TD><? include("/store/dCategories.php") ?><!-- <IFRAME WIDTH="100%" HEIGHT="100%" SRC="/store/dCategories.php" FRAMEBORDER=0></IFRAME> --></TD></TR></TABLE>');}
function rightpanel(path){if(path==null)path="./";document.write('<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=0 BGCOLOR=WHITE><tr height=6><td></td></tr><TR HEIGHT=25><TD><img src=../images/memberlogin.jpg width="178" height="25">');document.write('</TD></TR><TR><TD><table border="0" cellspacing="0" cellpadding="0" width=100%><tr><td width="100%"><form NAME="login_form" ACTION="../user/login.php" METHOD=POST onsubmit="return checkLoginForm(this);">');document.write('<table border="0" cellspacing="2" cellpadding="0" width =178 height=77 background="../images/memberlogin_stripbg.jpg"><tr><td width="40%" align=right><font class=login>&nbsp;<b>Login</b></font></td>');document.write('<td width="60%" colspan=2><input type=text name="user_id" size="14" style="{font-size=10}"></td></tr><tr><td width="40%" align=right><font class=login>&nbsp;<b>Password</b></font></td>');document.write('<td><input type=password name="password" size="10" style="{font-size=10}"></td><td> <input type="image" src="../images/bulet1.gif" width="27" height="16"></td>');document.write('</tr><tr><td width="100%" colspan="3"><a href="../user/newLogin.php"><font color="#484848" face="Verdana" size="1"><b>');document.write('New User</b></font></a>&nbsp;&nbsp;<a href=../user/forgotPassword.php><font color="#484848" face="Verdana" size="1"><b>Forgot Password</b></font></a></td></tr></table></form></td></tr></table></TD></TR>');document.write('<tr><td height=5></td></tr><TR><TD valign=top height=23>');document.write('<img src=../images/showcase.jpg  width="178" height="23"></td></tr>');document.write('<tr><td width="178" background="../images/showcase_stripbg.jpg" width="178" height = 100 valign=middle><p align="center"><IMG name="SlideShow" id="SlideShow" src="../images/image.jpg" width="140" height="87"  border=1><script>runSlideShow()</script></p></td></tr>');document.write('<tr><td><table width=100% cellspacing=0 bgcolor="#FFF8E8"><tr><td height="180"><embed width="174" height="153" src="banner.swf"></p></td></tr><tr><td height=50 valign="middle"><p align="center"> <a href="digital-signature.htm" class="A"> <img src=../images/banner1.jpg  width="140" height="87" border=0> </a></p></td></tr><tr><td height=2></td></tr><tr><td height=87 valign="middle"><p align="center"><a href="computer-backup.htm"><img src=../images/banner2.jpg  width="140" height="87" border=0></a></p></td></tr><tr><td height=5></td></tr><tr><td height=87 valign="middle"><p align="center"><a href="easypay.htm"><img src=../images/banner3.jpg  width="140" height="87" border=0></a></p></td></tr><tr><td height=5></td></tr><tr><td height=87 valign="middle"><p align="center"><a href="easytdslite.htm"><img src=../images/banner4.jpg  width="140" height="87" border=0></a></p></td></tr></table></td></tr></table>');}
function footer(path){if(path==null)path="./";document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');document.write('<tr><td width="100%" colspan="2" height="15"></td></tr>');document.write('<tr><td width="80%"><br><div align="left">');document.write('<table border="0" cellpadding="0" cellspacing="0" width="95%">');document.write('<tr><td width="17%" align="center"><a href="http://www.tobeapirate.com/index.php" class="newuser">Home</a></td>');document.write('<td width="17%" align="center"><a href="http://www.tobeapirate.com/aboutus.php" class="newuser">About Us</a></td>');document.write('<td width="17%" align="center"><a href="http://www.tobeapirate.com/contactus.php" class="newuser">Contact Us</a></td>');document.write('<td width="17%" align="center"><a href="http://www.tobeapirate.com/product_page.php" class="newuser">Products</a></td>');document.write('<td width="17%" align="center"><a href="http://www.buypirateboots.com/male-pirate-boots-shoes.html" target="_blank" class="newuser">Pirate Boots</a></td>');document.write('<tr><td colspan="6" width="100%" height="5"></td></tr>');document.write('<tr><td colspan="6" width="100%" align="center">©2010 Copyright ToBeAPirate.com</td></tr>');document.write('</tr></table></div></td>');document.write('<td width="20%"></td></tr></table>');}
function accountpanel(username,path)
{if(path==null)path="./";document.write('<table width=100% cellpadding=3 cellspacing=0 border=0>');document.write('<tr><td colspan="2" width="100%" height="6"></td></tr>');document.write('<tr><td background="../images/internal/bestseller-bg.jpg" height="23" width="80%">');document.write('<font class=heading>Welcome <FONT COLOR="red">'+username+'</font></font></td>');document.write('<td align="center" width="20%" background="../images/internal/bestseller-bg.jpg" height="23">');document.write('<b><a style="color: white"></a></b><a href="logout.php" style="{color:white;}"><b>Logout</b></a></td></tr>');document.write('</tr></table>');}
function addToList(chkObject,newText,newValue){var isSelected=false;var qty=chkObject.form.quantity.value;var inrprice=chkObject.form.inrprice.value;var symbol=chkObject.form.currency.value;var price=0;var _lastCurrencySymbol;for(var k=0;k<currencySymbolsAndValues.length;k++){if(symbol==currencySymbolsAndValues[k][0]){price=roundMore(parseFloat(parseInt(inrprice/currencySymbolsAndValues[k][1]*100)/100));}}
if(chkObject.checked==true){isSelected=true;}
if(isSelected){var len=document.cart.selProductCodes.length++;document.cart.selProductCodes.options[len].value=newValue.toUpperCase();document.cart.selProductCodes.options[len].text=newText.toUpperCase()+"  -  "+qty+"   - "+symbol+" "+price;document.cart.selProductCodes.selectedIndex=0;document.cart.selProductCodes.size++;}else{removeFromList(chkObject,newText,newValue);document.cart.selProductCodes.size--;}
document.cart.txiTotalItems.value=document.cart.selProductCodes.length;}
function removeFromList(chkObject,newText,newValue){var isSelected=false;var len=document.cart.selProductCodes.length;var j=0;var optionsArray=Array();for(var i=0;i<len;i++){optionsArray[i]=new Array(document.cart.selProductCodes.options[i].value,document.cart.selProductCodes.options[i].text);}
document.cart.selProductCodes.length=0;for(var i=0;i<optionsArray.length;i++){if(optionsArray[i][0]!=newValue){document.cart.selProductCodes.length++;document.cart.selProductCodes.options[j].value=optionsArray[i][0];document.cart.selProductCodes.options[j].text=optionsArray[i][1];j++;}else{}}}
function roundMore(num){var floor,ceil,fraction;floor=Math.floor(num);ceil=Math.ceil(num);if(!(ceil-floor)){return num;}else{fraction=num-floor;if(fraction<=0){fraction=0;}else if(fraction<=.25&&fraction>0){fraction=.25;}else if(fraction<=.5&&fraction>0){fraction=.5;}else if(fraction<=.75&&fraction>0){fraction=.75;}else{fraction=1;}
num=floor+fraction;return num;}}
function showMoreProductDetails(pcode){var detailsWindow=window.open("/store/showMoreDetails.php?pcode="+pcode,"moreWindow","Width=400, Height=250, Scrollbars=1, Toolbars=0");return false;}
function knowMore(){var knowmoreWindow=window.open("/user/knowMore.php","knowmoreWindow","Width=400, Height=400, Scrollbars=1, Toolbars=0");return false;}
function isValidEmail(emailid){if(emailid==""){return false;}
else{var eid=emailid;if(eid.indexOf(' ')!=-1){return false;}
if(eid.length<6){return false;}
at=eid.indexOf('@',0);if(at==-1||at==0){return false;}else{var at1=eid.indexOf('@',(at+1));if(at1==-1)
{var dot=eid.indexOf('.',(at+1));if(dot==(at+1)||dot==-1){return false;}
else{if((dot+2)<eid.length)
return true;else{return false;}}}
else
{return false;}}
return false;}}
function isValidPhone(phoneid){var numstr="1234567890+-, ";var intctr,intLen;intLen=phoneid.length;for(intCtr=0;intCtr<=intLen&&numstr.indexOf(phoneid.charAt(intCtr))>=0;intCtr++);if(intCtr>intLen)
return true;else
return false;}
function trim(str1){var intCtr=0
for(intCtr=0;str1.charAt(intCtr)==" ";intCtr++);str1=str1.substring(intCtr,str1.length);return str1;}
function checkforchar(strdate){var validdate=",.abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";var strlength=strdate.length;for(var i=0;i<=strlength;i++)
{var unitstr=strdate.substr(i,1);if(validdate.indexOf(unitstr)==-1)
{return false;}}
return true;}
function isAllNumeric(str1){var numstr="1234567890 ,-";var intctr,intLen;intLen=str1.length;for(intCtr=0;intCtr<=intLen&&numstr.indexOf(str1.charAt(intCtr))>=0;intCtr++);if(intCtr>intLen)
{return 1;}
else
{return 0;}}
function goBack(){history.back();}
function doSameAs(frm){if(window.document.frm.sameAs.checked){window.document.frm.selTitle.value=window.document.frm.selSenderTitle.value;window.document.frm.txiName.value=window.document.frm.txiSenderName.value;window.document.frm.txaAddress.value=window.document.frm.txaSenderAddress.value;window.document.frm.txiCity.value=window.document.frm.txiSenderCity.value;window.document.frm.txiState.value=window.document.frm.txiSenderState.value;window.document.frm.txiZipcode.value=window.document.frm.txiSenderZipcode.value;window.document.frm.selCountry.value=window.document.frm.selSenderCountry.value;window.document.frm.txiPhone.value=window.document.frm.txiSenderPhone.value;window.document.frm.txiEmail.value=window.document.frm.txiSenderEmail.value;window.document.frm.txaRemarks.value=window.document.frm.txaSenderRemarks.value;}else{window.document.frm.selTitle.value="";window.document.frm.txiName.value="";window.document.frm.txaAddress.value="";window.document.frm.txiCity.value="";window.document.frm.txiState.value="";window.document.frm.txiZipcode.value="";window.document.frm.selCountry.value="";window.document.frm.txiPhone.value="";window.document.frm.txiEmail.value="";window.document.frm.txaRemarks.value="";}
return true;}
function checkShoppingCartForm(frm){if(trim(frm.txiSenderName.value).length<=0){alert("Billing - Name is missing!");frm.txiSenderName.focus();return false;}
if(trim(frm.txaSenderAddress.value).length<=0){alert("Billing  - Address is missing!");frm.txaSenderAddress.focus();return false;}
if(trim(frm.txiSenderCity.value).length<=0){alert("Billing - City is missing!");frm.txiSenderCity.focus();return false;}
if(trim(frm.txiSenderState.value).length<=0){alert("Billing - State is missing!");frm.txiSenderState.focus();return false;}
if(trim(frm.txiSenderZipcode.value).length<=0){alert("Billing - Zip code is missing!");frm.txiSenderZipcode.focus();return false;}
if(trim(frm.selSenderCountry.value).toUpperCase()=="NA"){alert("Billing - Country is missing!");frm.selSenderCountry.focus();return false;}
if(trim(frm.txiSenderPhone.value).length<=0){alert("Billing - Phone is missing!");frm.txiSenderPhone.focus();return false;}
if(!isValidPhone(trim(frm.txiSenderPhone.value))){alert("Billing - Phone no is not correct!");frm.txiSenderPhone.focus();return false;}
if(trim(frm.txiSenderEmail.value).length<=0){alert("Billing -  Email is missing!");frm.txiSenderEmail.focus();return false;}
if(!isValidEmail(trim(frm.txiSenderEmail.value))){alert("Billing - Email is not correct!");frm.txiSenderEmail.focus();return false;}
if(trim(frm.txiName.value).length<=0){alert("Delivery - Name is missing!");frm.txiName.focus();return false;}
if(trim(frm.txaAddress.value).length<=0){alert("Delivery  - Address is missing!");frm.txaAddress.focus();return false;}
if(trim(frm.txiCity.value).length<=0){alert("Delivery - City is missing!");frm.txiCity.focus();return false;}
if(trim(frm.txiState.value).length<=0){alert("Delivery - State is missing!");frm.txiState.focus();return false;}
if(trim(frm.txiZipcode.value).length<=0){alert("Delivery - Zip code is missing!");frm.txiZipcode.focus();return false;}
if(trim(frm.selCountry.value).toUpperCase()=="NA"){alert("Delivery - Country is missing!");frm.selCountry.focus();return false;}
if(trim(frm.txiPhone.value).length<=0){alert("Delivery - Phone is missing!");frm.txiPhone.focus();return false;}
if(!isValidPhone(trim(frm.txiPhone.value))){lo
alert("Delivery - Phone no is not correct!");frm.txiPhone.focus();return false;}
if(trim(frm.txiEmail.value).length<=0){alert("Delivery -  Email is missing!");frm.txiEmail.focus();return false;}
if(!isValidEmail(trim(frm.txiEmail.value))){alert("Delivery - Email is not correct!");frm.txiEmail.focus();return false;}
if(trim(frm.code_field.value).length<=0){alert("Please enter the Code!");frm.code_field.focus();return false;}
return true;}
function confirmRemove(){if(confirm("Do you realy want to delete this recipient address details from your address book?")){return true;}else{return false;}}
function confirmCartRemove(pid){if(confirm("Do you realy want to delete "+pid+" from your shopping cart?"))
return true;else
return false;}
function checkForm(frm){var q=frm.quantity.value;var lastcurrency=frm.lastTimeCurrency.value.toUpperCase();var currency=frm.currency.value.toUpperCase();if(isNaN(q)||!isAllNumericQuantity(q)){alert("Product quantity is incorrect.\nPlease enter correct quantity!");frm.quantity.focus();return false;}
if(currency!=lastcurrency&&lastcurrency!=""){if(confirm("You have choosen a different currency "+currency+" this time. Do you want to buy in "+currency+"?")){}else{frm.currency.value=lastcurrency;}}
return true;}
function checkFormT(frm){var q=frm.quantity.value;var lastcurrency=frm.lastTimeCurrency.value.toUpperCase();var currency=frm.currency.value.toUpperCase();if(isNaN(q)||!isAllNumericQuantity(q)){alert("Product quantity is incorrect.\nPlease enter correct quantity!");frm.quantity.focus();return false;}
if(currency!=lastcurrency&&lastcurrency!=""){if(confirm("You have choosen a different currency "+currency+" this time. Do you want to buy in "+currency+"?")){}else{frm.currency.value=lastcurrency;}}
return true;}
function isAllNumericQuantity(str1){var numstr="1234567890";var intctr,intLen;intLen=str1.length;for(intCtr=0;intCtr<=intLen&&numstr.indexOf(str1.charAt(intCtr))>=0;intCtr++);if(intCtr>intLen){return 1;}else{return 0;}}
function checkLoginForm(frm){if(frm.user_id.value.length<=0||frm.user_id.value==""){alert("Please enter the user id!");frm.user_id.focus();return false;}
if(frm.password.value.length<=0||frm.password.value==""){alert("Please enter the password!");frm.password.focus();return false;}
return true;}
function checkNewLoginForm(frm){if(frm.user_id.value.length<=0||frm.user_id.value==""){alert("Please enter the user id!");frm.user_id.focus();return false;}
var iChars="!#$%^&*()+=-[]\\\';,/{}|\":<>?x'`";for(var i=0;i<document.login_form.user_id.value.length;i++){if(iChars.indexOf(document.login_form.user_id.value.charAt(i))!=-1){alert("Your User Id has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(frm.password.value.length<=0||frm.password.value==""){alert("Please enter the password!");frm.password.focus();return false;}
if(frm.password.value.length<5){alert("Password should have minimum of five characters!");frm.password.focus();return false;}
if(frm.confirm_password.value.length<=0||frm.confirm_password.value==""){alert("Please enter the confirm password!");frm.confirm_password.focus();return false;}
if(frm.password.value!=frm.confirm_password.value){alert("Your password do not match!");frm.confirm_password.focus();return false;}
return true;}
function checkChangePasswordForm(frm){if(frm.txiUserId.value.length<=0||frm.txiUserId.value==""){alert("Please enter the user id!");frm.txiUserId.focus();return false;}
var iChars="!#$%^&*()+=-[]\\\';,/{}|\":<>?x'`";for(var i=0;i<document.login_form.txiUserId.value.length;i++){if(iChars.indexOf(document.login_form.txiUserId.value.charAt(i))!=-1){alert("Your User Id has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(frm.txiPassword.value.length<=0||frm.txiPassword.value==""){alert("Please enter the password!");frm.txiPassword.focus();return false;}
if(frm.txiNewPassword.value.length<=0||frm.txiNewPassword.value==""){alert("Please enter the new password!");frm.txiNewPassword.focus();return false;}
if(frm.txiPassword.value==frm.txiNewPassword.value){alert("Your passwords donot match, Try Again!");frm.txiNewPassword.focus();return false;}
if(frm.txiNewPassword.value.length<5){alert("Password should have minimum of five characters!");frm.txiNewPassword.focus();return false;}
return true;}
function checkCart(frm){for(var i=0;i<frm.elements.length-1;i++){if(frm.elements[i].type.toUpperCase()=="TEXT"){if(!isAllNumericQuantity(frm.elements[i].value)){alert("Please enter correct quantity of product for updating the cart!");frm.elements[i].focus();return false;}}}
return true;}
function checkRegistrationForm(frm){if(trim(frm.txiName.value).length<=0){alert("Please enter your name!");frm.txiName.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?1234567890";for(var i=0;i<document.registration_form.txiName.value.length;i++){if(iChars.indexOf(document.registration_form.txiName.value.charAt(i))!=-1){alert("Your Name has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(trim(frm.selDobDate.value).length<=0){alert("Please select your Birth Day!");frm.selDobDate.focus();return false;}
if(trim(frm.txiDesignation.value).length<=0){alert("Please enter your Designation!");frm.txiDesignation.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?1234567890";for(var i=0;i<document.registration_form.txiDesignation.value.length;i++){if(iChars.indexOf(document.registration_form.txiDesignation.value.charAt(i))!=-1){alert("Your Designation has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(trim(frm.txiCompany.value).length<=0){alert("Please enter your Company!");frm.txiCompany.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?1234567890";for(var i=0;i<document.registration_form.txiCompany.value.length;i++){if(iChars.indexOf(document.registration_form.txiCompany.value.charAt(i))!=-1){alert("Your Company has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(trim(frm.txiAddress.value).length<=0){alert("Please enter your address!");frm.txiAddress.focus();return false;}
var iChars="!#$%^&*()+[]\\\';,{}\":<>?";for(var i=0;i<document.registration_form.txiAddress.value.length;i++){if(iChars.indexOf(document.registration_form.txiAddress.value.charAt(i))!=-1){alert("Your Address has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(trim(frm.txiCity.value).length<=0){alert("Please enter your address city!");frm.txiCity.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?1234567890";for(var i=0;i<document.registration_form.txiCity.value.length;i++){if(iChars.indexOf(document.registration_form.txiCity.value.charAt(i))!=-1){alert("Your City has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(trim(frm.txiState.value).length<=0){alert("Please enter your address state!");frm.txiState.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?1234567890";for(var i=0;i<document.registration_form.txiState.value.length;i++){if(iChars.indexOf(document.registration_form.txiState.value.charAt(i))!=-1){alert("Your State has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(trim(frm.selCountry.value).length<=0){alert("Please select your Country!");frm.selCountry.focus();return false;}
if(trim(frm.txiPostCode.value).length<=0){alert("Please enter your address Zip/Pin code!");frm.txiPostCode.focus();return false;}
if(trim(frm.txiPostCode.value).length<=0){alert("Please enter your address Zip/Pin code!");frm.txiPostCode.focus();return false;}
if(trim(frm.selCountry.value).length<=0||frm.selCountry.value.toUpperCase()=="NA"||frm.selCountry.value.toUpperCase()==""){alert("Please select your resident country from list!");frm.selCountry.focus();return false;}
if(trim(frm.txiPhone.value).length<=0){alert("Please enter your phone no.!");frm.txiPhone.focus();return false;}
if(trim(frm.txiEmailAddress.value).length<=0){alert("Please enter your email address.!");frm.txiEmailAddress.focus();return false;}
if(!isValidEmail(trim(frm.txiEmailAddress.value))){alert("Please enter your email id correctly!\n");frm.txiEmailAddress.focus();return false;}
return true;}
function checkAddressBookForm(frm){if(trim(frm.txiName.value).length<=0){alert("Please enter your name!");frm.txiName.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?1234567890";for(var i=0;i<document.registration_form.txiName.value.length;i++){if(iChars.indexOf(document.registration_form.txiName.value.charAt(i))!=-1){alert("Your Name has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(trim(frm.txiDesignation.value).length<=0){alert("Please enter your Designation!");frm.txiDesignation.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?1234567890";for(var i=0;i<document.registration_form.txiDesignation.value.length;i++){if(iChars.indexOf(document.registration_form.txiDesignation.value.charAt(i))!=-1){alert("Your Designation has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(trim(frm.txiCompany.value).length<=0){alert("Please enter your Company!");frm.txiCompany.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?1234567890";for(var i=0;i<document.registration_form.txiCompany.value.length;i++){if(iChars.indexOf(document.registration_form.txiCompany.value.charAt(i))!=-1){alert("Your Company has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(trim(frm.txiAddress.value).length<=0){alert("Please enter your address!");frm.txiAddress.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?";for(var i=0;i<document.registration_form.txiAddress.value.length;i++){if(iChars.indexOf(document.registration_form.txiAddress.value.charAt(i))!=-1){alert("Your Address has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(trim(frm.txiCity.value).length<=0){alert("Please enter your address city!");frm.txiCity.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?1234567890";for(var i=0;i<document.registration_form.txiCity.value.length;i++){if(iChars.indexOf(document.registration_form.txiCity.value.charAt(i))!=-1){alert("Your City has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(trim(frm.txiState.value).length<=0){alert("Please enter your address state!");frm.txiState.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?1234567890";for(var i=0;i<document.registration_form.txiState.value.length;i++){if(iChars.indexOf(document.registration_form.txiState.value.charAt(i))!=-1){alert("Your State has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(trim(frm.txiPostCode.value).length<=0){alert("Please enter your address Zip/Pin code!");frm.txiPostCode.focus();return false;}
if(trim(frm.txiPostCode.value).length<=0){alert("Please enter your address Zip/Pin code!");frm.txiPostCode.focus();return false;}
if(trim(frm.selCountry.value).length<=0||frm.selCountry.value.toUpperCase()=="NA"||frm.selCountry.value.toUpperCase()==""){alert("Please select your resident country from list!");frm.selCountry.focus();return false;}
if(trim(frm.txiPhone.value).length<=0){alert("Please enter your phone no.!");frm.txiPhone.focus();return false;}
if(trim(frm.txiEmailAddress.value).length<=0){alert("Please enter your email address.!");frm.txiEmailAddress.focus();return false;}
if(!isValidEmail(trim(frm.txiEmailAddress.value))){alert("Please enter your email id correctly!\n");frm.txiEmailAddress.focus();return false;}
if(trim(frm.code_field.value).length<=0){alert("Please enter the Code!");frm.code_field.focus();return false;}
return true;}
function isNumberKey(evt,enabledot)
{if(!enabledot)enabledot=0;var charCode=(evt.which)?evt.which:event.keyCode
if(charCode>31&&(charCode<48||charCode>57)&&charCode!=46&&enabledot==1)
return false;else if(charCode>31&&(charCode<48||charCode>57)&&enabledot==0)
return false;return true;}
function check_bulkform()
{docf=document.frm;if(docf.name.value=="")
{alert("Please Enter Your Name");docf.name.focus();return false;}
if(docf.company.value=="")
{alert("Please Enter The Name of Your Company");docf.company.focus();return false;}
if(docf.address.value=="")
{alert("Please Enter Your Address");docf.address.focus();return false;}
if(docf.city.value=="")
{alert("Please Enter The Name of Your City");docf.city.focus();return false;}
if(docf.country.selectedIndex==0)
{alert("Please Select Your Country");docf.country.focus();return false;}
if(docf.pincode.value=="")
{alert("Please Enter The Pin Code");docf.pincode.focus();return false;}
if(docf.productcode.value=="")
{alert("Please Enter The Product Code");docf.productcode.focus();return false;}
if(docf.productname.value=="")
{alert("Please Enter The Product Name");docf.productname.focus();return false;}
if(docf.quantiry.value=="")
{alert("Please Enter The Quantity");docf.quantiry.focus();return false;}
if(docf.comment.value=="")
{alert("Please Enter Some Comments");docf.comment.focus();return false;}}
function checkform(frm)
{docf=document.frm;if(docf.name.value=="")
{alert("Please Enter Your Name");docf.name.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?1234567890";for(var i=0;i<document.frm.name.value.length;i++){if(iChars.indexOf(document.frm.name.value.charAt(i))!=-1){alert("Your Name has special characters. \nThese are not allowed.\n Please remove them and try again.");return false;}}
if(docf.email.value=="")
{alert("Please Enter Your Email Id");docf.email.focus();return false;}
if(docf.phno.value=="")
{alert("Please Enter Your Phone No");docf.phno.focus();return false;}
if(docf.query.value=="")
{alert("Please Enter Your Query");docf.query.focus();return false;}
var iChars="!@#$%^&*()+=-[]\\\';,/{}|\":<>?";for(var i=0;i<document.frm.query.value.length;i++){if(iChars.indexOf(document.frm.query.value.charAt(i))!=-1){var probchar=document.frm.query.value.charAt(i);alert("Your Query has special character = "+probchar+" \n Please remove them and try again.");return false;}}
if(docf.code_field.value=="")
{alert("Please the Code shown above");docf.code_field.focus();return false;}
return validate_form(docf)}
function validate_email(field,alerttxt)
{with(field)
{apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if(apos<1||dotpos-apos<2)
{alert(alerttxt);return false;}
else
{return true;}}}
function validate_form(thisform)
{with(thisform)
{if(validate_email(email,"Not a valid e-mail address!")==false)
{email.focus();return false;}}}
function validatephone(xxxxx){var maintainplus='';var numval=xxxxx.value
if(numval.charAt(0)=='+'){var maintainplus='+';}
curphonevar=numval.replace(/[\\A-Za-z!"£$%^&*+_={};:'@#~,.¦\/<>?|`¬\]\[]/g,'');xxxxx.value=maintainplus+curphonevar;var maintainplus='';xxxxx.focus;}