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+"/faces/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+"/faces/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")||(a.match("contactList")=="contactList")){location.href=path+"/faces/jsp/logOut.jsp"}else{location.href=path+"/faces/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(d,a){var c=d;if(trim(c)==null||trim(c)==""||trim(c)==" "){alert("Please Enter keyword you want to Search.");if(typeof a=="undefined"){document.searchForm.searchtxt.focus();return false}if(a=="_s"){document.st_searchForm.searchtxt.focus();return false}if(a=="_u"){document.ur_searchForm.searchtxt.focus();return false}return false}else{if(typeof a=="undefined"){document.searchForm.action=path+"/faces/components/search/searchEncode.jsp";document.searchForm.submit()}if(a=="_s"){document.st_searchForm.action=path+"/faces/components/search/sellerSearch.jsp";document.st_searchForm.submit()}if(a=="_u"){var b=path+"/faces/components/search/userSearch.jsp";document.ur_searchForm.action=b;document.ur_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,o,s){delete_cookie(document.getElementById("searchtxt").value);var f=document.getElementById(o).value;if(f.length>2){if(s.keyCode!=40&&s.keyCode!=38&&s.keyCode!=39&&s.keyCode!=37){var g=document.getElementById(o).value;globalCursor=true;var v=true;if(s.keyCode!=8){globalValue=g;globalLength=g.length}else{var h=document.getElementById(o).value;var w=h.length;if(trim(globalValue)==trim(h)){v=false}}checkBrowser();if(g.length>2){var n=g.substring(0,3);if(s.keyCode!=32&&trim(g)!=""&&trim(g)!=null&&v){if(!searchSuggestionHashMap.containsKey(n)){makeRequest(path+"/faces/jsp/commonForMakeRequest.jsp","pageId=suggessionBoxPageId&fieldValue="+trim(g))}else{var p=0;var g=trim(document.getElementById(o).value);var r=g.length;var c=document.getElementById("suggesstionBox");var t=new Array();suggparams=searchSuggestionHashMap.get(n);for(var q=0;q<suggparams.length;q++){var u=trim(suggparams[q]).substring(0,g.length);if(trim(u).toLowerCase()==trim(g).toLowerCase()){t[p]=trim(suggparams[q]);p++}}var k="";var q=0;var l=0;var a=null;if(t.length>6){l=100;a="auto"}else{l="";a="hidden"}while(q<t.length){k+="<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;'>"+t[q]+"</div><a href=\"javascript:selectedSuggestion('"+t[q]+"');\" onmouseOver=\"this.style.color='#71A115';\" onmouseOut=\"this.style.color='#006699';\" style='cursor:pointer;font-size:12px;color:#006699;'><span style='font-weight:bold;'\">"+t[q].substring(0,r)+"</span><span>"+t[q].substring(r,t[q].length)+"</span></a></td><td width='50%' onmouseOver=\"this.style.backgroundColor='#F8FBF0';\" onmouseOut=\"this.style.backgroundColor='#ffffff';\" style=\"padding-left:5px;\">";if(t[q+1]!=null&&t[q+1]!=""){q++;k+="<div style='visibility:hidden;display:block;position:absolute;'>"+t[q]+"</div><a href=\"javascript:selectedSuggestion('"+t[q]+"');\" style='cursor:pointer;font-size:12px;color:#006699;' onmouseOver=\"this.style.color='#71A115';\" onmouseOut=\"this.style.color='#006699';\"><span style='font-weight:bold;'>"+t[q].substring(0,r)+"</span><span>"+t[q].substring(r,t[q].length)+"</span></a>"}k+="</td></tr>";q++}var d="";var m=true;if(t.length==0){c.style.visibility="hidden";c.style.display="none";m=false}else{d=k}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:"+l+"px;margin-top:0px;'><table id='suggestionTable' width='100%' border='0' cellspacing='0' cellpadding='0'>"+d+"</table></div></td></tr></table>";if(m){c.innerHTML=d;c.style.visibility="visible";c.style.display="block"}}}}else{if(g.length<1){hideSuggestionBox(b)}}}}else{if(f.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){return 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,1)=="9"){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(f,g,d,c){var a=/^([a-zA-Z0-9]+)([_.-]?[a-zA-Z0-9]+)*@([a-zA-Z0-9_]+)(.[a-zA-Z0-9_]{2,4}){1,2}$/;var e=/^[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,6}$/;var b=false;if(a.test(f)){b=true}else{if(e.test(f)){b=true}else{if(g&&d){g.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(d){var c=new Array();c=d.split(",");for(var a=0;a<c.length;a++){var e=c[a];var b=e.substring(e.indexOf("pkId=")+5,e.length).substring(0,e.substring(e.indexOf("pkId=")+5,e.length).indexOf("&"));callBanner(e,b)}}function callBanner(c,a){var b=document.getElementById(a);if(b){b.src="/jsp/showBanner.jsp?"+c}}function getBannerDesc(b){var a=b.split(",");var c=document.getElementById()}function divShowHide(f,g,k){var e=navigator.appName;var l=navigator.appVersion;document.getElementById(f).style.display="none";if(g=="show"){var d=document.getElementById(k);var j=findPosX(d);var h=findPosY(d);var c=document.getElementById("show0");var b=995+findPosX(c);var m=j+285;if(parseInt(m)>parseInt(b)){j=b-285}else{j=j}if(l.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=j+"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+"/naaptolImages/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+"/naaptolImages/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(t,A){var o=document.all&&!document.getElementById;var l=document.all&&document.getElementById;var B=!document.all&&document.getElementById;var C=document.layers;var h=A.clientX;var g=A.clientY;var b=screen.width;var E=screen.height;var k=document.getElementById("imageDiv");var z=new Image();z.src=t;var v=250;var w=250;k.style.width="250px";k.style.height="250px";k.src=t;var p=0;var m=0;var f=0;var d=0;var c=0;var a=0;var y=0;var u=0;var r=(o||l)?self.document.body.scrollLeft:self.pageXOffset;var n=(o||l)?self.document.body.scrollTop:self.pageYOffset;var j=0;if(o){f=event.x;d=event.y}if(l){f=event.x+self.document.body.scrollLeft;d=event.y+self.document.body.scrollTop}if(o||l){y=self.document.body.clientWidth;u=self.document.body.clientHeight}if(C){y=self.innerWidth;u=self.innerHeight;f=A.pageX;d=A.pageY}if(B){y=self.outerWidth;u=self.outerHeight;f=A.pageX;d=A.pageY}if(d+v>u+n-j){a=d-v-40;c=f-w/2}else{c=f-w/2;a=d+10}var s=window.screen.availHeight;var D=E-g;if(g+v>E){p=h;m=g-45}else{p=h;m=g-v}var q=document.getElementById("showImages");q.style.left=c;q.style.top=a;q.style.width=250;q.style.height=250;q.style.visibility="visible";q.style.display="block";q.style.position="absolute";p=0;m=0;h=0;g=0;b=0;E=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();if(d.indexOf("<")!=-1){d=d.replace(/</g,"");g.value=d}if(d.indexOf(">")!=-1){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}function checkLength(c,b,a){if(a&&a>0){maxLen=a}else{maxLen=3000}var d=document.getElementById(b);if(c.value.length>maxLen){c.value=c.value.substring(0,maxLen)}else{d.value=maxLen-c.value.length}}function checkLengthRegistration(c,b,a){if(a&&a>0){maxLen=a}else{maxLen=3000}var d=document.getElementById(b);if(c.value.length>maxLen){c.value=c.value.substring(0,maxLen)}else{d.value=maxLen-c.value.length}}function checkSpecialCharForText(b){var a=b.value;if(a.indexOf("<")!=-1){b.value=a.replace(/</g,"")}if(a.indexOf(">")!=-1){b.value=a.replace(/>/g,"")}}function submitStoreValues(){var b=document.getElementById("ErrMsgSignUp");b.innerHTML="";var c=document.getElementById("storeName").value;var e=document.getElementById("storePerson").value;var f=document.getElementById("storePhone").value;var d=document.getElementById("storeMobile").value;var a=document.getElementById("storeCity").value;if(!isFieldBlank(c,b,"Please Enter Store Name.","storeName")){return false}if(!isFieldBlank(e,b,"Please Enter Person Name.","storePerson")){return false}if(!isSellerPhoneNoValid(f,b,"Please Enter Valid Phone Number.","storePhone")){return false}if(!isMobileNoValid(d,b,"Please enter a valid Mobile number","storeMobile")){return false}if(!isFieldBlank(a,b,"Please Enter City Name.","storeCity")){return false}makeMyRequest(path+"/faces/jsp/commonForMakeRequest.jsp","storename="+c+"&storeperson="+e+"&storephone="+f+"&storemobile="+d+"&storecity="+a+"&pageId=submitStoreReturnVal","submitStoreReturnVal")}function submitStoreReturnVal(b){var a=document.getElementById("ErrMsgSignUp");if(b[0]=="done"){document.getElementById("storeName").value="";document.getElementById("storePerson").value="";document.getElementById("storePhone").value="";document.getElementById("storeMobile").value="";document.getElementById("storeCity").value="";a.innerHTML="E-Store Updated Successfully"}else{a.innerHTML="Unable to Update the E-Store Successfully"}}function switchMenuPlusMinus(c,a){var b=document.getElementById(c);var a=document.getElementById(a);if(b&&a){if(b.style.display!="none"){b.style.display="none";a.src=contextPath+"/naaptolImages/plus.gif"}else{b.style.display="";a.src=contextPath+"/naaptolImages/minus.gif"}}}function openNewWindow(a){mywindow=window.open(a,"mywindow","status=no,scrollbars=yes,width=800,height=300");mywindow.moveTo(150,150)}function addToFavorites(c,b,e,a,d){if(a&&d!=null&&d!="null"&&e=="null"){doRequest("request:SellerLogOutForm","favoriteup"+c)}else{var f=new Array();f.productId=c;f.emailId=e;if(!a&&e!="null"&&e!=""){makeMyRequest(path+"/faces/components/product/addtoFavorites.jsp","productId="+c+"&listId=0&pageId=checkProductInList","checkProductInList")}else{if(a){doRequest("request:addToFavorite","favoriteup"+c,f)}else{if(d=="null"||e=="null"){makeRequest(path+"/faces/jsp/popupsController.jsp","addproductId="+c+"&action=getLoggedId&forPage=addtoFavorite")}}}}}function checkProductInList(d){if(d[1]=="[ My List Product ]"){var b=document.getElementById("favoriteup"+d[0]);if(b){b.innerHTML=d[1]}var c=document.getElementById("favoritedown"+d[0]);if(c){c.innerHTML=d[1]}}else{var a=new Array();a.productId=d[0];doRequest("request:addProductToList","favoriteup"+d[0],a)}}function sellThisProduct(b,d,a,c,g){if(g&&g!="null"){newId="sellProduct"+g}else{newId="sellProduct"}if(a&&d!=null&&d!="null"&&c=="null"){doRequest("request:UserLogOutForm",newId+b)}else{var f=new Array();f.productId=b;f.emailId=c;f.newId=newId;f.sellerStat=g;if(!a&&c!="null"&&c!=""){var e=document.getElementById("product_id");makeRequest(path+"/faces/seller/saveSellProduct.jsp","productId="+e.value+"&action=checkRecordExists&newId="+newId)}else{if(a){doRequest("request:sellProduct",newId+b,f)}else{if(c=="null"||d=="null"){makeRequest(path+"/faces/jsp/popupsController.jsp","addproductId="+b+"&action=getLoggedId&forPage=saveProduct&linkId="+g)}}}}}function callCreateNewListPopup(a,c,b){var d=new Array();d.productId=b;doRequest(a,c,d)}function validateNewList(){var h=document.NewListForm;if(h.listName.value==""){alert("Please Enter List Name.");h.listName.focus();return false}else{if(h.listTags.value==""){alert("Please Enter comma seperated tags for list");h.listTags.focus();return false}}var d=h.productId.value;var f=h.listId.value;var e=h.listName.value;var b=h.listTags.value;var a=h.listDescription.value;var j="";if(document.getElementById("editListImage")){j=""}else{j="listDefaImage.gif"}var g;if(h.listPrivacy[0].checked){g=h.listPrivacy[0].value}else{g=h.listPrivacy[1].value}var c=h.sessionUserId.value;makeMyRequest(path+"/faces/jsp/commonForMakeRequest.jsp","listId="+f+"&listTitle="+e+"&listImage="+j+"&listTags="+b+"&listDescription="+a+"&listPrivacy="+g+"&sessionUserId="+c+"&productId="+d+"&pageId=submitUserNewList","submitUserNewList")}function submitUserNewList(b){if(b[0]&&b[0]=="addProduct"){invoke(path+"/faces/user/list/addProductToList.jsp?listId="+b[1]+"&fromButton=AddProduct","RightPanel")}else{if(b[1]&&b[1]=="EditList"){invoke(path+"/faces/user/list/listProducts.jsp?listId="+b[0]+"&EditList="+b[1],"RightPanel");invoke(path+"/faces/user/list/listTitles.jsp?flag=1","listTitles")}else{if(b[0]&&b[0]=="popupList"){var a=new Array();a.productId=b[1];doRequest("request:addProductToList","favoriteup"+b[1],a)}else{if(b[0]){hide("ListFrom");hide("Step2");show("Step3");show("Addproduct");invoke(path+"/faces/user/list/addProductToList.jsp?listId="+b[0],"Addproduct");invoke(path+"/faces/user/list/listTitles.jsp?flag=1","listTitles")}}}}}var fieldstocheck=new Array();fieldnames=new Array();function checkform(){var textObj=document.getElementById("emailTemp");var textVal=textObj.value;var hidObj=document.getElementById("email");if(hidObj){hidObj.value=textVal}for(i=0;i<fieldstocheck.length;i++){if(eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value")==""){alert("Please enter your "+fieldnames[i]);return false}}var formObj=document.getElementById("subscribeform");popup(formObj);return true}function popup(c){var a=document.getElementById("emailTemp");if(!window.focus){return true}var b=new Date();windowname=b.getTime();window.open("",windowname,"top=100,left=100,height=400,width=500,location=no,resizable=yes,scrollbars=no,status=no");c.target=windowname;a.value="";return true}function wopen(c,b,a,d){a+=32;d+=96;var e=window.open(c,b,"width="+a+", height="+d+", location=no, menubar=no, status=no, toolbar=no, scrollbars=no, resizable=no");e.resizeTo(a,d);e.focus()}function addFieldToCheck(b,a){fieldstocheck[fieldstocheck.length]=b;fieldnames[fieldnames.length]=a}function divShowHideLeftMenu(d,h,j,g){var f=navigator.appName;var m=navigator.appVersion;if(h=="show"){var a=document.getElementById(j);var k=document.getElementById(d);a.className="activeLeft";k.at_position="x";var l=(k.at_position=="y")?a.offsetHeight+2:0;var e=(k.at_position=="x")?a.offsetWidth-11:0;for(;a;a=a.offsetParent){l+=a.offsetTop;e+=a.offsetLeft}if(f.match("Microsoft Internet Explorer")=="Microsoft Internet Explorer"){var b=document.getElementById(d);b.className="";b.className="subMenuie"}k.style.display="block";k.style.position="absolute";k.style.top=l+"px";k.style.left=e+"px";k.style.visibility="visible";k.style.zIndex="10"}else{if(h=="hide"){document.getElementById(d).style.display="none";document.getElementById(d).style.visibility="hidden";var a=document.getElementById(j);a.className="dactiveLeft"}}}function sendSMSToContact(e,d,a,c,b){var f=new Array();f.productId=a;f.contactSellerId=c;f.price=b;doRequest(e,d,f)}function setChkBoxValue(a){if(a.checked){a.value="on"}else{a.value="off"}}function openOrderNowPage(a,c,e){var d="";if(c!=null){d=c}else{if(document.getElementById("product_id")){d=document.getElementById("product_id").value}}var b="";if(a!=null){b=a}else{if(document.getElementById("seller_id")){b=document.getElementById("seller_id").value}}window.open(path+"/faces/microSite/msOrderNow.jsp?sellerId="+b+"&productId="+d+"&splrfnum="+e,"_self")}function openOrderNowPageForPartner(a,c,e){var d="";if(c!=null){d=c}else{if(document.getElementById("product_id")){d=document.getElementById("product_id").value}}var b="";if(a!=null){b=a}else{if(document.getElementById("seller_id")){b=document.getElementById("seller_id").value}}window.open(path+"/faces/partners/pOrderNow.jsp?sellerId="+b+"&productId="+d+"&splrfnum="+e,"_self")}function openNaaptolOrderNowPage(a,c,e){var d="";if(c!=null){d=c}else{if(document.getElementById("product_id")){d=document.getElementById("product_id").value}}var b="";if(a!=null){b=a}else{if(document.getElementById("seller_id")){b=document.getElementById("seller_id").value}}window.open(path+"/faces/components/order/naaptolOrderNow.jsp?sellerId="+b+"&productId="+d+"&splrfnum="+e,"_self")}function showTabOnSearch(c){var d=document.getElementById("_product");var b=document.getElementById("_store");var a=document.getElementById("_user");if(c=="_product"){document.getElementById("searchtxt").value=document.getElementById("txt1").value;document.getElementById("sr_product").style.visibility="visible";document.getElementById("sr_store").style.visibility="hidden";document.getElementById("sr_user").style.visibility="hidden";document.getElementById("sr_product").style.display="block";document.getElementById("sr_store").style.display="none";document.getElementById("sr_user").style.display="none";d.className="current";b.className="";a.className=""}if(c=="_store"){document.getElementById("sr_product").style.visibility="hidden";document.getElementById("st_searchtxt").value=document.getElementById("txt1").value;document.getElementById("sr_store").style.visibility="visible";document.getElementById("sr_user").style.visibility="hidden";document.getElementById("sr_product").style.display="none";document.getElementById("sr_store").style.display="block";document.getElementById("sr_user").style.display="none";d.className="";b.className="current";a.className=""}if(c=="_user"){document.getElementById("sr_product").style.visibility="hidden";document.getElementById("sr_store").style.visibility="hidden";document.getElementById("ur_searchtxt").value=document.getElementById("txt1").value;document.getElementById("sr_user").style.visibility="visible";document.getElementById("sr_product").style.display="none";document.getElementById("sr_store").style.display="none";document.getElementById("sr_user").style.display="block";d.className="";b.className="";a.className="current"}}function showHideAllPopups(b){var f=new Array("allPopup_signin","allPopup_forgotpassword","allPopup_signup");for(var d=0;d<f.length;d++){var a=document.getElementById(f[d]);if(b==f[d]){a.style.visibility="visible";a.style.display="block"}else{a.style.visibility="hidden";a.style.display="none"}if(b=="allPopup_forgotpassword"){var e=allRadioBtnPopup.allPopupRadio.length;if(e>0){for(var c=0;c<e;c++){allRadioBtnPopup.allPopupRadio[c].checked=false}}}}}function checkKeyOnPress(c,b,a){if(c.keyCode==13){return searchAction(b.value,a)}}function onSelect(c,a,b){var d=document.getElementById(b);onComponentChange("/countryCityState","value="+c+"&regionType="+a,d)}function onComponentChange(b,f,d){var a;if(window.XMLHttpRequest){a=new XMLHttpRequest();if(a.overrideMimeType){a.overrideMimeType("text/xml")}}else{if(window.ActiveXObject){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}}}if(!a){alert("Giving up :( Cannot create an XMLHTTP instance");return false}a.onreadystatechange=function(){processResponse(a,d)};a.open("POST",b,true);a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");a.send(f)}function processResponse(a,b){if(a.readyState==4){if(a.status==200){processComponentResponse(a.responseText,b)}else{alert("error in:processResponse")}}}function processComponentResponse(a,g){var c=parseStringResponse(a);var f=c.getElementsByTagName("response");if(!f||f.length==0){var b=new Array(0);return b}var e=f[0].getElementsByTagName("option");var b=new Array(e.length);g.length=b.length+1;for(var d=0;d<e.length;d++){g.options[d+1].text=e[d].getAttribute("name");g.options[d+1].value=e[d].getAttribute("value")}}function parseStringResponse(a){var b;if(document.implementation&&document.implementation.createDocument){b=document.implementation.createDocument("","",null);b.async="false";var c=new DOMParser();b=c.parseFromString(a,"text/xml")}else{if(window.ActiveXObject){b=new ActiveXObject("Microsoft.XMLDOM");b.async="false";b.loadXML(a)}}return b}function openHotdealOrderNowPage(a,c,e){var d="";if(c!=null){d=c}else{if(document.getElementById("product_id")){d=document.getElementById("product_id").value}}var b="";if(a!=null){b=a}else{if(document.getElementById("seller_id")){b=document.getElementById("seller_id").value}}window.open(path+"/faces/hotDeals/hdOrderNow.jsp?sellerId="+b+"&productId="+d+"&splrfnum="+e,"_self")}function checkPartnerLoginValidations(){var f=document.getElementById("partnerId1");var b=document.getElementById("partnerPass1");var e=document.getElementById("partnerId2");var a=document.getElementById("partnerPass2");var d=document.getElementById("errorText");d.innerHTML="";var c=document.getElementById("sellerId").value;if(!isFieldBlank(f.value,d,"Please Enter Organization Login","partnerId1")){return false}if(!isFieldBlank(b.value,d,"Please Enter Organization Password","partnerPass1")){return false}if(!isFieldBlank(e.value,d,"Please Enter Individual Login","partnerId2")){return false}if(!isFieldBlank(a.value,d,"Please Enter Individual Password","partnerPass2")){return false}makeMyRequest(path+"/faces/partners/partnerController.jsp","browseLogin1="+f.value+"&browsePass1="+b.value+"&browseLogin2="+e.value+"&browsePass2="+a.value+"&sellerId="+c+"&pageId=partnerValidation","partnerValidation")}function partnerValidation(b){if(b[0]=="notValidOrg"){var a=document.getElementById("errorText").innerHTML="Please Enter Valid Organization Login/Password"}else{if(b[0]=="notValidInd"){var a=document.getElementById("errorText").innerHTML="Please Enter Valid Individual Login/Password"}else{if(b[0]=="valid"){window.location.href=path+"/faces/microSite/partners/msIndex.jsp?sellerId="+b[1]}}}}function submitLoginPartnerData(a){if(a.keyCode==13){checkPartnerLoginValidations()}}function copyIt(a){x=document.getElementById(a).value;document.getElementById("txt1").value=x};