function GetEnterKey(controlID){var e=document.getElementById(controlID);if(e&&typeof(e.click)=="undefined"){e.click=function(){var result=true;if(e.onclick){result=e.onclick()}if(typeof(result)=="undefined"||result){eval(e.href)}}}}function RemoveDefaultValue(D,C){if(D!=null){if(D.value==C){D.value=""}}}function SetDefaultValue(D,C){if(D!=null){if(Trim(D.value)==""){D.value=C}}}function Trim(B){if(B!=""){while(B.substring(0,1)==" "){B=B.substring(1,B.length)}while(B.substring(B.length-1,B.length)==" "){B=B.substring(0,B.length-1)}return B}else{return B}}function SetQtyHiddenValue(E,F){alert(E+"#"+F);if(document.getElementById(F).value!=""){E=E+"_"+document.getElementById(F).value;var D=new Array();D=E.split("~");E=getDomainName()+D[1]}else{var D=new Array();D=E.split("~");E=getDomainName()+D[1]}document.location.href=E}function SetQtyHiddenValueMyWishList(G,H,E){alert(G+"#"+H);if(document.getElementById(H).value!=""){G=G+"_"+document.getElementById(H).value;var F=new Array();F=G.split("~");G=getDomainName()+F[1]}else{var F=new Array();F=G.split("~");G=getDomainName()+F[1]}removecartitem(E);document.location.href=G}function getDomainName(){var B;B=window.location.href;if(B.indexOf("PublicStore")>=0){if(B.indexOf("https")>=0){B="https://"+document.domain+"/publicstore"}else{B="http://"+document.domain+"/publicstore"}}else{if(B.indexOf("https")>=0){B="https://"+document.domain}else{B="http://"+document.domain}}return B}function checkdate(L){var N=/^\d{2}\/\d{2}\/\d{4}$/;var M=false;if(!N.test(L.value)){alert("Invalid Date Format. Please correct and submit again.")}else{var H=L.value.split("/")[0];var K=L.value.split("/")[1];var J=L.value.split("/")[2];var I=new Date(J,H-1,K);if((I.getMonth()+1!=H)||(I.getDate()!=K)||(I.getFullYear()!=J)){alert("Invalid Day, Month, or Year range detected. Please correct and submit again.")}else{M=true}}if(M==false){L.select()}return M}function Print(){alert("Operation Completed")}function Check(){for(var B=0;B<document.forms[0].elements.length;B++){strElement=document.forms[0].elements[B].id;if(strElement.substring(strElement.length-12,strElement.length)=="chkSelectAll"){CheckAll(document.forms[0].elements[B],"chkItemId")}}}function ChkItemSelected(){var C=false;for(var D=0;D<document.forms[0].elements.length;D++){strElement=document.forms[0].elements[D].id;if(strElement.substring(strElement.length-9,strElement.length)=="chkItemId"){if(document.forms[0].elements[D].checked){C=true}}}if(C==false){alert("Please select any item to clear.");return false}return true}var dw_event={add:function(H,G,F,E){E=E||false;if(H.addEventListener){H.addEventListener(G,F,E)}else{if(H.attachEvent){H.attachEvent("on"+G,F)}}},remove:function(H,G,F,E){E=E||false;if(H.removeEventListener){H.removeEventListener(G,F,E)}else{if(H.detachEvent){H.detachEvent("on"+G,F)}}},DOMit:function(B){B=B?B:window.event;B.tgt=B.srcElement?B.srcElement:B.target;if(!B.preventDefault){B.preventDefault=function(){return false}}if(!B.stopPropagation){B.stopPropagation=function(){if(window.event){window.event.cancelBubble=true}}}return B}};var viewport={getWinWidth:function(){this.width=0;if(window.innerWidth){this.width=window.innerWidth-18}else{if(document.documentElement&&document.documentElement.clientWidth){this.width=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){this.width=document.body.clientWidth}}}},getWinHeight:function(){this.height=0;if(window.innerHeight){this.height=window.innerHeight-18}else{if(document.documentElement&&document.documentElement.clientHeight){this.height=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){this.height=document.body.clientHeight}}}},getScrollX:function(){this.scrollX=0;if(typeof window.pageXOffset=="number"){this.scrollX=window.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollLeft){this.scrollX=document.documentElement.scrollLeft}else{if(document.body&&document.body.scrollLeft){this.scrollX=document.body.scrollLeft}else{if(window.scrollX){this.scrollX=window.scrollX}}}}},getScrollY:function(){this.scrollY=0;if(typeof window.pageYOffset=="number"){this.scrollY=window.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){this.scrollY=document.documentElement.scrollTop}else{if(document.body&&document.body.scrollTop){this.scrollY=document.body.scrollTop}else{if(window.scrollY){this.scrollY=window.scrollY}}}}},getAll:function(){this.getWinWidth();this.getWinHeight();this.getScrollX();this.getScrollY()}};var Tooltip={followMouse:true,offX:8,offY:12,tipID:"tipDiv",showDelay:100,hideDelay:200,ready:false,timer:null,tip:null,init:function(){if(document.createElement&&document.body&&typeof document.body.appendChild!="undefined"){if(!document.getElementById(this.tipID)){var B=document.createElement("DIV");B.id=this.tipID;document.body.appendChild(B)}this.ready=true}},show:function(D,C){if(this.timer){clearTimeout(this.timer);this.timer=0}this.tip=document.getElementById(this.tipID);if(this.followMouse){dw_event.add(document,"mousemove",this.trackMouse,true)}this.writeTip("");this.writeTip(C);viewport.getAll();this.positionTip(D);this.timer=setTimeout("Tooltip.toggleVis('"+this.tipID+"', 'visible')",this.showDelay)},writeTip:function(B){if(this.tip&&typeof this.tip.innerHTML!="undefined"){this.tip.innerHTML=B}},positionTip:function(F){if(this.tip&&this.tip.style){var D=F.pageX?F.pageX:F.clientX+viewport.scrollX;var E=F.pageY?F.pageY:F.clientY+viewport.scrollY;if(D+this.tip.offsetWidth+this.offX>viewport.width+viewport.scrollX){D=D-this.tip.offsetWidth-this.offX;if(D<0){D=0}}else{D=D+this.offX}if(E+this.tip.offsetHeight+this.offY>viewport.height+viewport.scrollY){E=E-this.tip.offsetHeight-this.offY;if(E<viewport.scrollY){E=viewport.height+viewport.scrollY-this.tip.offsetHeight}}else{E=E+this.offY}this.tip.style.left=D+"px";this.tip.style.top=E+"px"}},hide:function(){if(this.timer){clearTimeout(this.timer);this.timer=0}this.timer=setTimeout("Tooltip.toggleVis('"+this.tipID+"', 'hidden')",this.hideDelay);if(this.followMouse){dw_event.remove(document,"mousemove",this.trackMouse,true)}this.tip=null},toggleVis:function(F,D){var E=document.getElementById(F);if(E){E.style.visibility=D}},trackMouse:function(B){B=dw_event.DOMit(B);Tooltip.positionTip(B)}};Tooltip.offX=4;Tooltip.offY=4;Tooltip.followMouse=false;Tooltip.timerId=0;function doTooltip(F,E){if(typeof Tooltip=="undefined"||!Tooltip.ready){return}Tooltip.clearTimer();var D=document.getElementById?document.getElementById(Tooltip.tipID):null;if(D&&D.onmouseout==null){D.onmouseout=Tooltip.tipOutCheck;D.onmouseover=Tooltip.clearTimer}Tooltip.show(F,E)}function hideTip(){if(typeof Tooltip=="undefined"||!Tooltip.ready){return}Tooltip.timerId=setTimeout("Tooltip.hide()",300)}Tooltip.tipOutCheck=function(D){D=dw_event.DOMit(D);var C=D.relatedTarget?D.relatedTarget:D.toElement;if(this!=C&&!contained(C,this)){Tooltip.hide()}};function hideTipImmediate(){if(typeof Tooltip=="undefined"||!Tooltip.ready){return}Tooltip.timerId=setTimeout("Tooltip.hide()",0)}function contained(D,C){if(!D){return}while(D=D.parentNode){if(D==C){return true}}return false}Tooltip.clearTimer=function(){if(Tooltip.timerId){clearTimeout(Tooltip.timerId);Tooltip.timerId=0}};Tooltip.unHookHover=function(){var B=document.getElementById?document.getElementById(Tooltip.tipID):null;if(B){B.onmouseover=null;B.onmouseout=null;B=null}};dw_event.add(window,"unload",Tooltip.unHookHover,true);function setFocusOnFirstElement(){var C,D;if(document.forms[0].elements.length!=null){for(C=0;C<document.forms[0].elements.length;C++){if(document.forms[0].elements[C].id=="HiddenForSetFocus"||D==C){if(document.forms[0].elements[C+1]!=null&&document.forms[0].elements[C+1]!="undefined"){if(document.forms[0].elements[C+1].disabled||document.forms[0].elements[C+1].type=="hidden"){D=C+1}else{if(((document.forms[0].elements[C+1].type=="text")||(document.forms[0].elements[C+1].type=="checkbox")||(document.forms[0].elements[C+1].type=="radio")||(document.forms[0].elements[C+1].type=="textarea")||(document.forms[0].elements[C+1].type.substring(0,6)=="select"))&&(!document.forms[0].elements[C+1].disabled)){document.forms[0].elements[C+1].focus();break}else{}}}}}}}function CheckAll(G,H){var E=document.aspnetForm;var F=G.checked;for(i=0;i<E.length;i++){e=E.elements[i];if(e.type=="checkbox"&&e.name.indexOf(H)!=-1){e.checked=F}}}var arrcounter=0;var PopupCont=0;var arrCodeQty=new Array(50);var strAddToCartQuery="";var IsBackOrderEnabled;var isStockWatchListEnabled;var IsOutofStockchkEnabled;var BaseURL;var RedirecttoShopCart;var DisplayInventory;var UserSessionValue;function SetConfigValues(I,H,G,F,J){IsBackOrderEnabled=I;isStockWatchListEnabled=H;IsOutofStockchkEnabled=G;BaseURL=F;RedirecttoShopcart=J}function SetConfigurationValues(K,J,H,G,L,I){IsBackOrderEnabled=K;isStockWatchListEnabled=J;IsOutofStockchkEnabled=H;BaseURL=G;RedirecttoShopcart=L;DisplayInventory=I}function SetUserSession(B){UserSessionValue=B}function Additem(){if(PopupCont<arrcounter){var B=arrCodeQty[PopupCont].split("`");if(DisplayInventory=="True"){if(IsBackOrderEnabled=="0"){if(parseInt(B[1])<parseInt(B[2])){straddtocart=B[0]+"_"+B[1];AddItemToCart(straddtocart)}else{straddtocart=B[0]+"_"+B[2];AddItemToCart(straddtocart)}}else{straddtocart=B[0]+"_"+B[2];AddItemToCart(straddtocart)}}else{straddtocart=B[0]+"_"+B[2];AddItemToCart(straddtocart)}}else{if(strAddToCartQuery!=""||strAddToCartQuery.length!=0){AddItemToCart("Redirect")}}}function ShowPopUp(O){var K='<div class="pop_sku_outer"> <div class="pop_sku_inner" id="PopupContentDiv">'+GetContenHTML(O)+"</div></div>";var J=document.getElementById("popupHead");if(!J){var M=document.documentElement.clientHeight;var P=document.documentElement.clientWidth;var L=parseInt((150)/2)+document.documentElement.scrollLeft;var N=parseInt((300)/2)+document.documentElement.scrollTop;var J=document.createElement("div");J.setAttribute("id","popupHead");J.className="popupdivContainer";var I=document.createElement("span");I.innerHTML=K;J.appendChild(I);J.style.top=N+"px";document.getElementsByTagName("body")[0].appendChild(J)}return false}function GetContenHTML(strvalue){var arrCartItem=strvalue.split("`");var Code=arrCartItem[0];var SKUCode=arrCartItem[1];var StockQty=arrCartItem[2];var Qty=arrCartItem[3];var cntHTML='<div><div class="popup_cancel" ><input id="btnCancel" class="float_right"  type="button" value="X"  onclick="javascript:closePopUp();"/></div><div class="pop_innertext">';if(eval(Qty)>eval(StockQty)){if(IsBackOrderEnabled=="1"){if(isStockWatchListEnabled=="1"&&IsOutofStockchkEnabled=="1"){if(eval(StockQty)<1){cntHTML=cntHTML+"<strong>Available quantity for the item "+SKUCode+" is '0'.</strong><br/><p><strong>You can either continue to add this item to your cart or <br/> you can track the item on your stock watch list and be notified when it is in stock. </strong></p><p><br/></p>";cntHTML=cntHTML+'<table cellpadding="2" cellspacing="2" align="center" ><tr><td><input id="btnAddtoCart" type="button" class="add2cart_m" onclick="javascript:AddItemToCart(\''+Code+"_"+Qty+"');\"/></td></tr><tr>";cntHTML=cntHTML+'<td><input id="btnAddtoSW" type="button"  class="add2stockwatchlist_intab" onclick="javascript:AddItemtoStockWatchList(\''+SKUCode+"','"+Qty+"');\"/></td></tr></table>"}else{if(parseInt(Qty)>parseInt(StockQty)){var RemainQty=parseInt(Qty)-parseInt(StockQty);cntHTML=cntHTML+"<p><strong>Available quantity for the item "+SKUCode+" is "+StockQty+", remaining quantity '"+RemainQty+"' will be added to your stock watch list.</br></strong></p><p><br/></p>";cntHTML=cntHTML+'<table cellpadding="2" cellspacing="2"  align="center"><tr><td><input id="btnAddtoCart" type="button" class="add2entireqtycart_intab"  onclick="javascript:AddItemToCart(\''+Code+"_"+Qty+"');\"/></td></tr><tr>";cntHTML=cntHTML+'<td><input id="btnAddtoSW" type="button" class="add2onlyavailableqtycart_intab"  onclick="javascript:AddToCartwithStockWatch(\''+Code+"','"+StockQty+"','"+RemainQty+"','"+SKUCode+"');\"/></td></tr></table>"}else{cntHTML=cntHTML+Code+"_"+Qty}}}else{cntHTML=cntHTML+Code+"_"+Qty}}else{if(IsBackOrderEnabled=="0"){if(isStockWatchListEnabled=="1"&&IsOutofStockchkEnabled=="1"){if(eval(StockQty)<1){cntHTML=cntHTML+"<p><strong>Item "+SKUCode+" added is currently not available, however you can track the item on your stock watch list and be notified when it is in stock. </br></strong></p>";cntHTML=cntHTML+'<table cellpadding="2" cellspacing="2"  align="center"><tr><td><input id="btnAddtoCart" type="button" class="cancel"   onclick="javascript:Cancel()"/></td></tr><tr>';cntHTML=cntHTML+'<td><input id="btnAddtoSW" type="button" class="add2stockwatchlist_intab"   onclick="javascript:AddItemtoStockWatchList(\''+SKUCode+"','"+Qty+"');\"/></td></tr></table>"}else{if(eval(Qty)>eval(StockQty)){var RemainQty=parseInt(Qty)-parseInt(StockQty);cntHTML=cntHTML+"<p><strong>Available quantity for the item "+SKUCode+" is '"+StockQty+"', remaining quantity '"+RemainQty+"' will be added to your stock watch list. </br></p>";cntHTML=cntHTML+'<table cellpadding="2" cellspacing="2"  align="center"><tr><td><input id="btnAddtoCart" class="cancel" type="button"  onclick="javascript:Cancel()" width="87" height="20"/></td></tr><tr>';cntHTML=cntHTML+'<td><input id="btnAddtoSW"  class="add2onlyavailableqtycart_intab" type="button"  onclick="javascript:AddToCartwithStockWatch(\''+Code+"','"+StockQty+"','"+RemainQty+"','"+SKUCode+"');\"/></td></tr></table>"}}}else{alert("Item Added is back ordered, Available quantity for item "+SKUCode+" is "+StockQty+"");return false}}}}else{cntHTML=cntHTML+Code+"_"+Qty}cntHTML=cntHTML+"</div></div>";return cntHTML}function AddItemToCart(H){if(H=="Redirect"){if(RedirecttoShopcart==0){setTimeout("ShowProcessing('Adding to your cart, please wait...')",1000);var G=BaseURL+"Basket/Purchase.aspx?skus="+strAddToCartQuery+"&closewin=0";postRequest(G);if(UserSessionValue=="True"){if(panel!=null){setTimeout("getCartItems()",1000);ClearAllMessages();if(document.getElementById("lblShowMessage")!=null){setTimeout("document.getElementById('lblShowMessage').innerHTML ='Item(s) added successfully.';",1000)}}setTimeout("StopProcessing()",1000)}else{var E=document.getElementById("hdnGetRedirectURL").value;E=E.replace("~","../");window.location.href=E}strAddToCartQuery=""}else{setTimeout("window.opener.ShowProcessing('Adding to your cart, please wait...')",1000);var G=BaseURL+"Basket/Purchase.aspx?skus="+strAddToCartQuery+"&closewin=0";window.opener.postRequest(G);if(UserSessionValue=="True"){if(window.opener.panel!=null){setTimeout("window.opener.getCartItems()",1000);if(document.getElementById("lblShowMessage")!=null){setTimeout("document.getElementById('lblShowMessage').innerHTML ='Item added successfully.';",1000)}}setTimeout("window.opener.StopProcessing()",1000)}else{var E=document.getElementById("hdnGetRedirectURL").value;E=E.replace("~","../");window.opener.location.href=E}strAddToCartQuery=""}return true}else{if(strAddToCartQuery==""){strAddToCartQuery=H}else{strAddToCartQuery=strAddToCartQuery+";"+H}PopupCont=PopupCont+1;closePopUp();var F=setTimeout("Additem()",300)}return false}function AddItemtoStockWatchList(D,E){returnVal=Ignify.eCommerce.Web.Store.MasterTemplates.Ignify.Modules.SharedModules.ProductSkusMultiModule.AddItemtoStockWatchList(D,E);PopupCont=PopupCont+1;closePopUp();var F=setTimeout("Additem()",300);return false}function AddToCartwithStockWatch(J,H,F,I){J=J+"_"+H;returnVal=Ignify.eCommerce.Web.Store.MasterTemplates.Ignify.Modules.SharedModules.ProductSkusMultiModule.AddItemtoStockWatchList(I,F);if(strAddToCartQuery==""){strAddToCartQuery=J}else{strAddToCartQuery=strAddToCartQuery+";"+J}PopupCont=PopupCont+1;closePopUp();var G=setTimeout("Additem()",300)}function closePopUp(){var B=document.getElementById("popupHead");if(!B){return}B.parentNode.removeChild(B)}function Cancel(){PopupCont=PopupCont+1;closePopUp();var B=setTimeout("Additem()",300)}function ValidateSKUforStockWatchlist(Code,Qty,StockQty,IsBackOrderEnabled,isStockWatchListEnabled,IsOutofStockchkEnabled,baseurl,SKUCode){if(eval(Qty)>eval(StockQty)){if(IsBackOrderEnabled=="1"){if(isStockWatchListEnabled=="1"&&IsOutofStockchkEnabled=="1"){if(eval(StockQty)<1){var win=window.open("../catalog/PopupMessage.aspx?Code= "+Code+"&Qty="+Qty+"&StockQty="+StockQty+"&SKUCode="+SKUCode+"&Backorder=FB&BO=True","StockWatch","height=250,width=800,scrollbars=no,screenX=250,screenY=250,left=250,top=250");win.focus()}else{if(eval(Qty)>eval(StockQty)){var win=window.open("../catalog/PopupMessage.aspx?Code= "+Code+"&Qty="+Qty+"&StockQty="+StockQty+"&SKUCode="+SKUCode+"&&Backorder=PB&BO=True","StockWatch","height=250,width=800,scrollbars=no,screenX=250,screenY=250,left=250,top=250");win.focus()}else{str=Code+"_"+Qty;setTimeout("ShowProcessing('Adding to your cart, please wait...')",1000);var url=baseurl+"Basket/Purchase.aspx?skus="+str;postRequest(url);if(panel!=null){setTimeout("getCartItems()",1000)}setTimeout("StopProcessing()",1000)}}}else{str=Code+"_"+Qty;setTimeout("ShowProcessing('Adding to your cart, please wait...')",1000);var url=baseurl+"Basket/Purchase.aspx?skus="+str;postRequest(url);if(panel!=null){setTimeout("getCartItems()",1000)}setTimeout("StopProcessing()",1000)}}else{if(IsBackOrderEnabled=="0"){if(isStockWatchListEnabled=="1"&&IsOutofStockchkEnabled=="1"){if(eval(StockQty)<1){var win=window.open("../catalog/PopupMessage.aspx?Code= "+Code+"&Qty="+Qty+"&StockQty="+StockQty+"&SKUCode="+SKUCode+"&&Backorder=FB&BO=False","StockWatch","height=250,width=800,scrollbars=no,screenX=250,screenY=250,left=250,top=10");win.focus()}else{if(eval(Qty)>eval(StockQty)){var win=window.open("../catalog/PopupMessage.aspx?Code= "+Code+"&Qty="+Qty+"&StockQty="+StockQty+"&SKUCode="+SKUCode+"&&Backorder=PB&BO=False","StockWatch","height=250,width=800,scrollbars=no,screenX=250,screenY=250,left=250,top=10");win.focus()}}}else{alert("Item Added is back ordered, Available quantity for item "+SKUCode+" is "+StockQty+"");return false}}}}else{str=Code+"_"+Qty;setTimeout("ShowProcessing('Adding to your cart, please wait...')",1000);var url=baseurl+"Basket/Purchase.aspx?skus="+str;postRequest(url);if(panel!=null){setTimeout("getCartItems()",1000)}setTimeout("StopProcessing()",1000)}return false};
