var searchSuggestionHashMap=new map();var myState=null;var firstCellIndex=0;
var secondCellIndex=0;var firstColumn=-1;var secondColumn=0;var queryStr=null;function map(){var C=new Array();var B=new Array();
this.keys=C;this.values=B;this.size=0;this.put=A;this.get=E;this.containsKey=D;function A(F,G){C[C.length]=F;B[B.length]=G;
this.size++}function E(G){for(var F=0;F<this.size;F++){if(C[F]==G){return B[F]}}return""}function D(G){for(var F=0;F<this.size;F++)
{if(C[F]==G){return true}}return false}}function setURLToLink(D,E,A,C){var B=document.getElementById(E);B.viewType.value=A;if(C)
{B.tab.value=C}B.action=D;B.submit()}function getState(C,F,G,A){var B=F.name;var E=document.getElementById(G);
var D=document.getElementById(A);if(E&&D){E.style.display="none";D.style.display="none"}makeRequest(path+"/jsp/statesForCountry.jsp","countryId="+C+"&statesforcountry=statesforcountry&formName="+B)}function getCity(H,F,G,A){var B=F.name;var E=document.forms[B].state;if(E.options[E.options.selectedIndex].text=="Other"){document.getElementById(G).style.display=""}else{var D=document.getElementById(G);var C=document.getElementById(A);if(D&&C){D.style.display="none";C.style.display="none"}}makeRequest(path+"/jsp/cityForState.jsp","stateId="+H+"&cityforstate=cityforstate&formName="+B)}function checkCitySelected(E,D,A){var C=D.name;var B=document.forms[C].otherCity;if(E.options[E.options.selectedIndex].text=="Other"){document.getElementById(A).style.display="";B.disabled=false;B.focus()}else{document.getElementById(A).style.display="none"}}function hidden_div(B){var A=document.getElementById(B);if(A!=null){A.style.display="none";A.style.visibility="hidden"}}function visible_div(B){var A=document.getElementById(B);if(A!=null){A.style.display="block";A.style.visibility="visible"}}function formatUrl(A){if(A.substring(0,7)!="http://"){A="http://"+A}window.open(A)}function checkUserIsLogin(A){if(A=="null"){doRequest("request:SellerLoginForm","sellerLoginLink")}else{doRequest("request:UserLogOutForm","sellerLoginLink")}}function checkSellerLogin(A){if(A=="null"){doRequest("request:LoginForm","userLoginLink")}else{doRequest("request:SellerLogOutForm","userLoginLink")}}function popupLogOut(A){if((A.match("myDetails.jsp")=="myDetails.jsp")||(A.match("slr.html")=="slr.html")){location.href=path+"/jsp/logOut.jsp"}else{location.href=path+"/jsp/logOut.jsp?pathNew="+A}}function validateTextField(D){var A=D;var C="{}[]()!^*";var E="*|,\":?.<>[]{}~`=';()@&$#%+-!^";if(E.indexOf(A.charAt(0))!=-1){alert("  No Special Characters Allowed !  ");return false}for(var B=0;B<A.length;B++){if(C.indexOf(A.charAt(B))!=-1){alert(" No Special Characters Allowed ! ");return false}}return true}function searchAction(C){var B=C;if(trim(B)==null||trim(B)==""||trim(B)==" "){alert("Please Enter keyword you want to Search.");document.getElementById("searchtxt").focus();return false}else{var A=document.getElementById("formid");document.searchForm.action=path+"/faces/components/search/searchEncode.jsp";document.searchForm.submit()}}function checkSpecialChars(B){var A=(B.which)?B.which:B.keyCode;if(!((A>64&&A<91)||((A>96)&&(A<123))||((A>47)&&(A<58))||((A>31)&&(A<33))||((A>45)&&(A<47))||((A>12)&&(A<14))||((A>7)&&(A<9)))){alert(" No Special Characters Allowed ! ");return false}if(A==13){return searchAction()}return true}var globalValue="";var globalLength=0;var globalCursor=false;var browserName=navigator.appName;var fromTop=0;function checkBrowser(){if(browserName.match("Microsoft Internet Explorer")=="Microsoft Internet Explorer"){var A=document.getElementById("suggesstionBox");A.style.marginTop=-12}else{var A=document.getElementById("suggesstionBox");A.style.marginTop=-12}}function suggetionBox(B,L,P){delete_cookie(document.getElementById("searchtxt").value);var E=document.getElementById(L).value;if(E.length>2){if(P.keyCode!=40&&P.keyCode!=38&&P.keyCode!=39&&P.keyCode!=37){var F=document.getElementById(L).value;globalCursor=true;var S=true;if(P.keyCode!=8){globalValue=F;globalLength=F.length}else{var G=document.getElementById(L).value;var T=G.length;if(trim(globalValue)==trim(G)){S=false}}checkBrowser();if(F.length>2){var K=F.substring(0,3);if(P.keyCode!=32&&trim(F)!=""&&trim(F)!=null&&S){if(!searchSuggestionHashMap.containsKey(K)){makeRequest(path+"/jsp/commonForMakeRequest.jsp","pageId=suggessionBoxPageId&fieldValue="+trim(F))}else{var M=0;var F=trim(document.getElementById(L).value);var O=F.length;var C=document.getElementById("suggesstionBox");var Q=new Array();suggparams=searchSuggestionHashMap.get(K);for(var N=0;N<suggparams.length;N++){var R=trim(suggparams[N]).substring(0,F.length);if(trim(R).toLowerCase()==trim(F).toLowerCase()){Q[M]=trim(suggparams[N]);M++}}var H="";var N=0;var I=0;var A=null;if(Q.length>6){I=100;A="auto"}else{I="";A="hidden"}while(N<Q.length){H+="<tr><td width='50%' onmouseOver=\"this.style.backgroundColor='#F8FBF0';\" onmouseOut=\"this.style.backgroundColor='#ffffff';\" style=\"padding-left:5px;\"><div style='visibility:hidden;display:block;position:absolute;'>"+Q[N]+"</div><a href=\"javascript:selectedSuggestion('"+Q[N]+"');\" onmouseOver=\"this.style.color='#71A115';\" onmouseOut=\"this.style.color='#006699';\" style='cursor:pointer;font-size:12px;color:#006699;'><span style='font-weight:bold;'\">"+Q[N].substring(0,O)+"</span><span>"+Q[N].substring(O,Q[N].length)+"</span></a></td><td width='50%' onmouseOver=\"this.style.backgroundColor='#F8FBF0';\" onmouseOut=\"this.style.backgroundColor='#ffffff';\" style=\"padding-left:5px;\">";if(Q[N+1]!=null&&Q[N+1]!=""){N++;H+="<div style='visibility:hidden;display:block;position:absolute;'>"+Q[N]+"</div><a href=\"javascript:selectedSuggestion('"+Q[N]+"');\" style='cursor:pointer;font-size:12px;color:#006699;' onmouseOver=\"this.style.color='#71A115';\" onmouseOut=\"this.style.color='#006699';\"><span style='font-weight:bold;'>"+Q[N].substring(0,O)+"</span><span>"+Q[N].substring(O,Q[N].length)+"</span></a>"}H+="</td></tr>";N++}var D="";var J=true;if(Q.length==0){C.style.visibility="hidden";C.style.display="none";J=false}else{D=H}var D="<table id='tab11' border='0' width='100%' cellspacing='0' cellpadding='0'><tr><th width='50%' align='left'>Search suggestions:</th><th width='50%' align='right' ><a href=\"javascript:hideSuggestionBox('suggesstionBox');\" style='cursor:pointer;'><img src='"+contextPath+"/naaptolImages/Bt_Remove.gif'></a></th></tr><tr><td valign='top' colspan='2' style='margin: auto;'><div id='test' style='overflow:"+A+";height:"+I+"px;margin-top:0px;'><table id='suggestionTable' width='100%' border='0' cellspacing='0' cellpadding='0'>"+D+"</table></div></td></tr></table>";if(J){C.innerHTML=D;C.style.visibility="visible";C.style.display="block"}}}}else{if(F.length<1){hideSuggestionBox(B)}}}}else{if(E.length<1){hideSuggestionBox(B)}}}function hideSuggestionBox(A){var B=document.getElementById(A);B.style.visibility="hidden";B.style.display="none"}function showSuggestionBox(B,A){var D=document.getElementById(B);var E=D.value;var C=document.getElementById(A);if(trim(E).length>0){C.style.visibility="visible";C.style.display="block"}}function selectedSuggestion(A){document.getElementById("searchtxt").value=A;document.searchForm.action=path+"/faces/components/search/searchEncode.jsp";document.searchForm.submit()}function hideNActivate(B,A){hideSuggestionBox(A)}function setCursor(D){var C=document.getElementById("searchtxt");try{if(D.keyCode!=13){if(D.keyCode==40||D.keyCode==38||D.keyCode==39||D.keyCode==37){if(D.keyCode==40){var B=false;try{firstColumn++;var A=document.getElementById("suggestionTable").rows[firstColumn].cells;B=true}catch(D){B=false;firstColumn--}if(B){if(myState!=null){myState.style.backgroundColor="#FFFFFF";myState.style.color="#006699"}A[firstCellIndex].style.backgroundColor="#F8FBF0";myState=A[firstCellIndex];myState.focus();C.focus()}}else{if(D.keyCode==38){var B=false;try{firstColumn--;var A=document.getElementById("suggestionTable").rows[firstColumn].cells;B=true}catch(D){B=false;firstColumn++}if(B){if(myState!=null){myState.style.backgroundColor="#FFFFFF";myState.style.color="#006699"}A[firstCellIndex].style.backgroundColor="#F8FBF0";A[firstCellIndex].style.color="#71A115";myState=A[firstCellIndex];myState.focus();C.focus()}}else{if(D.keyCode==39){var B=false;try{var A=document.getElementById("suggestionTable").rows[firstColumn].cells;B=true}catch(D){B=false}if(B){if(firstCellIndex==0){firstCellIndex++;myState.style.backgroundColor="#FFFFFF";myState.style.color="#006699"}else{firstCellIndex--;myState.style.backgroundColor="#FFFFFF";myState.style.color="#006699"}A[firstCellIndex].style.backgroundColor="#F8FBF0";A[firstCellIndex].style.color="#71A115";myState=A[firstCellIndex]}}else{if(D.keyCode==37){var B=false;try{var A=document.getElementById("suggestionTable").rows[firstColumn].cells;B=true}catch(D){B=false}if(B){if(firstCellIndex==0){firstCellIndex++;myState.style.backgroundColor="#FFFFFF";myState.style.color="#006699"}else{firstCellIndex--;myState.style.backgroundColor="#FFFFFF";myState.style.color="#006699"}A[firstCellIndex].style.backgroundColor="#F8FBF0";A[firstCellIndex].style.color="#71A115";myState=A[firstCellIndex]}}}}}document.getElementById("searchtxt").value=A[firstCellIndex].firstChild.innerHTML}}else{if(D.keyCode==13){searchAction(document.getElementById("searchtxt").value)}}}catch(D){}}function searchActionFooter(){var B=document.getElementById("footertxt").value;if(trim(B)==null||trim(B)==""||trim(B)==" "){alert("Please Enter keyword you want to Search.");document.getElementById("footertxt").focus();return false}else{var A=document.getElementById("searchFormFooter");document.searchFormFooter.action=path+"/faces/components/search/searchEncode.jsp";document.searchFormFooter.submit()}}function checkSpecialCharsFooter(B){var A=(B.which)?B.which:B.keyCode;if(!((A>64&&A<91)||A==8||((A>96)&&(A<123))||((A>47)&&(A<58))||((A>31)&&(A<33))||((A>45)&&(A<47))||((A>12)&&(A<14)))){alert(" No Special Characters Allowed ! ");return false}if(A==13){return searchActionFooter()}return true}function trim(B){var A=B;return A.replace(/^\s+/,"").replace(/\s+$/,"")}function showLink(ctr){var divd="";for(i=1;i<=5;i++){divd=eval("div"+i);divdTD=eval("div"+i+"Tab");if(i==ctr){divd.style.visibility="visible";divd.style.display="block";divdTD.className=""}else{divd.style.visibility="hidden";divd.style.display="none";divdTD.className=""}}}var path="";if(document.getElementById("contextPathJsp")){path=document.getElementById("contextPathJsp").value}function isAgree(D,C,A){var B=false;var E=document.getElementById(A).checked;if(E){B=true}else{C.innerHTML="Please agree Naaptol Terms & Conditions";B=false}return B}function isFieldBlank(D,C,B,A){fieldBlank=false;if(D==null||trim(D)==""||D==0){C.innerHTML=B;document.getElementById(A).focus();fieldBlank=false}else{fieldBlank=true}return fieldBlank}function isValidFieldValueLength(G,F,D,C,B,A){var E=false;if(G.length<B||G.length>A){F.innerHTML=D;document.getElementById(C).value="";document.getElementById(C).focus();E=false}else{E=true}return E}function isEqualTwoFieldStrings(G,B,F,D,C,A){var E=false;if(G==B){E=true}else{F.innerHTML=D;document.getElementById(C).value="";document.getElementById(A).value="";document.getElementById(C).focus();E=false}return E}function isNameisValid(A,E,C,B){var D=false;var F=/^([a-z A-Z]+)([\s]*[\.]?[a-z A-Z]*)*$/;if(F.test(A)){D=true}else{E.innerHTML=C;document.getElementById(B).value="";document.getElementById(B).focus();D=false}return D}function isNumberStringValid(A){var B=/^[0-9]+$/;return B.test(A)}function checkTextAreaMaxlength(E,D,C,B,F){var A=false;if(E!=null){if(parseInt(E.length)>parseInt(F)){D.innerHTML=C;document.getElementById(B).focus();A=false}else{A=true}}else{A=true}return A}function isSellerPhoneNo2Valid(F,D,C,B){var A=false;if(F!=""&&F!=null){var E=isNumberStringValid(F);if(!E){D.innerHTML=C;document.getElementById(B).value="";document.getElementById(B).focus();A=false}else{A=true}}else{A=true}return A}function isUrlMandentary(E,C,D,B){var A=false;if(C=="Offline"){A=true}else{if(C=="Online"&&E==""){D.innerHTML="Please Enter Store Url (If seller is Online).";document.getElementById(B).focus();A=false}else{if(C=="Online"&&E!=""){A=true}}}return A}function isSellerPhoneNoValid(F,D,C,B){var A=false;var E=isNumberStringValid(F);if(!E){D.innerHTML=C;document.getElementById(B).value="";document.getElementById(B).focus();A=false}else{A=true}return A}function isMobileNoValid(F,E,D,C){var B=false;var A=isNumberStringValid(F);if(!A){E.innerHTML=D;document.getElementById(C).value="";document.getElementById(C).focus();B=false}else{if(!isValidFieldValueLength(F,E,"Please enter a valid mobile number(atleast 10 Numbers).",C,10,15)){B=false}else{B=true}}return B}function checkMobileNo(E,D,C,B){var A=false;if(E.substring(0,2)=="92"||E.substring(0,2)=="93"||E.substring(0,2)=="94"||E.substring(0,2)=="92"||E.substring(0,2)=="97"||E.substring(0,2)=="98"||E.substring(0,2)=="99"){A=true}else{D.innerHTML=C;document.getElementById(B).value="";document.getElementById(B).focus();A=false}return A}function isPinCodeValid(F,E,D,C){var B=false;var A=isNumberStringValid(F);if(!A){E.innerHTML=D;document.getElementById(C).value="";document.getElementById(C).focus();B=false}else{B=true}return B}function isEmailIdValid(E,F,D,C){var A=/^([a-zA-Z0-9]+)([_.]?[a-zA-Z0-9]+)*@([a-zA-Z0-9_]+)(.[a-zA-Z0-9_]{2,3}){1,2}$/;var B=false;if(A.test(E)){B=true}else{if(F&&D){F.innerHTML=D}else{alert("Exception:-Div Object or Error Message is not set.")}if(C){document.getElementById(C).value="";document.getElementById(C).focus()}B=false}return(B)}function getFavoriteParams(B){var A=B;return A}function validatePrice(C){var B=C.value;var A=checkValidNumber(B);if(!A&&B!=""){alert("Please Enter only Number");C.value="";C.focus();return false}else{return true}}function checkValidNumber(A){var B=/^[+]?([0-9]+|([(]{1}[0-9]+[)]{1}[0-9]+)|([0-9]+[-]{1}[0-9]+))$/;return B.test(A)}function submitPopup(B,A,C){if(B.keyCode==13){doRequest(C,A);return true}}function getCookie(A){if(document.cookie.length>0){c_start=document.cookie.indexOf(A+"=");if(c_start!=-1){c_start=c_start+A.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length}return unescape(document.cookie.substring(c_start,c_end))}}return""}function set_Cookies(){var A=365;var D=document.getElementById("loginId").value;var C=document.getElementById("password").value;var B=document.getElementById("rememberChkBox");if(B.checked==true){var E=new Date();E.setDate(E.getDate()+A);document.cookie="userIdRembCookie="+escape(D)+((A==null)?"":";expires="+E.toGMTString());document.cookie="passwordRembCookie="+escape(C)+((A==null)?"":";expires="+E.toGMTString())}return true}function check_Cookies(){var C=document.getElementById("loginId").value;if(C!=null&&C!=""){var B=getCookie("userIdRembCookie");var A=getCookie("passwordRembCookie");if(B!=null&&B!=""){if(C==B){document.getElementById("password").value=A}}}return true}function delete_cookie(B){var A=new Date();A.setTime(A.getTime()-1);document.cookie=B+="=; expires="+A.toGMTString()}function logoutUser(A,B){delete_cookie(B);window.location.href=A}function checkSpecialCharsHeader(B){var A=(B.which)?B.which:B.keyCode;if(!((A>64&&A<91)||((A>7)&&(A<10))||A==91||((A>96)&&(A<123))||((A>47)&&(A<58))||((A>36)&&(A<41))||((A>31)&&(A<33))||((A>45)&&(A<47))||((A>12)&&(A<14)))){alert(" No Special Characters Allowed ! ");return false}return true}function showBanner(F){var E=new Array();E=F.split(",");for(var C=0;C<E.length;C++){var B=new Array();B=E[C].split("&");var D="";var A="";var G="";if(B[0]){D=B[0]}if(B[1]){A=B[1]}G="pkId="+D+"&bannerDesc="+A;callBanner(G,D)}}function callBanner(C,A){var B=document.getElementById(A);if(B){B.src=path+"/jsp/showBanner.jsp?"+C}}function getBannerDesc(B){var A=B.split(",");var C=document.getElementById()}function divShowHide(F,G,J){var E=navigator.appName;var K=navigator.appVersion;document.getElementById(F).style.display="none";if(G=="show"){var D=document.getElementById(J);var I=findPosX(D);var H=findPosY(D);var C=document.getElementById("show0");var B=400+findPosX(C);var L=I+285;if(parseInt(L)>parseInt(B)){I=B-285}else{I=I}if(K.match("Chrome")=="Chrome"){H=H+22}else{H=H+26}var A=document.getElementById(F);A.style.display="block";A.style.zIndex="10";A.style.left=I+"px";A.style.top=H+"px"}else{if(G=="hide"){document.getElementById(F).style.display="none"}}}function findPosX(B){var A=0;if(B.offsetParent){while(B.offsetParent){A+=B.offsetLeft;B=B.offsetParent}}else{if(B.x){A+=B.x}}return A}function findPosY(A){var B=0;if(A.offsetParent){while(A.offsetParent){B+=A.offsetTop;A=A.offsetParent}}else{if(A.y){B+=A.y}}return B}function divopen(E,C,D){var B=document.getElementById(C);B.src=contextPath+"/images/Nav_more2.gif";var A=document.getElementById(D);A.href="javascript:divclose('"+E+"','"+C+"','"+D+"')";document.getElementById(E).style.display="block";document.getElementById(E).style.visibility="visible"}function divclose(E,C,D){var B=document.getElementById(C);B.src=contextPath+"/images/Nav_more3.gif";var A=document.getElementById(D);A.href="javascript:divopen('"+E+"','"+C+"','"+D+"')";document.getElementById(E).style.display="none";document.getElementById(E).style.visibility="hidden"}function displayDivAtObjectPos(D,F,C,B){closeDefnPopups=B;var A=getRealLeft(D);var G=getRealTop(D);var E=document.getElementById(B);if(E!=null){E.style.left=A+F;E.style.top=G+C;E.style.display="block";E.style.visibility="visible"}}function getRealLeft(A){xPos=document.getElementById(A).offsetLeft;tempEl=document.getElementById(A).offsetParent;while(tempEl!=null){xPos+=tempEl.offsetLeft;tempEl=tempEl.offsetParent}return xPos}function getRealTop(A){yPos=document.getElementById(A).offsetTop;tempEl=document.getElementById(A).offsetParent;while(tempEl!=null){yPos+=tempEl.offsetTop;tempEl=tempEl.offsetParent}return yPos}function showHelpPopup(C,A,B,D){displayDivAtObjectPos(C,B,D,A)}function showImage(R,X){var M=document.all&&!document.getElementById;var J=document.all&&document.getElementById;var Y=!document.all&&document.getElementById;var Z=document.layers;var G=X.clientX;var F=X.clientY;var B=screen.width;var b=screen.height;var I=document.getElementById("imageDiv");var W=new Image();W.src=R;var T=250;var U=250;I.style.width="250px";I.style.height="250px";I.src=R;var N=0;var K=0;var E=0;var D=0;var C=0;var A=0;var V=0;var S=0;var P=(M||J)?self.document.body.scrollLeft:self.pageXOffset;var L=(M||J)?self.document.body.scrollTop:self.pageYOffset;var H=0;if(M){E=event.x;D=event.y}if(J){E=event.x+self.document.body.scrollLeft;D=event.y+self.document.body.scrollTop}if(M||J){V=self.document.body.clientWidth;S=self.document.body.clientHeight}if(Z){V=self.innerWidth;S=self.innerHeight;E=X.pageX;D=X.pageY}if(Y){V=self.outerWidth;S=self.outerHeight;E=X.pageX;D=X.pageY}if(D+T>S+L-H){A=D-T-40;C=E-U/2}else{C=E-U/2;A=D+10}var Q=window.screen.availHeight;var a=b-F;if(F+T>b){N=G;K=F-45}else{N=G;K=F-T}var O=document.getElementById("showImages");O.style.left=C;O.style.top=A;O.style.width=250;O.style.height=250;O.style.visibility="visible";O.style.display="block";O.style.position="absolute";N=0;K=0;G=0;F=0;B=0;b=0}function hideImage(A){var B=document.getElementById(A);B.style.visibility="hidden";B.style.display="none"}function rateReview(B,A){val=B.substring(0,B.length-1);for(ui=1;ui<=5;ui++){mobj=document.getElementById(val+ui);if(ui<=A){mobj.src=contextPath+"/naaptolImages/StarBig1.gif"}else{mobj.src=contextPath+"/naaptolImages/StarBig2.gif"}}}function removeRatingReview(B,A){val=B.substring(0,B.length-1);for(ui=1;ui<=5;ui++){mobj=document.getElementById(val+ui);mobj.src=contextPath+"/naaptolImages/StarBig2.gif"}}function setReview(B,A){val=B.substring(0,B.length-1);for(ui=1;ui<=5;ui++){mobj=document.getElementById(val+ui);mobj.onmouseout="";mobj.onmouseover="";if(ui<=A){mobj.src=contextPath+"/naaptolImages/StarBig1.gif"}else{mobj.src=contextPath+"/naaptolImages/StarBig2.gif"}}document.getElementById(val).value=A}function checkSpace(G){var D=G.value;var F=new Array();D=D.replace(/</g,"");D=D.replace(/>/g,"");G.value=D;F=D.split(" ");var E="";var A=30;for(var B=0;B<F.length-1;B++){E=E+F[B]+" "}for(var C=0;C<F.length;C++){if(F[C].length>A){E="";alert("Continuous text without space not allowed");maxText=F[C];while(F[C].length>A){E=E+F[C].substring(0,A)+" ";F[C]=F[C].substring(A+1)}if(F[C].length<A){E=E+F[C]}G.value=D.replace(maxText,E)}}return true};