if(typeof (wsfe)=="undefined"){wsfe={}}wsfe.version="";wsfe.contentLoadingId=0;wsfe.lastPageReq="";wsfe.wxsessionid="";wsfe.shopuid="";wsfe.runOnLoad=function(){};wsfe.allJsLoaded=false;wsfe.globalBucket="global/";wsfe.assetsBucket="files/";function InitWindow(){if(wsfe.enableAjax){wsfe.reqBookmarkedState=YAHOO.util.History.getBookmarkedState("req");wsfe.reqInitialState=wsfe.cleanPath(window.location.href);wsfe.reqCurrentState;wsfe.hmReady=false;wsfe.requestStateChangeHandler=function(C){if(C){if(C!="posted_data"){var D=C.split(",");var A=((D[0])?(D[0]):"");var B=((D[1])?(D[1]):"");wsfe.doGo(A,B)}else{}}};YAHOO.util.History.register("req","",wsfe.requestStateChangeHandler);YAHOO.util.History.onReady(function(){wsfe.reqCurrentState=wsfe.reqBookmarkedState;wsfe.hmReady=true});YAHOO.util.History.initialize(document.getElementById("history-field"),document.getElementById("history-iframe"))}else{wsfe.hmReady=true}if(WindowOtherOnLoad&&typeof WindowOtherOnLoad==="function"){WindowOtherOnLoad()}wsfe.runOnLoad();window.setTimeout(wsfe.PreloadJS,100)}wsfe.PreloadJS=function(){if(wsfe.reqCurrentState&&wsfe.reqCurrentState!=wsfe.reqInitialState){wsfe.requestStateChangeHandler(wsfe.reqCurrentState)}var D=false;var A=document.getElementsByTagName("head")[0];var C=["script/feutil.js","script/fm_util.js","script/secure_area.js"];for(var B=0;B<C.length;B++){D=document.createElement("script");D.type="text/javascript";D.src=wsfe.globalBucket+C[B]+"?v="+wsfe.version;A.appendChild(D)}if(wsfe.enableAjax){wsfe.AnchorsToAjax()}};wsfe.cleanPath=function(B){var E=new RegExp("^"+window.location.protocol+"//"+window.location.host+"/(wsfe/)?","gi");B=B.replace(E,"");E=new RegExp("^default.aspx","gi");B=B.replace(E,"");if(B==""){B="h"}var C=B.split("#");B=C[0];C=B.split("?");B=C[0];var D=[];if(C.length>1){var A=C[1]+"&";A=A.replace(/(siteid|wxsessionid|ajax|mil|shopuid)=[^&]*&/gi,"");if(A.length>0){B+="?"+A}}return B};wsfe.fixPath=function(A,B){A=A.replace(/^\//,"").toLowerCase();if(A.indexOf("ajax=1")==-1){A=wsfe.appendParam(A,"ajax",1)}if(!B){A=wsfe.appendParam(A,"tid",wsfe.templateid)}if((wsfe.shopuid)&&(wsfe.shopuid.length>0)){A=wsfe.appendParam(A,"shopuid",wsfe.shopuid)}if((wsfe.wxsessionid)&&(wsfe.wxsessionid.length>0)){A=wsfe.appendParam(A,"wxsessionid",wsfe.wxsessionid)}A=wsfe.appendParam(A,"mil",wsfe.Rand());return A};wsfe.buildFullPath=function(B){var A=document.getElementsByTagName("base");if(A&&A[0]&&A[0].href){B=A[0].href+B}if((wsfe.shopuid)&&(wsfe.shopuid.length>0)){B=wsfe.appendParam(B,"shopuid",wsfe.shopuid)}if((wsfe.wxsessionid)&&(wsfe.wxsessionid.length>0)){B=wsfe.appendParam(B,"wxsessionid",wsfe.wxsessionid)}return B};wsfe.appendParam=function(B,A,E){var D=new RegExp("(\\?|&)"+A+"=","i");if(B.search(D)==-1){var C=(B.indexOf("?")<0)?"?":"&";B=[B,C,A,"=",E].join("")}return B};wsfe.showBusy=function(A){document.getElementById(A).innerHTML="<div style='width:100%;margin:30px;text-align: center;'><img src='global/images/loading.gif' alt='Loading'/><br>Loading... Please wait</div>";document.getElementById(A).style.visibility="visible"};wsfe.go=function(E,F,H,C,D){if((typeof popdown!="undefined")&&(typeof _menuCloseDelay!="undefined")){popdown()}if(wsfe.hmReady){if(H){if(wsfe.enableAjax){YAHOO.util.History.navigate("req","posted_data")}if(E){E=wsfe.fixPath(E,true);if(C){if(fmutil.FormOnSubmit(C)){document.getElementById("fm").style.display="none";document.getElementById("formProcessing").style.display="";if(!D&&H.search(/type=('|")file('|")/gi)>=0){var A=false;var B=C.getElementsByTagName("input");for(i=0;i<B.length;i++){elem=B.item(i);if(elem.type&&(elem.type.search(/file/gi)==0)){A=true;break}}if(A){wsfe.formPostCallback=function(){wsfe.go(E,F,H,C,true);wsfe.formPostCallback=function(){}};C.action=E;C.submit();return }}wsfe.sendRequest(E,H,"POST")}}else{wsfe.sendRequest(E,H,"POST")}}if(F){F=wsfe.fixPath(F,true);wsfe.refreshBreadcrumbs(F);wsfe.sendJsRequest(F,H,"POST")}}else{if(wsfe.enableAjax){if(E){E=wsfe.cleanPath(E)}if(F){F=wsfe.cleanPath(F)}var G=((E)?E:"")+((F)?","+F:"");document.getElementById("ws.dynamiccontent").style.visibility="hidden";if(G==YAHOO.util.History.getCurrentState("req")){wsfe.requestStateChangeHandler(G)}else{YAHOO.util.History.navigate("req",G)}}else{E=wsfe.buildFullPath(E);document.location.href=E}}}else{self.setTimeout(function(){wsfe.go(E,F,H,C)},50)}};wsfe.formPostCallback=function(){};wsfe.doGo=function(A,B){if((A.length>0)||((A.length==0)&&(B.length==0))){wsfe.contentLoadingId=window.setTimeout("wsfe.showBusy('ws.dynamiccontent')",200);A=wsfe.fixPath(A);wsfe.refreshBreadcrumbs(A);wsfe.refreshDynamicImage(A);wsfe.sendRequest(A)}if(B.length>0){B=wsfe.fixPath(B,true);wsfe.sendJsRequest(B,"","GET")}};wsfe.refreshBreadcrumbs=function(D){var C=document.getElementById("bcrumbs");if(C){var B=D.split("?");var E=B[0];var A="getbreadcrumbs?path="+E;if(B.length>1){A+="&"+B[1]}wsfe.sendJsRequest(A)}};wsfe.getXMLHTTPObject=function(){var D;if(typeof XMLHttpRequest!="undefined"){D=new XMLHttpRequest()}else{if(window.ActiveXObject){var A=["MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];for(var B=0;B<A.length;B++){try{D=new ActiveXObject(A[B]);break}catch(C){}}}}if(!D){alert("This site works best with a browser that supports AJAX.")}return D};wsfe.sendRequest=function(B,C,E,A){var D=wsfe.getXMLHTTPObject();if(A){D.onreadystatechange=function(){A(D)}}else{D.onreadystatechange=function(){wsfe.displayStatus(D)}}if(!B){B=wsfe.lastPageReq}if(!C){C=""}if(!E){E="GET"}wsfe.lastPageReq=B;D.open(E,B,true);D.send(C)};wsfe.sendJsRequest=function(A,B,C){wsfe.sendRequest(A,B,C,wsfe.jsExecute)};wsfe.displayStatus=function(G){if(G.readyState==4){if(G.responseText.indexOf("connect to JRun Server")>0){wsfe.sendRequest()}else{if(wsfe.contentLoadingId>0){window.clearTimeout(wsfe.contentLoadingId)}document.getElementById("ws.dynamiccontent").innerHTML=G.responseText;var F=new RegExp(/<script[^>]*>((.|\n)*?)<\/script>/gi);var C=G.responseText.match(F);if(C){var E="";for(var B=0;B<C.length;B++){E+=C[B].replace(/<script[^>]*>/i,"").replace(/<\/script>/i,"\n")}if(E.length>0){var A=document.getElementById("jsForm");if(A){document.body.removeChild(A)}var D=document.createElement("script");D.defer=true;D.id="jsForm";D.type="text/javascript";D.text=E;document.body.appendChild(D)}}}wsfe.AnchorsToAjax();document.getElementById("ws.dynamiccontent").style.visibility="visible";scroll(0,0)}};wsfe.jsExecute=function(B){if(B.readyState==4){var A=document.getElementById("jsId");if(A){document.body.removeChild(A)}js=document.createElement("script");js.defer=true;js.id="jsId";js.type="text/javascript";js.text=B.responseText;document.body.appendChild(js);wsfe.AnchorsToAjax()}};wsfe.collectionToArray=function(A){arr=new Array();for(i=0;i<A.length;i++){arr[arr.length]=A[i]}return arr};wsfe.refreshDynamicImage=function(E){elements=document.getElementsByTagName("img");var H=wsfe.collectionToArray(elements);var C=[];var F="";if(H.length){for(j=0;j<H.length;j++){if(H[j].id.length){if(H[j].id.indexOf("dynimg_")==0){C.push(H[j].id.substring(7))}}}}if(C.length>0){F=C.join(",")}elements=document.getElementsByTagName("div");navs=wsfe.collectionToArray(elements);var B=[];var D="";if(navs.length){for(j=0;j<navs.length;j++){if(navs[j].id.length){if(navs[j].id.indexOf("dynnav_")==0){B.push(navs[j].id.substring(7))}}}}if(B.length>0){D=B.join(",")}if((F.length)||(D.length)){elems=E.split("?");var G=elems[0];var A="getdynamicimage?path="+G;if(elems.length>1){A+="&"+elems[1]}if(F.length){A+="&imgids="+F}if(D.length){A+="&navids="+D}wsfe.sendJsRequest(A)}};wsfe.GetCookie=function(C){var D=document.cookie.indexOf(C+"=");var A=D+C.length+1;if((!D)&&(C!=document.cookie.substring(0,C.length))){return null}if(D==-1){return null}var B=document.cookie.indexOf(";",A);if(B==-1){B=document.cookie.length}return unescape(document.cookie.substring(A,B))};wsfe.SetCookie=function(C,E,A,H,D,G){var B=new Date();B.setTime(B.getTime());if(A){A=A*1000*60*60*24}var F=new Date(B.getTime()+(A));document.cookie=C+"="+escape(E)+((A)?";expires="+F.toGMTString():"")+((H)?";path="+H:"")+((D)?";domain="+D:"")+((G)?";secure":"")};wsfe.DeleteCookie=function(A,C,B){if(wsfe.GetCookie(A)){document.cookie=A+"="+((C)?";path="+C:"")+((B)?";domain="+B:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}};wsfe.CookiesEnabled=function(){var A=new Date();A.setTime(A.getTime()+(60*1000*5));wsfe.SetCookie("TestCookie","Yes",A,"/","","");test=wsfe.GetCookie("TestCookie");if((test)&&(test=="Yes")){return true}else{return false}};wsfe.AnchorsToAjax=function(){var A=document.anchors;for(var B=0;B<A.length;B++){if(((A[B].name=="navigation")||(A[B].name=="breadcrumbs")||(A[B].name=="sitemap"))&&(A[B].href.indexOf("javascript")<0)){A[B].href='javascript:wsfe.go("'+wsfe.cleanPath(A[B].href)+'");'}}};wsfe.Rand=function(){return Math.round(Math.random()*100000)};wsfe.getQueryVariable=function(A){var D=window.location.search.substring(1);var C=D.split("&");for(var B=0;B<C.length;B++){var E=C[B].split("=");if(E[0]==A){return E[1]}}};wsfe.drawmap=function(G,H,A,D,F,I,E,C){var B=window.frames["frame_"+G].document;B.body.style.margin="0";B.body.innerHTML=['<img src="http://maps.google.com/staticmap?center=',D,",",F,"&zoom=",I,"&size=",A,"x",H,"&markers=",D,",",F,"&key=",E,'" alt="',C,'" title="',C,'" />'].join("")};