var LazyLoad=function(){var B=null;var A=[];return{load:function(H,I,G,E){var F={urls:H,callback:I,obj:G,scope:E};if(B){A.push(F);return }B=F;H=H.constructor===Array?H:[H];var C;for(var D=0;D<H.length;D+=1){C=document.createElement("script");C.src=H[D];document.body.appendChild(C)}if(!C){return }if((/msie/i).test(navigator.userAgent)&&!(/AppleWebKit\/([^ ]*)/).test(navigator.userAgent)&&!(/opera/i).test(navigator.userAgent)){C.onreadystatechange=function(){if(this.readyState==="loaded"||this.readyState==="complete"){LazyLoad.requestComplete()}}}else{C=document.createElement("script");C.appendChild(document.createTextNode("LazyLoad.requestComplete();"));document.body.appendChild(C)}},loadOnce:function(K,L,I,M,D){var E=[],F=document.getElementsByTagName("script");K=K.constructor===Array?K:[K];for(var J=0;J<K.length;J+=1){var H=false,C=K[J];for(var G=0;G<F.length;G+=1){if(C===F[G].src){H=true;break}}if(!H){E.push(C)}}if(E.length>0){this.load(E,L,I,M)}else{if(D){if(I){if(M){L.call(I)}else{L.call(window,I)}}else{L.call()}}}},requestComplete:function(){if(B.callback){if(B.obj){if(B.scope){B.callback.call(B.obj)}else{B.callback.call(window,B.obj)}}else{B.callback.call()}}B=null;if(A.length>0){var C=A.shift();this.load(C.urls,C.callback,C.obj,C.scope)}}}}();escapeJSONChar=function escapeJSONChar(B){if(B=='"'||B=="\\"){return"\\"+B}else{if(B=="\b"){return"\\b"}else{if(B=="\f"){return"\\f"}else{if(B=="\n"){return"\\n"}else{if(B=="\r"){return"\\r"}else{if(B=="\t"){return"\\t"}}}}}}var A=B.charCodeAt(0).toString(16);if(A.length==1){return"\\u000"+A}else{if(A.length==2){return"\\u00"+A}else{if(A.length==3){return"\\u0"+A}else{return"\\u"+A}}}};escapeJSONString=function escapeJSONString(B){var C=B.split("");for(var A=0;A<C.length;A++){var D=C[A];if(D=='"'||D=="\\"||D.charCodeAt(0)<32||D.charCodeAt(0)>=128){C[A]=escapeJSONChar(C[A])}}return'"'+C.join("")+'"'};toJSON=function toJSON(C){if(C==null){return"null"}else{if(C.constructor==String){return escapeJSONString(C)}else{if(C.constructor==Number){return C.toString()}else{if(C.constructor==Boolean){return C.toString()}else{if(C.constructor==Date){return'{javaClass: "java.util.Date", time: '+C.valueOf()+"}"}else{if(C.constructor==Array){var A=[];for(var B=0;B<C.length;B++){A.push(toJSON(C[B]))}return"["+A.join(", ")+"]"}else{var A=[];for(attr in C){if(C[attr]==null){A.push('"'+attr+'": null')}else{if(typeof C[attr]=="function"){}else{A.push(escapeJSONString(attr)+": "+toJSON(C[attr]))}}}return"{"+A.join(", ")+"}"}}}}}}};JSONRpcClient=function JSONRpcClient_ctor(B,C,E,F){this.serverURL=B;this.user=C;this.pass=E;this.objectID=F;if(this.objectID){this._addMethods(["listMethods"]);var D=this._makeRequest("listMethods",[])}else{this._addMethods(["system.listMethods"]);var D=this._makeRequest("system.listMethods",[])}var A=this._sendRequest(D);this._addMethods(A)};JSONRpcClient.Exception=function JSONRpcClient_Exception_ctor(E,D,C){this.code=E;var B;if(C){this.javaStack=C;var A=C.match(/^([^:]*)/);if(A){B=A[0]}}if(B){this.name=B}else{this.name="JSONRpcClientException"}this.message=D};JSONRpcClient.Exception.CODE_REMOTE_EXCEPTION=490;JSONRpcClient.Exception.CODE_ERR_CLIENT=550;JSONRpcClient.Exception.CODE_ERR_PARSE=590;JSONRpcClient.Exception.CODE_ERR_NOMETHOD=591;JSONRpcClient.Exception.CODE_ERR_UNMARSHALL=592;JSONRpcClient.Exception.CODE_ERR_MARSHALL=593;JSONRpcClient.Exception.prototype=new Error();JSONRpcClient.Exception.prototype.toString=function JSONRpcClient_Exception_toString(A,B){return this.name+": "+this.message};JSONRpcClient.default_ex_handler=function JSONRpcClient_default_ex_handler(A){alert(A)};JSONRpcClient.toplevel_ex_handler=JSONRpcClient.default_ex_handler;JSONRpcClient.profile_async=false;JSONRpcClient.max_req_active=1;JSONRpcClient.requestId=1;JSONRpcClient.prototype._createMethod=function JSONRpcClient_createMethod(A){var B=function(){var C=[];var F=null;for(var D=0;D<arguments.length;D++){C.push(arguments[D])}if(typeof C[0]=="function"){F=C.shift()}var E=B.client._makeRequest.call(B.client,B.methodName,C,F);if(F==null){return B.client._sendRequest.call(B.client,E)}else{JSONRpcClient.async_requests.push(E);JSONRpcClient.kick_async();return E.requestId}};B.client=this;B.methodName=A;return B};JSONRpcClient.prototype._addMethods=function JSONRpcClient_addMethods(C){for(var B=0;B<C.length;B++){var E=this;var D=C[B].split(".");for(var G=0;G<D.length-1;G++){var A=D[G];if(E[A]){E=E[A]}else{E[A]=new Object();E=E[A]}}var A=D[D.length-1];if(!E[A]){var F=this._createMethod(C[B]);E[A]=F}}};JSONRpcClient._getCharsetFromHeaders=function JSONRpcClient_getCharsetFromHeaders(A){try{var E=A.getResponseHeader("Content-type");var D=E.split(/\s*;\s*/);for(var B=0;B<D.length;B++){if(D[B].substring(0,8)=="charset="){return D[B].substring(8,D[B].length)}}}catch(C){}return"UTF-8"};JSONRpcClient.async_requests=[];JSONRpcClient.async_inflight={};JSONRpcClient.async_responses=[];JSONRpcClient.async_timeout=null;JSONRpcClient.num_req_active=0;JSONRpcClient._async_handler=function JSONRpcClient_async_handler(){JSONRpcClient.async_timeout=null;while(JSONRpcClient.async_responses.length>0){var A=JSONRpcClient.async_responses.shift();if(A.canceled){continue}if(A.profile){A.profile.dispatch=new Date()}try{A.cb(A.result,A.ex,A.profile)}catch(C){JSONRpcClient.toplevel_ex_handler(C)}}while(JSONRpcClient.async_requests.length>0&&JSONRpcClient.num_req_active<JSONRpcClient.max_req_active){var B=JSONRpcClient.async_requests.shift();if(B.canceled){continue}B.client._sendRequest.call(B.client,B)}};JSONRpcClient.kick_async=function JSONRpcClient_kick_async(){if(JSONRpcClient.async_timeout==null){JSONRpcClient.async_timeout=setTimeout(JSONRpcClient._async_handler,0)}};JSONRpcClient.cancelRequest=function JSONRpcClient_cancelRequest(B){if(JSONRpcClient.async_inflight[B]){JSONRpcClient.async_inflight[B].canceled=true;return true}for(var A in JSONRpcClient.async_requests){if(JSONRpcClient.async_requests[A].requestId==B){JSONRpcClient.async_requests[A].canceled=true;return true}}for(var A in JSONRpcClient.async_responses){if(JSONRpcClient.async_responses[A].requestId==B){JSONRpcClient.async_responses[A].canceled=true;return true}}return false};JSONRpcClient.prototype._makeRequest=function JSONRpcClient_makeRequest(B,C,A){var D={};D.client=this;D.requestId=JSONRpcClient.requestId++;var E={};E.id=D.requestId;if(this.objectID){E.method=".obj#"+this.objectID+"."+B}else{E.method=B}E.params=C;if(A){D.cb=A}if(JSONRpcClient.profile_async){D.profile={"submit":new Date()}}D.data=toJSON(E);return D};JSONRpcClient.prototype._sendRequest=function JSONRpcClient_sendRequest(C){if(C.profile){C.profile.start=new Date()}var B=JSONRpcClient.poolGetHTTPRequest();JSONRpcClient.num_req_active++;if(typeof (this.user)=="undefined"){B.open("POST",this.serverURL,(C.cb!=null))}else{B.open("POST",this.serverURL,(C.cb!=null),this.user,this.pass)}try{B.setRequestHeader("Content-type","text/plain")}catch(D){}if(C.cb){var A=this;B.onreadystatechange=function(){if(B.readyState==4){B.onreadystatechange=function(){};var E={"cb":C.cb,"result":null,"ex":null};if(C.profile){E.profile=C.profile;E.profile.end=new Date()}try{E.result=A._handleResponse(B)}catch(F){E.ex=F}if(!JSONRpcClient.async_inflight[C.requestId].canceled){JSONRpcClient.async_responses.push(E)}delete JSONRpcClient.async_inflight[C.requestId];JSONRpcClient.kick_async()}}}else{B.onreadystatechange=function(){}}JSONRpcClient.async_inflight[C.requestId]=C;try{B.send(C.data)}catch(D){JSONRpcClient.poolReturnHTTPRequest(B);JSONRpcClient.num_req_active--;throw new JSONRpcClient.Exception(JSONRpcClient.Exception.CODE_ERR_CLIENT,"Connection failed")}if(!C.cb){return this._handleResponse(B)}};JSONRpcClient.prototype._handleResponse=function JSONRpcClient_handleResponse(http){if(!this.charset){this.charset=JSONRpcClient._getCharsetFromHeaders(http)}var status,statusText,data;try{status=http.status;statusText=http.statusText;data=http.responseText}catch(e){JSONRpcClient.poolReturnHTTPRequest(http);JSONRpcClient.num_req_active--;JSONRpcClient.kick_async();throw new JSONRpcClient.Exception(JSONRpcClient.Exception.CODE_ERR_CLIENT,"Connection failed")}JSONRpcClient.poolReturnHTTPRequest(http);JSONRpcClient.num_req_active--;if(status!=200){throw new JSONRpcClient.Exception(status,statusText)}var obj;try{eval("obj = "+data)}catch(e){throw new JSONRpcClient.Exception(550,"error parsing result")}if(obj.error){throw new JSONRpcClient.Exception(obj.error.code,obj.error.msg,obj.error.trace)}var res=obj.result;if(res&&res.objectID&&res.JSONRPCType=="CallableReference"){return new JSONRpcClient(this.serverURL,this.user,this.pass,res.objectID)}return res};JSONRpcClient.http_spare=[];JSONRpcClient.http_max_spare=8;JSONRpcClient.poolGetHTTPRequest=function JSONRpcClient_pool_getHTTPRequest(){if(JSONRpcClient.http_spare.length>0){return JSONRpcClient.http_spare.pop()}return JSONRpcClient.getHTTPRequest()};JSONRpcClient.poolReturnHTTPRequest=function JSONRpcClient_poolReturnHTTPRequest(A){if(JSONRpcClient.http_spare.length>=JSONRpcClient.http_max_spare){delete A}else{JSONRpcClient.http_spare.push(A)}};JSONRpcClient.msxmlNames=["MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];JSONRpcClient.getHTTPRequest=function JSONRpcClient_getHTTPRequest(){try{JSONRpcClient.httpObjectName="XMLHttpRequest";return new XMLHttpRequest()}catch(B){}for(var A=0;A<JSONRpcClient.msxmlNames.length;A++){try{JSONRpcClient.httpObjectName=JSONRpcClient.msxmlNames[A];return new ActiveXObject(JSONRpcClient.msxmlNames[A])}catch(B){}}JSONRpcClient.httpObjectName=null;throw new JSONRpcClient.Exception(0,"Can't create XMLHttpRequest object")};function showHide(A){var B,C;if(document.getElementById){B=document.getElementById(A)}else{if(document.all){B=document.all[A]}else{if(document.layers){B=document.layers[A]}}}C=B.style;if(C.display==""&&B.offsetWidth!=undefined&&B.offsetHeight!=undefined){C.display=(B.offsetWidth!=0&&B.offsetHeight!=0)?"inline":"none"}C.display=(C.display==""||C.display=="inline")?"none":"inline"}function showHideSubNav(A){dojo.byId("homeSubNav").style.display="none";dojo.byId("productsSubNav").style.display="none";dojo.byId("orderSubNav").style.display="none";dojo.byId("aboutUsSubNav").style.display="none";dojo.byId("dealerSubNav").style.display="none";dojo.byId(A).style.display="block";dojo.byId(A).style.height="13";dojo.byId(A).style.margin="-12 0 0 0"}function clickon(C){var H=document.getElementById("stock");var G=document.getElementById("orderInputDiv");var F=document.getElementById("order_image");var D=document.getElementById("stockInputDiv");var E=document.getElementById("stock_image");var A=document.getElementById("login");var B=document.getElementById("search");if(C=="stock"){showHide("stockInputDiv");G.style.display="none";B.style.display="none"}if(C=="order"){showHide("orderInputDiv");D.style.display="none";B.style.display="none"}if(C=="search"){showHide("search");D.style.display="none";G.style.display="none"}}if(typeof document.attachEvent!="undefined"){window.attachEvent("onload",init);document.attachEvent("onmousemove",moveMouse);document.attachEvent("onclick",checkMove)}else{window.addEventListener("load",init,false);document.addEventListener("mousemove",moveMouse,false);document.addEventListener("click",checkMove,false)}var oDv=document.createElement("div");var dvHdr=document.createElement("div");var dvBdy=document.createElement("div");var windowlock,boxMove,fixposx,fixposy,lockX,lockY,fixx,fixy,ox,oy,boxLeft,boxRight,boxTop,boxBottom,evt,mouseX,mouseY,boxOpen,totalScrollTop,totalScrollLeft;boxOpen=false;ox=10;oy=10;lockX=0;lockY=0;function init(){oDv.appendChild(dvHdr);oDv.appendChild(dvBdy);oDv.style.position="absolute";oDv.style.visibility="hidden";document.body.appendChild(oDv)}function defHdrStyle(){dvHdr.innerHTML='<img  style="vertical-align:middle"  src="info.gif">&nbsp;&nbsp;'+dvHdr.innerHTML;dvHdr.style.fontWeight="bold";dvHdr.style.width="150px";dvHdr.style.fontFamily="arial";dvHdr.style.border="1px solid #A5CFE9";dvHdr.style.padding="3";dvHdr.style.fontSize="11";dvHdr.style.color="#4B7A98";dvHdr.style.background="#D5EBF9";dvHdr.style.filter="alpha(opacity=85)";dvHdr.style.opacity="0.85"}function defBdyStyle(){dvBdy.style.borderBottom="1px solid #A5CFE9";dvBdy.style.borderLeft="1px solid #A5CFE9";dvBdy.style.borderRight="1px solid #A5CFE9";dvBdy.style.width="150px";dvBdy.style.fontFamily="arial";dvBdy.style.fontSize="11";dvBdy.style.padding="3";dvBdy.style.color="#1B4966";dvBdy.style.background="#FFFFFF";dvBdy.style.filter="alpha(opacity=85)";dvBdy.style.opacity="0.85"}function checkElemBO(A){if(!A||typeof (A)!="string"){return false}if((A.indexOf("header")>-1)&&(A.indexOf("body")>-1)&&(A.indexOf("[")>-1)&&(A.indexOf("[")>-1)){return true}else{return false}}function scanBO(A){if(checkElemBO(A.title)){A.boHDR=getParam("header",A.title);A.boBDY=getParam("body",A.title);A.boCSSBDY=getParam("cssbody",A.title);A.boCSSHDR=getParam("cssheader",A.title);A.IEbugfix=(getParam("hideselects",A.title)=="on")?true:false;A.fixX=parseInt(getParam("fixedrelx",A.title));A.fixY=parseInt(getParam("fixedrely",A.title));A.absX=parseInt(getParam("fixedabsx",A.title));A.absY=parseInt(getParam("fixedabsy",A.title));A.offY=(getParam("offsety",A.title)!="")?parseInt(getParam("offsety",A.title)):10;A.offX=(getParam("offsetx",A.title)!="")?parseInt(getParam("offsetx",A.title)):10;A.fade=(getParam("fade",A.title)=="on")?true:false;A.fadespeed=(getParam("fadespeed",A.title)!="")?getParam("fadespeed",A.title):0.04;A.delay=(getParam("delay",A.title)!="")?parseInt(getParam("delay",A.title)):0;if(getParam("requireclick",A.title)=="on"){A.requireclick=true;document.all?A.attachEvent("onclick",showHideBox):A.addEventListener("click",showHideBox,false);document.all?A.attachEvent("onmouseover",hideBox):A.addEventListener("mouseover",hideBox,false)}else{if(getParam("doubleclickstop",A.title)!="off"){document.all?A.attachEvent("ondblclick",pauseBox):A.addEventListener("dblclick",pauseBox,false)}if(getParam("singleclickstop",A.title)=="on"){document.all?A.attachEvent("onclick",pauseBox):A.addEventListener("click",pauseBox,false)}}A.windowLock=getParam("windowlock",A.title).toLowerCase()=="off"?false:true;A.title="";A.hasbox=1}else{A.hasbox=2}}function getParam(E,D){var C=new RegExp("([^a-zA-Z]"+E+"|^"+E+")\\s*=\\s*\\[\\s*(((\\[\\[)|(\\]\\])|([^\\]\\[]))*)\\s*\\]");var B=C.exec(D);var A;if(B){return B[2].replace("[[","[").replace("]]","]")}else{return""}}function Left(B){var A=0;if(B.calcLeft){return B.calcLeft}var C=B;while(B){if((B.currentStyle)&&(!isNaN(parseInt(B.currentStyle.borderLeftWidth)))&&(A!=0)){A+=parseInt(B.currentStyle.borderLeftWidth)}A+=B.offsetLeft;B=B.offsetParent}C.calcLeft=A;return A}function Top(B){var A=0;if(B.calcTop){return B.calcTop}var C=B;while(B){if((B.currentStyle)&&(!isNaN(parseInt(B.currentStyle.borderTopWidth)))&&(A!=0)){A+=parseInt(B.currentStyle.borderTopWidth)}A+=B.offsetTop;B=B.offsetParent}C.calcTop=A;return A}var ah,ab;function applyStyles(){if(ab){oDv.removeChild(dvBdy)}if(ah){oDv.removeChild(dvHdr)}dvHdr=document.createElement("div");dvBdy=document.createElement("div");CBE.boCSSBDY?dvBdy.className=CBE.boCSSBDY:defBdyStyle();CBE.boCSSHDR?dvHdr.className=CBE.boCSSHDR:defHdrStyle();dvHdr.innerHTML=CBE.boHDR;dvBdy.innerHTML=CBE.boBDY;ah=false;ab=false;if(CBE.boHDR!=""){oDv.appendChild(dvHdr);ah=true}if(CBE.boBDY!=""){oDv.appendChild(dvBdy);ab=true}}var CSE,iterElem,LSE,CBE,LBE,totalScrollLeft,totalScrollTop,width,height;var ini=false;function SHW(){if(document.body&&(document.body.clientWidth!=0)){width=document.body.clientWidth;height=document.body.clientHeight}if(document.documentElement&&(document.documentElement.clientWidth!=0)&&(document.body.clientWidth+20>=document.documentElement.clientWidth)){width=document.documentElement.clientWidth;height=document.documentElement.clientHeight}return[width,height]}var ID=null;function moveMouse(A){A?evt=A:evt=event;CSE=evt.target?evt.target:evt.srcElement;if(!CSE.hasbox){iElem=CSE;while((iElem.parentNode)&&(!iElem.hasbox)){scanBO(iElem);iElem=iElem.parentNode}}if((CSE!=LSE)&&(!isChild(CSE,dvHdr))&&(!isChild(CSE,dvBdy))){if(!CSE.boxItem){iterElem=CSE;while((iterElem.hasbox==2)&&(iterElem.parentNode)){iterElem=iterElem.parentNode}CSE.boxItem=iterElem}iterElem=CSE.boxItem;if(CSE.boxItem&&(CSE.boxItem.hasbox==1)){LBE=CBE;CBE=iterElem;if(CBE!=LBE){applyStyles();if(!CBE.requireclick){if(CBE.fade){if(ID!=null){clearTimeout(ID)}ID=setTimeout("fadeIn("+CBE.fadespeed+")",CBE.delay)}else{if(ID!=null){clearTimeout(ID)}COL=1;ID=setTimeout("oDv.style.visibility='visible';ID=null;",CBE.delay)}}if(CBE.IEbugfix){hideSelects()}fixposx=!isNaN(CBE.fixX)?Left(CBE)+CBE.fixX:CBE.absX;fixposy=!isNaN(CBE.fixY)?Top(CBE)+CBE.fixY:CBE.absY;lockX=0;lockY=0;boxMove=true;ox=CBE.offX?CBE.offX:10;oy=CBE.offY?CBE.offY:10}}else{if(!isChild(CSE,dvHdr)&&!isChild(CSE,dvBdy)&&(boxMove)){if((!isChild(CBE,CSE))||(CSE.tagName!="TABLE")){CBE=null;if(ID!=null){clearTimeout(ID)}fadeOut();showSelects()}}}LSE=CSE}else{if(((isChild(CSE,dvHdr)||isChild(CSE,dvBdy))&&(boxMove))){totalScrollLeft=0;totalScrollTop=0;iterElem=CSE;while(iterElem){if(!isNaN(parseInt(iterElem.scrollTop))){totalScrollTop+=parseInt(iterElem.scrollTop)}if(!isNaN(parseInt(iterElem.scrollLeft))){totalScrollLeft+=parseInt(iterElem.scrollLeft)}iterElem=iterElem.parentNode}if(CBE!=null){boxLeft=Left(CBE)-totalScrollLeft;boxRight=parseInt(Left(CBE)+CBE.offsetWidth)-totalScrollLeft;boxTop=Top(CBE)-totalScrollTop;boxBottom=parseInt(Top(CBE)+CBE.offsetHeight)-totalScrollTop;doCheck()}}}if(boxMove&&CBE){bodyScrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;bodyScrollLet=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;mouseX=evt.pageX?evt.pageX-bodyScrollLet:evt.clientX-document.body.clientLeft;mouseY=evt.pageY?evt.pageY-bodyScrollTop:evt.clientY-document.body.clientTop;if((CBE)&&(CBE.windowLock)){mouseY<-oy?lockY=-mouseY-oy:lockY=0;mouseX<-ox?lockX=-mouseX-ox:lockX=0;mouseY>(SHW()[1]-oDv.offsetHeight-oy)?lockY=-mouseY+SHW()[1]-oDv.offsetHeight-oy:lockY=lockY;mouseX>(SHW()[0]-dvBdy.offsetWidth-ox)?lockX=-mouseX-ox+SHW()[0]-dvBdy.offsetWidth:lockX=lockX}oDv.style.left=((fixposx)||(fixposx==0))?fixposx:bodyScrollLet+mouseX+ox+lockX+"px";oDv.style.top=((fixposy)||(fixposy==0))?fixposy:bodyScrollTop+mouseY+oy+lockY+"px"}}function doCheck(){if((mouseX<boxLeft)||(mouseX>boxRight)||(mouseY<boxTop)||(mouseY>boxBottom)){if(!CBE.requireclick){fadeOut()}if(CBE.IEbugfix){showSelects()}CBE=null}}function pauseBox(A){A?evt=A:evt=event;boxMove=false;evt.cancelBubble=true}function showHideBox(A){oDv.style.visibility=(oDv.style.visibility!="visible")?"visible":"hidden"}function hideBox(A){oDv.style.visibility="hidden"}var COL=0;var stopfade=false;function fadeIn(A){ID=null;COL=0;oDv.style.visibility="visible";fadeIn2(A)}function fadeIn2(A){COL=COL+A;COL=(COL>1)?1:COL;oDv.style.filter="alpha(opacity="+parseInt(100*COL)+")";oDv.style.opacity=COL;if(COL<1){setTimeout("fadeIn2("+A+")",20)}}function fadeOut(){oDv.style.visibility="hidden"}function isChild(A,B){while(A){if(A==B){return true}A=A.parentNode}return false}var cSrc;function checkMove(A){A?evt=A:evt=event;cSrc=evt.target?evt.target:evt.srcElement;if((!boxMove)&&(!isChild(cSrc,oDv))){fadeOut();if(CBE&&CBE.IEbugfix){showSelects()}boxMove=true;CBE=null}}function showSelects(){var A=document.getElementsByTagName("select");for(i=0;i<A.length;i++){A[i].style.visibility="visible"}}function hideSelects(){var A=document.getElementsByTagName("select");for(i=0;i<A.length;i++){A[i].style.visibility="hidden"}}Calendar=function(D,C,F,A){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=F||null;this.onClose=A||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof D=="number"?D:Calendar._FD;this.showsOtherMonths=false;this.dateStr=C;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined"){Calendar._SDN_len=3}var B=new Array();for(var E=8;E>0;){B[--E]=Calendar._DN[E].substr(0,Calendar._SDN_len)}Calendar._SDN=B;if(typeof Calendar._SMN_len=="undefined"){Calendar._SMN_len=3}B=new Array();for(var E=12;E>0;){B[--E]=Calendar._MN[E].substr(0,Calendar._SMN_len)}Calendar._SMN=B}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(E){var A=0,D=0;var C=/^div$/i.test(E.tagName);if(C&&E.scrollLeft){A=E.scrollLeft}if(C&&E.scrollTop){D=E.scrollTop}var F={x:E.offsetLeft-A,y:E.offsetTop-D};if(E.offsetParent){var B=this.getAbsolutePos(E.offsetParent);F.x+=B.x;F.y+=B.y}return F};Calendar.isRelated=function(C,A){var D=A.relatedTarget;if(!D){var B=A.type;if(B=="mouseover"){D=A.fromElement}else{if(B=="mouseout"){D=A.toElement}}}while(D){if(D==C){return true}D=D.parentNode}return false};Calendar.removeClass=function(E,D){if(!(E&&E.className)){return }var A=E.className.split(" ");var B=new Array();for(var C=A.length;C>0;){if(A[--C]!=D){B[B.length]=A[C]}}E.className=B.join(" ")};Calendar.addClass=function(B,A){Calendar.removeClass(B,A);B.className+=" "+A};Calendar.getElement=function(A){var B=Calendar.is_ie?window.event.srcElement:A.currentTarget;while(B.nodeType!=1||/^div$/i.test(B.tagName)){B=B.parentNode}return B};Calendar.getTargetElement=function(A){var B=Calendar.is_ie?window.event.srcElement:A.target;while(B.nodeType!=1){B=B.parentNode}return B};Calendar.stopEvent=function(A){A||(A=window.event);if(Calendar.is_ie){A.cancelBubble=true;A.returnValue=false}else{A.preventDefault();A.stopPropagation()}return false};Calendar.addEvent=function(A,C,B){if(A.attachEvent){A.attachEvent("on"+C,B)}else{if(A.addEventListener){A.addEventListener(C,B,true)}else{A["on"+C]=B}}};Calendar.removeEvent=function(A,C,B){if(A.detachEvent){A.detachEvent("on"+C,B)}else{if(A.removeEventListener){A.removeEventListener(C,B,true)}else{A["on"+C]=null}}};Calendar.createElement=function(C,B){var A=null;if(document.createElementNS){A=document.createElementNS("http://www.w3.org/1999/xhtml",C)}else{A=document.createElement(C)}if(typeof B!="undefined"){B.appendChild(A)}return A};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true)}}};Calendar.findMonth=function(A){if(typeof A.month!="undefined"){return A}else{if(typeof A.parentNode.month!="undefined"){return A.parentNode}}return null};Calendar.findYear=function(A){if(typeof A.year!="undefined"){return A}else{if(typeof A.parentNode.year!="undefined"){return A.parentNode}}return null};Calendar.showMonthsCombo=function(){var E=Calendar._C;if(!E){return false}var E=E;var F=E.activeDiv;var D=E.monthsCombo;if(E.hilitedMonth){Calendar.removeClass(E.hilitedMonth,"hilite")}if(E.activeMonth){Calendar.removeClass(E.activeMonth,"active")}var C=E.monthsCombo.getElementsByTagName("div")[E.date.getMonth()];Calendar.addClass(C,"active");E.activeMonth=C;var B=D.style;B.display="block";if(F.navtype<0){B.left=F.offsetLeft+"px"}else{var A=D.offsetWidth;if(typeof A=="undefined"){A=50}B.left=(F.offsetLeft+F.offsetWidth-A)+"px"}B.top=(F.offsetTop+F.offsetHeight)+"px"};Calendar.showYearsCombo=function(D){var A=Calendar._C;if(!A){return false}var A=A;var C=A.activeDiv;var F=A.yearsCombo;if(A.hilitedYear){Calendar.removeClass(A.hilitedYear,"hilite")}if(A.activeYear){Calendar.removeClass(A.activeYear,"active")}A.activeYear=null;var B=A.date.getFullYear()+(D?1:-1);var I=F.firstChild;var H=false;for(var E=12;E>0;--E){if(B>=A.minYear&&B<=A.maxYear){I.innerHTML=B;I.year=B;I.style.display="block";H=true}else{I.style.display="none"}I=I.nextSibling;B+=D?A.yearStep:-A.yearStep}if(H){var J=F.style;J.display="block";if(C.navtype<0){J.left=C.offsetLeft+"px"}else{var G=F.offsetWidth;if(typeof G=="undefined"){G=50}J.left=(C.offsetLeft+C.offsetWidth-G)+"px"}J.top=(C.offsetTop+C.offsetHeight)+"px"}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false}if(cal.timeout){clearTimeout(cal.timeout)}var el=cal.activeDiv;if(!el){return false}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev)}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev)}};Calendar.tableMouseOver=function(M){var A=Calendar._C;if(!A){return }var C=A.activeDiv;var I=Calendar.getTargetElement(M);if(I==C||I.parentNode==C){Calendar.addClass(C,"hilite active");Calendar.addClass(C.parentNode,"rowhilite")}else{if(typeof C.navtype=="undefined"||(C.navtype!=50&&(C.navtype==0||Math.abs(C.navtype)>2))){Calendar.removeClass(C,"active")}Calendar.removeClass(C,"hilite");Calendar.removeClass(C.parentNode,"rowhilite")}M||(M=window.event);if(C.navtype==50&&I!=C){var L=Calendar.getAbsolutePos(C);var O=C.offsetWidth;var N=M.clientX;var P;var K=true;if(N>L.x+O){P=N-L.x-O;K=false}else{P=L.x-N}if(P<0){P=0}var F=C._range;var H=C._current;var G=Math.floor(P/10)%F.length;for(var E=F.length;--E>=0;){if(F[E]==H){break}}while(G-->0){if(K){if(--E<0){E=F.length-1}}else{if(++E>=F.length){E=0}}}var B=F[E];C.innerHTML=B;A.onUpdateTime()}var D=Calendar.findMonth(I);if(D){if(D.month!=A.date.getMonth()){if(A.hilitedMonth){Calendar.removeClass(A.hilitedMonth,"hilite")}Calendar.addClass(D,"hilite");A.hilitedMonth=D}else{if(A.hilitedMonth){Calendar.removeClass(A.hilitedMonth,"hilite")}}}else{if(A.hilitedMonth){Calendar.removeClass(A.hilitedMonth,"hilite")}var J=Calendar.findYear(I);if(J){if(J.year!=A.date.getFullYear()){if(A.hilitedYear){Calendar.removeClass(A.hilitedYear,"hilite")}Calendar.addClass(J,"hilite");A.hilitedYear=J}else{if(A.hilitedYear){Calendar.removeClass(A.hilitedYear,"hilite")}}}else{if(A.hilitedYear){Calendar.removeClass(A.hilitedYear,"hilite")}}}return Calendar.stopEvent(M)};Calendar.tableMouseDown=function(A){if(Calendar.getTargetElement(A)==Calendar.getElement(A)){return Calendar.stopEvent(A)}};Calendar.calDragIt=function(B){var C=Calendar._C;if(!(C&&C.dragging)){return false}var E;var D;if(Calendar.is_ie){D=window.event.clientY+document.body.scrollTop;E=window.event.clientX+document.body.scrollLeft}else{E=B.pageX;D=B.pageY}C.hideShowCovered();var A=C.element.style;A.left=(E-C.xOffs)+"px";A.top=(D-C.yOffs)+"px";return Calendar.stopEvent(B)};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev)}cal.hideShowCovered()};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300){with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver)}else{addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver)}addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp)}}else{if(cal.isPopup){cal._dragStart(ev)}}if(el.navtype==-1||el.navtype==1){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout("Calendar.showMonthsCombo()",250)}else{if(el.navtype==-2||el.navtype==2){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250)}else{cal.timeout=null}}return Calendar.stopEvent(ev)};Calendar.dayMouseDblClick=function(A){Calendar.cellClick(Calendar.getElement(A),A||window.event);if(Calendar.is_ie){document.selection.empty()}};Calendar.dayMouseOver=function(B){var A=Calendar.getElement(B);if(Calendar.isRelated(A,B)||Calendar._C||A.disabled){return false}if(A.ttip){if(A.ttip.substr(0,1)=="_"){A.ttip=A.caldate.print(A.calendar.ttDateFormat)+A.ttip.substr(1)}A.calendar.tooltips.innerHTML=A.ttip}if(A.navtype!=300){Calendar.addClass(A,"hilite");if(A.caldate){Calendar.addClass(A.parentNode,"rowhilite")}}return Calendar.stopEvent(B)};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite")}if(el.calendar){el.calendar.tooltips.innerHTML=_TT["SEL_DATE"]}return stopEvent(ev)}};Calendar.cellClick=function(E,N){var C=E.calendar;var H=false;var K=false;var F=null;if(typeof E.navtype=="undefined"){if(C.currentDateEl){Calendar.removeClass(C.currentDateEl,"selected");Calendar.addClass(E,"selected");H=(C.currentDateEl==E);if(!H){C.currentDateEl=E}}C.date.setDateOnly(E.caldate);F=C.date;var B=!(C.dateClicked=!E.otherMonth);if(!B&&!C.currentDateEl){C._toggleMultipleDate(new Date(F))}else{K=!E.disabled}if(B){C._init(C.firstDayOfWeek,F)}}else{if(E.navtype==200){Calendar.removeClass(E,"hilite");C.callCloseHandler();return }F=new Date(C.date);if(E.navtype==0){F.setDateOnly(new Date())}C.dateClicked=false;var M=F.getFullYear();var G=F.getMonth();function A(Q){var R=F.getDate();var P=F.getMonthDays(Q);if(R>P){F.setDate(P)}F.setMonth(Q)}switch(E.navtype){case 400:Calendar.removeClass(E,"hilite");var O=Calendar._TT["ABOUT"];if(typeof O!="undefined"){O+=C.showsTime?Calendar._TT["ABOUT_TIME"]:""}else{O='Help and about box text is not translated into this language.\nIf you know this language and you feel generous please update\nthe corresponding file in "lang" subdir to match calendar-en.js\nand send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\nThank you!\nhttp://dynarch.com/mishoo/calendar.epl\n'}alert(O);return ;case -2:if(M>C.minYear){F.setFullYear(M-1)}break;case -1:if(G>0){A(G-1)}else{if(M-->C.minYear){F.setFullYear(M);A(11)}}break;case 1:if(G<11){A(G+1)}else{if(M<C.maxYear){F.setFullYear(M+1);A(0)}}break;case 2:if(M<C.maxYear){F.setFullYear(M+1)}break;case 100:C.setFirstDayOfWeek(E.fdow);return ;case 50:var J=E._range;var L=E.innerHTML;for(var I=J.length;--I>=0;){if(J[I]==L){break}}if(N&&N.shiftKey){if(--I<0){I=J.length-1}}else{if(++I>=J.length){I=0}}var D=J[I];E.innerHTML=D;C.onUpdateTime();return ;case 0:if((typeof C.getDateStatus=="function")&&C.getDateStatus(F,F.getFullYear(),F.getMonth(),F.getDate())){return false}break}if(!F.equalsTo(C.date)){C.setDate(F);K=true}else{if(E.navtype==0){K=H=true}}}if(K){N&&C.callHandler()}if(H){Calendar.removeClass(E,"hilite");N&&C.callCloseHandler()}};Calendar.prototype.create=function(L){var K=null;if(!L){K=document.getElementsByTagName("body")[0];this.isPopup=true}else{K=L;this.isPopup=false}this.date=this.dateStr?new Date(this.dateStr):new Date();var O=Calendar.createElement("table");this.table=O;O.cellSpacing=0;O.cellPadding=0;O.calendar=this;Calendar.addEvent(O,"mousedown",Calendar.tableMouseDown);var A=Calendar.createElement("div");this.element=A;A.className="calendar";if(this.isPopup){A.style.position="absolute";A.style.display="none"}A.appendChild(O);var I=Calendar.createElement("thead",O);var M=null;var P=null;var B=this;var E=function(S,R,Q){M=Calendar.createElement("td",P);M.colSpan=R;M.className="button";if(Q!=0&&Math.abs(Q)<=2){M.className+=" nav"}Calendar._add_evs(M);M.calendar=B;M.navtype=Q;M.innerHTML="<div unselectable='on'>"+S+"</div>";return M};P=Calendar.createElement("tr",I);var C=6;(this.isPopup)&&--C;(this.weekNumbers)&&++C;E("?",1,400).ttip=Calendar._TT["INFO"];this.title=E("",C,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";E("&#x00d7;",1,200).ttip=Calendar._TT["CLOSE"]}P=Calendar.createElement("tr",I);P.className="headrow";this._nav_py=E("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=E("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=E(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=E("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=E("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];P=Calendar.createElement("tr",I);P.className="daynames";if(this.weekNumbers){M=Calendar.createElement("td",P);M.className="name wn";M.innerHTML=Calendar._TT["WK"]}for(var H=7;H>0;--H){M=Calendar.createElement("td",P);if(!H){M.navtype=100;M.calendar=this;Calendar._add_evs(M)}}this.firstdayname=(this.weekNumbers)?P.firstChild.nextSibling:P.firstChild;this._displayWeekdays();var G=Calendar.createElement("tbody",O);this.tbody=G;for(H=6;H>0;--H){P=Calendar.createElement("tr",G);if(this.weekNumbers){M=Calendar.createElement("td",P)}for(var F=7;F>0;--F){M=Calendar.createElement("td",P);M.calendar=this;Calendar._add_evs(M)}}if(this.showsTime){P=Calendar.createElement("tr",G);P.className="time";M=Calendar.createElement("td",P);M.className="time";M.colSpan=2;M.innerHTML=Calendar._TT["TIME"]||"&nbsp;";M=Calendar.createElement("td",P);M.className="time";M.colSpan=this.weekNumbers?4:3;(function(){function T(c,e,d,f){var a=Calendar.createElement("span",M);a.className=c;a.innerHTML=e;a.calendar=B;a.ttip=Calendar._TT["TIME_PART"];a.navtype=50;a._range=[];if(typeof d!="number"){a._range=d}else{for(var b=d;b<=f;++b){var Z;if(b<10&&f>=10){Z="0"+b}else{Z=""+b}a._range[a._range.length]=Z}}Calendar._add_evs(a);return a}var X=B.date.getHours();var Q=B.date.getMinutes();var Y=!B.time24;var R=(X>12);if(Y&&R){X-=12}var V=T("hour",X,Y?1:0,Y?12:23);var U=Calendar.createElement("span",M);U.innerHTML=":";U.className="colon";var S=T("minute",Q,0,59);var W=null;M=Calendar.createElement("td",P);M.className="time";M.colSpan=2;if(Y){W=T("ampm",R?"pm":"am",["am","pm"])}else{M.innerHTML="&nbsp;"}B.onSetTime=function(){var a,Z=this.date.getHours(),b=this.date.getMinutes();if(Y){a=(Z>=12);if(a){Z-=12}if(Z==0){Z=12}W.innerHTML=a?"pm":"am"}V.innerHTML=(Z<10)?("0"+Z):Z;S.innerHTML=(b<10)?("0"+b):b};B.onUpdateTime=function(){var a=this.date;var b=parseInt(V.innerHTML,10);if(Y){if(/pm/i.test(W.innerHTML)&&b<12){b+=12}else{if(/am/i.test(W.innerHTML)&&b==12){b=0}}}var c=a.getDate();var Z=a.getMonth();var e=a.getFullYear();a.setHours(b);a.setMinutes(parseInt(S.innerHTML,10));a.setFullYear(e);a.setMonth(Z);a.setDate(c);this.dateClicked=false;this.callHandler()}})()}else{this.onSetTime=this.onUpdateTime=function(){}}var J=Calendar.createElement("tfoot",O);P=Calendar.createElement("tr",J);P.className="footrow";M=E(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);M.className="ttip";if(this.isPopup){M.ttip=Calendar._TT["DRAG_TO_MOVE"];M.style.cursor="move"}this.tooltips=M;A=Calendar.createElement("div",this.element);this.monthsCombo=A;A.className="combo";for(H=0;H<Calendar._MN.length;++H){var D=Calendar.createElement("div");D.className=Calendar.is_ie?"label-IEfix":"label";D.month=H;D.innerHTML=Calendar._SMN[H];A.appendChild(D)}A=Calendar.createElement("div",this.element);this.yearsCombo=A;A.className="combo";for(H=12;H>0;--H){var N=Calendar.createElement("div");N.className=Calendar.is_ie?"label-IEfix":"label";A.appendChild(N)}this._init(this.firstDayOfWeek,this.date);K.appendChild(this.element)};Calendar._keyEvent=function(L){var A=window._dynarch_popupCalendar;if(!A||A.multiple){return false}(Calendar.is_ie)&&(L=window.event);var I=(Calendar.is_ie||L.type=="keypress"),M=L.keyCode;if(L.ctrlKey){switch(M){case 37:I&&Calendar.cellClick(A._nav_pm);break;case 38:I&&Calendar.cellClick(A._nav_py);break;case 39:I&&Calendar.cellClick(A._nav_nm);break;case 40:I&&Calendar.cellClick(A._nav_ny);break;default:return false}}else{switch(M){case 32:Calendar.cellClick(A._nav_now);break;case 27:I&&A.callCloseHandler();break;case 37:case 38:case 39:case 40:if(I){var E,N,J,G,C,D;E=M==37||M==38;D=(M==37||M==39)?1:7;function B(){C=A.currentDateEl;var K=C.pos;N=K&15;J=K>>4;G=A.ar_days[J][N]}B();function F(){var K=new Date(A.date);K.setDate(K.getDate()-D);A.setDate(K)}function H(){var K=new Date(A.date);K.setDate(K.getDate()+D);A.setDate(K)}while(1){switch(M){case 37:if(--N>=0){G=A.ar_days[J][N]}else{N=6;M=38;continue}break;case 38:if(--J>=0){G=A.ar_days[J][N]}else{F();B()}break;case 39:if(++N<7){G=A.ar_days[J][N]}else{N=0;M=40;continue}break;case 40:if(++J<A.ar_days.length){G=A.ar_days[J][N]}else{H();B()}break}break}if(G){if(!G.disabled){Calendar.cellClick(G)}else{if(E){F()}else{H()}}}}break;case 13:if(I){Calendar.cellClick(A.currentDateEl,L)}break;default:return false}}return Calendar.stopEvent(L)};Calendar.prototype._init=function(L,V){var U=new Date(),P=U.getFullYear(),X=U.getMonth(),B=U.getDate();this.table.style.visibility="hidden";var H=V.getFullYear();if(H<this.minYear){H=this.minYear;V.setFullYear(H)}else{if(H>this.maxYear){H=this.maxYear;V.setFullYear(H)}}this.firstDayOfWeek=L;this.date=new Date(V);var W=V.getMonth();var Z=V.getDate();var Y=V.getMonthDays();V.setDate(1);var Q=(V.getDay()-this.firstDayOfWeek)%7;if(Q<0){Q+=7}V.setDate(-Q);V.setDate(V.getDate()+1);var E=this.tbody.firstChild;var J=Calendar._SMN[W];var N=this.ar_days=new Array();var M=Calendar._TT["WEEKEND"];var D=this.multiple?(this.datesCells={}):null;for(var S=0;S<6;++S,E=E.nextSibling){var A=E.firstChild;if(this.weekNumbers){A.className="day wn";A.innerHTML=V.getWeekNumber();A=A.nextSibling}E.className="daysrow";var T=false,F,C=N[S]=[];for(var R=0;R<7;++R,A=A.nextSibling,V.setDate(F+1)){F=V.getDate();var G=V.getDay();A.className="day";A.pos=S<<4|R;C[R]=A;var K=(V.getMonth()==W);if(!K){if(this.showsOtherMonths){A.className+=" othermonth";A.otherMonth=true}else{A.className="emptycell";A.innerHTML="&nbsp;";A.disabled=true;continue}}else{A.otherMonth=false;T=true}A.disabled=false;A.innerHTML=this.getDateText?this.getDateText(V,F):F;if(D){D[V.print("%Y%m%d")]=A}if(this.getDateStatus){var O=this.getDateStatus(V,H,W,F);if(this.getDateToolTip){var I=this.getDateToolTip(V,H,W,F);if(I){A.title=I}}if(O===true){A.className+=" disabled";A.disabled=true}else{if(/disabled/i.test(O)){A.disabled=true}A.className+=" "+O}}if(!A.disabled){A.caldate=new Date(V);A.ttip="_";if(!this.multiple&&K&&F==Z&&this.hiliteToday){A.className+=" selected";this.currentDateEl=A}if(V.getFullYear()==P&&V.getMonth()==X&&F==B){A.className+=" today";A.ttip+=Calendar._TT["PART_TODAY"]}if(M.indexOf(G.toString())!=-1){A.className+=A.otherMonth?" oweekend":" weekend"}}}if(!(T||this.showsOtherMonths)){E.className="emptyrow"}}this.title.innerHTML=Calendar._MN[W]+", "+H;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates()};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var B in this.multiple){var A=this.datesCells[B];var C=this.multiple[B];if(!C){continue}if(A){A.className+=" selected"}}}};Calendar.prototype._toggleMultipleDate=function(B){if(this.multiple){var C=B.print("%Y%m%d");var A=this.datesCells[C];if(A){var D=this.multiple[C];if(!D){Calendar.addClass(A,"selected");this.multiple[C]=B}else{Calendar.removeClass(A,"selected");delete this.multiple[C]}}}};Calendar.prototype.setDateToolTipHandler=function(A){this.getDateToolTip=A};Calendar.prototype.setDate=function(A){if(!A.equalsTo(this.date)){this._init(this.firstDayOfWeek,A)}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date)};Calendar.prototype.setFirstDayOfWeek=function(A){this._init(A,this.date);this._displayWeekdays()};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(A){this.getDateStatus=A};Calendar.prototype.setRange=function(A,B){this.minYear=A;this.maxYear=B};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat))}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this)}this.hideShowCovered()};Calendar.prototype.destroy=function(){var A=this.element.parentNode;A.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null};Calendar.prototype.reparent=function(B){var A=this.element;A.parentNode.removeChild(A);B.appendChild(A)};Calendar._checkCalendar=function(B){var C=window._dynarch_popupCalendar;if(!C){return false}var A=Calendar.is_ie?Calendar.getElement(B):Calendar.getTargetElement(B);for(;A!=null&&A!=C.element;A=A.parentNode){}if(A==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(B)}};Calendar.prototype.show=function(){var E=this.table.getElementsByTagName("tr");for(var D=E.length;D>0;){var F=E[--D];Calendar.removeClass(F,"rowhilite");var C=F.getElementsByTagName("td");for(var B=C.length;B>0;){var A=C[--B];Calendar.removeClass(A,"hilite");Calendar.removeClass(A,"active")}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar)}this.hideShowCovered()};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar)}this.element.style.display="none";this.hidden=true;this.hideShowCovered()};Calendar.prototype.showAt=function(A,C){var B=this.element.style;B.left=A+"px";B.top=C+"px";this.show()};Calendar.prototype.showAtElement=function(C,D){var A=this;var E=Calendar.getAbsolutePos(C);if(!D||typeof D!="string"){this.showAt(E.x,E.y+C.offsetHeight);return true}function B(I){if(I.x<0){I.x=0}if(I.y<0){I.y=0}var J=document.createElement("div");var H=J.style;H.position="absolute";H.right=H.bottom=H.width=H.height="0px";document.body.appendChild(J);var G=Calendar.getAbsolutePos(J);document.body.removeChild(J);if(Calendar.is_ie){G.y+=document.body.scrollTop;G.x+=document.body.scrollLeft}else{G.y+=window.scrollY;G.x+=window.scrollX}var F=I.x+I.width-G.x;if(F>0){I.x-=F}F=I.y+I.height-G.y;if(F>0){I.y-=F}}this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var F=A.element.offsetWidth;var H=A.element.offsetHeight;A.element.style.display="none";var G=D.substr(0,1);var I="l";if(D.length>1){I=D.substr(1,1)}switch(G){case"T":E.y-=H;break;case"B":E.y+=C.offsetHeight;break;case"C":E.y+=(C.offsetHeight-H)/2;break;case"t":E.y+=C.offsetHeight-H;break;case"b":break}switch(I){case"L":E.x-=F;break;case"R":E.x+=C.offsetWidth;break;case"C":E.x+=(C.offsetWidth-F)/2;break;case"l":E.x+=C.offsetWidth-F;break;case"r":break}E.width=F;E.height=H+40;A.monthsCombo.style.display="none";B(E);A.showAt(E.x,E.y)};if(Calendar.is_khtml){setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10)}else{Calendar.continuation_for_the_fucking_khtml_browser()}};Calendar.prototype.setDateFormat=function(A){this.dateFormat=A};Calendar.prototype.setTtDateFormat=function(A){this.ttDateFormat=A};Calendar.prototype.parseDate=function(B,A){if(!A){A=this.dateFormat}this.setDate(Date.parseDate(B,A))};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera){return }function B(R){var Q=R.style.visibility;if(!Q){if(document.defaultView&&typeof (document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml){Q=document.defaultView.getComputedStyle(R,"").getPropertyValue("visibility")}else{Q=""}}else{if(R.currentStyle){Q=R.currentStyle.visibility}else{Q=""}}}return Q}var P=new Array("applet","iframe","select");var C=this.element;var A=Calendar.getAbsolutePos(C);var F=A.x;var D=C.offsetWidth+F;var O=A.y;var N=C.offsetHeight+O;for(var H=P.length;H>0;){var G=document.getElementsByTagName(P[--H]);var E=null;for(var J=G.length;J>0;){E=G[--J];A=Calendar.getAbsolutePos(E);var M=A.x;var L=E.offsetWidth+M;var K=A.y;var I=E.offsetHeight+K;if(this.hidden||(M>D)||(L<F)||(K>N)||(I<O)){if(!E.__msh_save_visibility){E.__msh_save_visibility=B(E)}E.style.visibility=E.__msh_save_visibility}else{if(!E.__msh_save_visibility){E.__msh_save_visibility=B(E)}E.style.visibility="hidden"}}}};Calendar.prototype._displayWeekdays=function(){var B=this.firstDayOfWeek;var A=this.firstdayname;var D=Calendar._TT["WEEKEND"];for(var C=0;C<7;++C){A.className="day name";var E=(C+B)%7;if(C){A.ttip=Calendar._TT["DAY_FIRST"].replace("%s",Calendar._DN[E]);A.navtype=100;A.calendar=this;A.fdow=E;Calendar._add_evs(A)}if(D.indexOf(E.toString())!=-1){Calendar.addClass(A,"weekend")}A.innerHTML=Calendar._SDN[(C+B)%7];A=A.nextSibling}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none"};Calendar.prototype._dragStart=function(ev){if(this.dragging){return }this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd)}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(G,A){var H=new Date();var I=0;var B=-1;var F=0;var K=G.split(/\W+/);var J=A.match(/%./g);var E=0,D=0;var L=0;var C=0;for(E=0;E<K.length;++E){if(!K[E]){continue}switch(J[E]){case"%d":case"%e":F=parseInt(K[E],10);break;case"%m":B=parseInt(K[E],10)-1;break;case"%Y":case"%y":I=parseInt(K[E],10);(I<100)&&(I+=(I>29)?1900:2000);break;case"%b":case"%B":for(D=0;D<12;++D){if(Calendar._MN[D].substr(0,K[E].length).toLowerCase()==K[E].toLowerCase()){B=D;break}}break;case"%H":case"%I":case"%k":case"%l":L=parseInt(K[E],10);break;case"%P":case"%p":if(/pm/i.test(K[E])&&L<12){L+=12}else{if(/am/i.test(K[E])&&L>=12){L-=12}}break;case"%M":C=parseInt(K[E],10);break}}if(isNaN(I)){I=H.getFullYear()}if(isNaN(B)){B=H.getMonth()}if(isNaN(F)){F=H.getDate()}if(isNaN(L)){L=H.getHours()}if(isNaN(C)){C=H.getMinutes()}if(I!=0&&B!=-1&&F!=0){return new Date(I,B,F,L,C,0)}I=0;B=-1;F=0;for(E=0;E<K.length;++E){if(K[E].search(/[a-zA-Z]+/)!=-1){var M=-1;for(D=0;D<12;++D){if(Calendar._MN[D].substr(0,K[E].length).toLowerCase()==K[E].toLowerCase()){M=D;break}}if(M!=-1){if(B!=-1){F=B+1}B=M}}else{if(parseInt(K[E],10)<=12&&B==-1){B=K[E]-1}else{if(parseInt(K[E],10)>31&&I==0){I=parseInt(K[E],10);(I<100)&&(I+=(I>29)?1900:2000)}else{if(F==0){F=K[E]}}}}}if(I==0){I=H.getFullYear()}if(B!=-1&&F!=0){return new Date(I,B,F,L,C,0)}return H};Date.prototype.getMonthDays=function(B){var A=this.getFullYear();if(typeof B=="undefined"){B=this.getMonth()}if(((0==(A%4))&&((0!=(A%100))||(0==(A%400))))&&B==1){return 29}else{return Date._MD[B]}};Date.prototype.getDayOfYear=function(){var A=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var C=new Date(this.getFullYear(),0,0,0,0,0);var B=A-C;return Math.floor(B/Date.DAY)};Date.prototype.getWeekNumber=function(){var C=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var B=C.getDay();C.setDate(C.getDate()-(B+6)%7+3);var A=C.valueOf();C.setMonth(0);C.setDate(4);return Math.round((A-C.valueOf())/(7*86400000))+1};Date.prototype.equalsTo=function(A){return((this.getFullYear()==A.getFullYear())&&(this.getMonth()==A.getMonth())&&(this.getDate()==A.getDate())&&(this.getHours()==A.getHours())&&(this.getMinutes()==A.getMinutes()))};Date.prototype.setDateOnly=function(A){var B=new Date(A);this.setDate(1);this.setFullYear(B.getFullYear());this.setMonth(B.getMonth());this.setDate(B.getDate())};Date.prototype.print=function(I){var A=this.getMonth();var H=this.getDate();var J=this.getFullYear();var L=this.getWeekNumber();var M=this.getDay();var Q={};var N=this.getHours();var B=(N>=12);var F=(B)?(N-12):N;var P=this.getDayOfYear();if(F==0){F=12}var C=this.getMinutes();var G=this.getSeconds();Q["%a"]=Calendar._SDN[M];Q["%A"]=Calendar._DN[M];Q["%b"]=Calendar._SMN[A];Q["%B"]=Calendar._MN[A];Q["%C"]=1+Math.floor(J/100);Q["%d"]=(H<10)?("0"+H):H;Q["%e"]=H;Q["%H"]=(N<10)?("0"+N):N;Q["%I"]=(F<10)?("0"+F):F;Q["%j"]=(P<100)?((P<10)?("00"+P):("0"+P)):P;Q["%k"]=N;Q["%l"]=F;Q["%m"]=(A<9)?("0"+(1+A)):(1+A);Q["%M"]=(C<10)?("0"+C):C;Q["%n"]="\n";Q["%p"]=B?"PM":"AM";Q["%P"]=B?"pm":"am";Q["%s"]=Math.floor(this.getTime()/1000);Q["%S"]=(G<10)?("0"+G):G;Q["%t"]="\t";Q["%U"]=Q["%W"]=Q["%V"]=(L<10)?("0"+L):L;Q["%u"]=M+1;Q["%w"]=M;Q["%y"]=(""+J).substr(2,2);Q["%Y"]=J;Q["%%"]="%";var O=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml){return I.replace(O,function(R){return Q[R]||R})}var K=I.match(O);for(var E=0;E<K.length;E++){var D=Q[K[E]];if(D){O=new RegExp(K[E],"g");I=I.replace(O,D)}}return I};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(B){var A=new Date(this);A.__msh_oldSetFullYear(B);if(A.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(B)};window._dynarch_popupCalendar=null;Calendar.setup=function(G){function F(H,I){if(typeof G[H]=="undefined"){G[H]=I}}F("inputField",null);F("displayArea",null);F("button",null);F("eventName","click");F("ifFormat","%Y/%m/%d");F("daFormat","%Y/%m/%d");F("singleClick",true);F("disableFunc",null);F("dateStatusFunc",G["disableFunc"]);F("dateText",null);F("firstDay",null);F("align","Br");F("range",[1900,2999]);F("weekNumbers",true);F("flat",null);F("flatCallback",null);F("onSelect",null);F("onClose",null);F("onUpdate",null);F("date",null);F("showsTime",false);F("timeFormat","24");F("electric",true);F("step",2);F("position",null);F("cache",false);F("showOthers",false);F("multiple",null);var C=["inputField","displayArea","button"];for(var B in C){if(typeof G[C[B]]=="string"){G[C[B]]=document.getElementById(G[C[B]])}}if(!(G.flat||G.multiple||G.inputField||G.displayArea||G.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false}function A(I){var H=I.params;var J=(I.dateClicked||H.electric);if(J&&H.inputField){H.inputField.value=I.date.print(H.ifFormat);if(typeof H.inputField.onchange=="function"){H.inputField.onchange()}}if(J&&H.displayArea){H.displayArea.innerHTML=I.date.print(H.daFormat)}if(J&&typeof H.onUpdate=="function"){H.onUpdate(I)}if(J&&H.flat){if(typeof H.flatCallback=="function"){H.flatCallback(I)}}if(J&&H.singleClick&&I.dateClicked){I.callCloseHandler()}}if(G.flat!=null){if(typeof G.flat=="string"){G.flat=document.getElementById(G.flat)}if(!G.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false}var E=new Calendar(G.firstDay,G.date,G.onSelect||A);E.showsOtherMonths=G.showOthers;E.showsTime=G.showsTime;E.time24=(G.timeFormat=="24");E.params=G;E.weekNumbers=G.weekNumbers;E.setRange(G.range[0],G.range[1]);E.setDateStatusHandler(G.dateStatusFunc);E.getDateText=G.dateText;if(G.ifFormat){E.setDateFormat(G.ifFormat)}if(G.inputField&&typeof G.inputField.value=="string"){E.parseDate(G.inputField.value)}E.create(G.flat);E.show();return false}var D=G.button||G.displayArea||G.inputField;D["on"+G.eventName]=function(){var H=G.inputField||G.displayArea;var J=G.inputField?G.ifFormat:G.daFormat;var N=false;var L=window.calendar;if(H){G.date=Date.parseDate(H.value||H.innerHTML,J)}if(!(L&&G.cache)){window.calendar=L=new Calendar(G.firstDay,G.date,G.onSelect||A,G.onClose||function(O){O.hide()});L.showsTime=G.showsTime;L.time24=(G.timeFormat=="24");L.weekNumbers=G.weekNumbers;N=true}else{if(G.date){L.setDate(G.date)}L.hide()}if(G.multiple){L.multiple={};for(var I=G.multiple.length;--I>=0;){var M=G.multiple[I];var K=M.print("%Y%m%d");L.multiple[K]=M}}L.showsOtherMonths=G.showOthers;L.yearStep=G.step;L.setRange(G.range[0],G.range[1]);L.params=G;L.setDateStatusHandler(G.dateStatusFunc);L.getDateText=G.dateText;L.setDateFormat(J);if(N){L.create()}L.refresh();if(!G.position){L.showAtElement(G.button||G.displayArea||G.inputField,G.align)}else{L.showAt(G.position[0],G.position[1])}return false};return E};Calendar._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Calendar._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");Calendar._FD=0;Calendar._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December");Calendar._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Calendar._TT={};Calendar._TT["INFO"]="About the calendar";Calendar._TT["ABOUT"]="DHTML Date/Time Selector\n(c) dynarch.com 2002-2005 / Author: Mihai Bazon\nFor latest version visit: http://www.dynarch.com/projects/calendar/\nDistributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details.\n\nDate selection:\n- Use the \xab, \xbb buttons to select year\n- Use the "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+" buttons to select month\n- Hold mouse button on any of the above buttons for faster selection.";Calendar._TT["ABOUT_TIME"]="\n\nTime selection:\n- Click on any of the time parts to increase it\n- or Shift-click to decrease it\n- or click and drag for faster selection.";Calendar._TT["PREV_YEAR"]="Prev. year (hold for menu)";Calendar._TT["PREV_MONTH"]="Prev. month (hold for menu)";Calendar._TT["GO_TODAY"]="Go Today";Calendar._TT["NEXT_MONTH"]="Next month (hold for menu)";Calendar._TT["NEXT_YEAR"]="Next year (hold for menu)";Calendar._TT["SEL_DATE"]="Select date";Calendar._TT["DRAG_TO_MOVE"]="Drag to move";Calendar._TT["PART_TODAY"]=" (today)";Calendar._TT["DAY_FIRST"]="Display %s first";Calendar._TT["WEEKEND"]="0,6";Calendar._TT["CLOSE"]="Close";Calendar._TT["TODAY"]="Today";Calendar._TT["TIME_PART"]="(Shift-)Click or drag to change value";Calendar._TT["DEF_DATE_FORMAT"]="%Y-%m-%d";Calendar._TT["TT_DATE_FORMAT"]="%a, %b %e";Calendar._TT["WK"]="wk";Calendar._TT["TIME"]="Time:";var errorInfoResourceBundle;function handleOrderError(B,D){var F=dojo.byId("resultTable");if(F){B.removeChild(F)}var E=dojo.byId("orderExceptionMsg");if(E){B.removeChild(E)}var C=document.createElement("h4");C.setAttribute("class","exceptionMsg");C.setAttribute("id","orderExceptionMsg");dojo.requireLocalization("i18n","errorinfo");errorInfoResourceBundle=dojo.i18n.getLocalization("i18n","errorinfo");var A=document.createTextNode(errorInfoResourceBundle[D.message]);B.appendChild(C);C.appendChild(A);return }function getRow(A){return 1+A}formatDecimal=function(A){return isNaN(A)?"...":parseFloat(A).toFixed(2)};var gridWidget;function renderOrderResult(C,A,F){var B=dojo.byId("resultArea");if(F){handleOrderError(B,F);return }orderData={identifier:"ordNum","items":"test"};orderData.items=A.list;var H=new dojo.data.ItemFileReadStore({data:orderData});var E=new dojox.grid.data.DojoData(null,H,{jsId:"Model",rowsPerPage:20,query:{ordNum:"*"},clientSort:"true"});resourceBundle=dojo.i18n.getLocalization("i18n","orderinquiry");var D=[{type:"dojox.GridRowView",width:"20px"},{cells:[[{name:"Line",get:getRow,width:"50px"}]],noscroll:true},{cells:[[{name:resourceBundle.title_order,field:"ordNum"},{name:resourceBundle.title_shipDate,width:"70px",field:"shipDate"},{name:resourceBundle.title_po,field:"poNum"},{name:resourceBundle.title_total,field:"total",formatter:formatDecimal,styles:"text-align: right;"},{name:resourceBundle.title_job,width:"50px",field:"job",styles:"text-align: center;"}]]}];var G=[{type:"dojox.GridRowView",width:"20px"},{cells:[[{name:"Line",get:getRow,width:"25px"}]],noscroll:true},{cells:[[{name:resourceBundle.title_invoiceNum,field:"invoiceNum"},{name:resourceBundle.title_order,field:"ordNum"},{name:resourceBundle.title_shipDate,width:"70px",field:"shipDate"},{name:resourceBundle.title_po,field:"poNum"},{name:resourceBundle.title_total,field:"total",formatter:formatDecimal,styles:"text-align: right;"},{name:resourceBundle.title_job,width:"40px",field:"job",styles:"text-align: center;"}]]}];gridWidget.setModel(E);if(C=="open"){gridWidget.setStructure(D)}else{if(C=="all"){gridWidget.setStructure(G)}}gridWidget.render()}dojo.addOnLoad(afterload);function afterload(){initPage();dojo.cookie("home-banner.cookie","1");dojo.subscribe("loadTreeFromJSON","loadTreeFromJSON");dojo.subscribe("searchCatalog","_handleSearchCatalog");dojo.subscribe("searchCatalogByVender","_handleSearchCatalogByVender");dojo.subscribe("searchManufacturers","_handleSearchManufacturers");dojo.subscribe("displayCart","_handleDisplayCart");dojo.subscribe("updateFiltersByUPCorSKU","_handleSearchCatalog");getAuthenticationStatus();initModalDialog()}function bannerRotation(){var A=dojo.cookie("home-banner.cookie");if(A=="1"){dojo.byId("home_banner_image").src="images/banner_2.jpg";dojo.cookie("home-banner.cookie","2")}else{if(A=="2"){dojo.byId("home_banner_image").src="images/banner_3.jpg";dojo.cookie("home-banner.cookie","3")}else{if(A=="3"){dojo.byId("home_banner_image").src="images/banner_4.jpg";dojo.cookie("home-banner.cookie","4")}else{if(A=="4"){dojo.byId("home_banner_image").src="images/banner_1.jpg";dojo.cookie("home-banner.cookie","1")}else{dojo.byId("home_banner_image").src="images/banner_1.jpg";dojo.cookie("home-banner.cookie","1")}}}}}function initPage(){if(window.name=="aboutus"){create("aboutus")}else{if(window.name=="retail"){createAboutUs("retail")}else{if(window.name=="regions"){createAboutUs("regions")}}}window.name=""}function initModalDialog(C){dojo.require("ibm.widget.StockModalDialog");dojo.require("dijit.Dialog");dojo.require("dijit.layout.ContentPane");dojo.require("dijit.form.ValidationTextBox");dojo.require("ibm.widget.InvoiceOrderDetails");dojo.require("ibm.widget.RetailPurchaseHistory");dojo.require("ibm.widget.RetailMarkupVender_Sub");var A=dijit.byId("modalDialogWidget");if(A){A.destroyRecursive()}A=new dijit.layout.ContentPane({id:"modalDialogWidget",href:"pane-modaldialog.html",loadingMessage:""},dojo.doc.createElement("div"));A.startup();var B=dojo.byId("modaldialog");B.innerHTML="";B.appendChild(A.domNode)}var isLogin="N";var loginCustName="none";var loginCustNumber="none";function getAuthenticationStatus(){var B=this;var C="/fivestargroup/servlet/AccountServlet?action=account&isAuth="+dojo.byId("isAuthenticated").innerHTML;document.body.style.cursor="wait";var A=dojo.rawXhrPost({url:C,timeout:12000,headers:{"Content-Type":"text/xml"},handleAs:"xml",postData:"<authentication>account</authentication>",load:function(E,D){document.body.style.cursor="default";B._loadItemsFromXMLForAuth(E);return E},error:function(E,D){document.body.style.cursor="default";console.log("***AJAX call error status: ",D.xhr.status);if(D.xhr.status==403){dijit.byId("timeoutDialog").show()}return"error"}})}function _loadItemsFromXMLForAuth(A){var I=document.getElementById("logout");var B=document.getElementById("quickcart");var D=document.getElementById("login");var H=document.getElementById("displaycart");var C=document.getElementById("main-nav-management");var E=document.getElementById("main-nav-dealer");var G=dojo.byId("panel_1");var F=dojo.byId("panel_2");this.isLogin=A.getElementsByTagName("isLogin")[0].firstChild.nodeValue;if(this.isLogin=="Y"){this.loginCustName=A.getElementsByTagName("loginCustName")[0].firstChild.nodeValue;this.loginCustNumber=A.getElementsByTagName("loginCustNumber")[0].firstChild.nodeValue;I.style.display="inline";B.style.display="inline";D.style.display="none";H.style.display="block";C.style.display="inline";E.style.display="inline";document.getElementById("loginCustName").innerHTML="Hello, "+this.loginCustName;dojo.byId("isAuthenticated").innerHTML="Y";G.style.display="none";F.style.display="inline";getJobList()}else{this.loginCustName=null;this.loginCustNumber=null;I.style.display="none";B.style.display="none";D.style.display="inline";H.style.display="none";dojo.byId("isAuthenticated").innerHTML="N";G.style.display="inline";F.style.display="none"}publishAuthenticationStatus();if(this.isLogin=="Y"){setTimeout(initModalAccountInput,500,"initModalAccountInput")}}function publishAuthenticationStatus(){var A=this;this.inputitem.isLogin=this.isLogin;dojo.publish("authenticationStatus",[A.inputitem])}var inputitem={keywords:"",catalogClass:"no catalogClass",catalogName:"no catalogName",catalogCrumbName:"ALL",stockinput:"no stockinput",venderNum:"0",venderName:"ALL",venderCrumbName:"ALL",searchFrom:"N",isLogin:"N",isDisplayCart:"N"};var isCatalogSearchFirstTime="Y";function searchCatalog_onkeypress(A){if(A.keyCode==dojo.keys.ENTER){searchCatalog()}}function searchCatalog(){dojo.require("dijit.layout.LayoutContainer");dojo.require("dijit.layout.ContentPane");dojo.require("ibm.widget.HtmlShoppingCart");dojo.require("ibm.widget.ItemDetails");dojo.require("ibm.widget.InventoryItem");dojo.require("ibm.widget.InventoryGrid");dojo.require("ibm.widget.CategoryGrid");dojo.require("ibm.widget.VenderGrid");var A=this;var C=dojo.byId("catalogSearchClass_top");var B=dojo.byId("catalogSearchKeywords_top");this.inputitem.keywords=trim(B.value);this.inputitem.catalogClass=C.value;this.inputitem.catalogName=getCatalogName(C.value)+"()";this.inputitem.catalogCrumbName=getCatalogName(C.value);this.inputitem.venderNum="0";this.inputitem.venderName="ALL";this.inputitem.venderCrumbName="ALL";dojo.cookie("fivestar.searchFrom","topnav");dojo.cookie("fivestar.catalogClass",this.inputitem.catalogClass);dojo.cookie("fivestar.catalogName",this.inputitem.catalogName);dojo.cookie("fivestar.catalogCrumbName",this.inputitem.catalogCrumbName);dojo.cookie("fivestar.venderNum",this.inputitem.venderNum);dojo.cookie("fivestar.venderName",this.inputitem.venderName);dojo.cookie("fivestar.venderCrumbName",this.inputitem.venderCrumbName);dojo.cookie("fivestar.keywords",this.inputitem.keywords);dojo.byId("main-nav-home").className="";dojo.byId("main-nav-catalog").className="active";dojo.byId("main-nav-management").className="";dojo.byId("main-nav-about").className="";dojo.byId("main-nav-dealer").className="";dojo.byId("wrapper_home").style.display="none";dojo.byId("wrapper_search").style.display="block";dojo.byId("wrapper_order").style.display="none";dojo.byId("wrapper_aboutus").style.display="none";dojo.byId("wrapper_dealer").style.display="none";this.publishSearchEvent()}function publishSearchEvent(){var A=this;this.inputitem.isLogin=this.isLogin;if(this.inputitem.catalogClass=="999"){this.inputitem.catalogName="ALL()";this.inputitem.catalogCrumbName="ALL";this.inputitem.searchFrom="searchManufacturers";dojo.cookie("fivestar.searchType","KEYWORD");dojo.cookie("fivestar.searchFrom",this.inputitem.searchFrom);dojo.cookie("fivestar.catalogName",this.inputitem.catalogName);dojo.cookie("fivestar.catalogCrumbName",this.inputitem.catalogCrumbName);dojo.publish("searchManufacturers",[A.inputitem])}else{if(this.inputitem.catalogClass=="000"){this.inputitem.searchFrom="topnav";dojo.cookie("fivestar.searchType","KEYWORD");dojo.cookie("fivestar.searchFrom",this.inputitem.searchFrom);dojo.publish("searchCatalog",[A.inputitem])}else{if(this.inputitem.catalogClass=="990"){if(this.inputitem.keywords==""||isNaN(this.inputitem.keywords)||this.inputitem.keywords.length==9||this.inputitem.keywords.length==11||this.inputitem.keywords.length>12){document.getElementById("errorDialogMessage").innerHTML="Must enter valid Five Star SKU, 10-digit UPC, or 12-digit UPC.";dijit.byId("errorDialog").show();return }this.inputitem.searchFrom="topnav";dojo.cookie("fivestar.searchType","UPC/FIVE STAR SKU");dojo.cookie("fivestar.searchFrom",this.inputitem.searchFrom);dojo.publish("searchCatalogByUPCorSKU",[A.inputitem])}else{if(this.inputitem.catalogClass=="991"){this.inputitem.searchFrom="topnav";this.inputitem.catalogClass="000";this.inputitem.catalogName="ALL";this.inputitem.catalogCrumbName="ALL";dojo.cookie("fivestar.catalogClass",this.inputitem.catalogClass);dojo.cookie("fivestar.catalogName",this.inputitem.catalogName);dojo.cookie("fivestar.catalogCrumbName",this.inputitem.catalogCrumbName);dojo.cookie("fivestar.searchType","MANUFACTURER NUMBER");dojo.cookie("fivestar.searchFrom",this.inputitem.searchFrom);if(this.inputitem.keywords==""){document.getElementById("errorDialogMessage").innerHTML="Please enter a valid value.";dijit.byId("errorDialog").show();return }dojo.publish("searchCatalog",[A.inputitem])}else{document.getElementById("errorDialogMessage").innerHTML="Please select search criteria.";dijit.byId("errorDialog").show()}}}}}function displayCart(){dojo.require("dijit.layout.LayoutContainer");dojo.require("dijit.layout.ContentPane");dojo.require("ibm.widget.HtmlShoppingCart");dojo.require("ibm.widget.ItemDetails");dojo.require("ibm.widget.InventoryItem");dojo.require("ibm.widget.InventoryGrid");dojo.require("ibm.widget.CategoryGrid");dojo.require("ibm.widget.VenderGrid");dojo.byId("main-nav-home").className="";dojo.byId("main-nav-catalog").className="active";dojo.byId("main-nav-management").className="";dojo.byId("main-nav-about").className="";dojo.byId("main-nav-dealer").className="";showHideSubNav("productsSubNav");dojo.byId("wrapper_home").style.display="none";dojo.byId("wrapper_search").style.display="block";dojo.byId("wrapper_order").style.display="none";dojo.byId("wrapper_aboutus").style.display="none";dojo.byId("wrapper_dealer").style.display="none";if(isCatalogSearchFirstTime=="Y"){this.inputitem.keywords="";this.inputitem.venderNum="0";this.inputitem.venderName="ALL";this.inputitem.venderCrumbName="ALL";this.inputitem.catalogClass="000";this.inputitem.catalogName="ALL";this.inputitem.catalogCrumbName="ALL";this.lastFocusNodeId=this.inputitem.catalogClass;dojo.byId("categoryTree").style.display="none";dojo.cookie("fivestar.searchType","KEYWORD");dojo.cookie("fivestar.searchFrom","initial");dojo.cookie("fivestar.keywords",this.inputitem.keywords);dojo.cookie("fivestar.catalogClass",this.inputitem.catalogClass);dojo.cookie("fivestar.catalogName",this.inputitem.catalogName);dojo.cookie("fivestar.catalogCrumbName",this.inputitem.catalogCrumbName);dojo.cookie("fivestar.venderNum",this.inputitem.venderNum);dojo.cookie("fivestar.venderName",this.inputitem.venderName);dojo.cookie("fivestar.venderCrumbName",this.inputitem.venderCrumbName);dojo.publish("searchCatalogInitial",[self.inputitem]);isCatalogSearchFirstTime="N"}this.publishDisplayCartEvent()}function publishDisplayCartEvent(){if(this.inputitem.isDisplayCart=="N"){this.inputitem.isDisplayCart="Y"}else{this.inputitem.isDisplayCart="N"}if(this.inputitem.isDisplayCart=="Y"){dijit.byId("searchResultsFloater").resize({w:680,h:590,t:0,l:0});dijit.byId("itemDetailsFloater").resize({w:0,h:590,t:0,l:0});dijit.byId("shoppingCartFloater").resize({w:240,h:590,t:0,l:700})}else{dijit.byId("searchResultsFloater").resize({w:920,h:590,t:0,l:0});dijit.byId("itemDetailsFloater").resize({w:0,h:590,t:0,l:0});dijit.byId("shoppingCartFloater").resize({w:0,h:590,t:0,l:0})}dojo.publish("displayCart",[this.inputitem])}function _handleDisplayCart(A){this.inputitem.isDisplayCart=A.isDisplayCart}function searchStock_onkeypress(A){if(A.keyCode==dojo.keys.ENTER){searchStock()}}function searchStock(){var A=dojo.byId("stock_input");this.inputitem.stockinput=trim(A.value);if(this.inputitem.stockinput==""||isNaN(this.inputitem.stockinput)||this.inputitem.stockinput.length==9||this.inputitem.stockinput.length==11||this.inputitem.stockinput.length>12){document.getElementById("errorDialogMessage").innerHTML="Must enter valid Five Star SKU, 10-digit UPC, or 12-digit UPC.";dijit.byId("errorDialog").show();return }dojo.publish("searchStock",[this.inputitem])}function searchOrder_onkeypress(A){if(A.keyCode==dojo.keys.ENTER){searchOrder()}}function searchOrder(){dojo.require("dojox.grid.Grid");dojo.require("dojox.grid._data.model");dojo.require("dijit.layout.LayoutContainer");dojo.require("dijit.layout.ContentPane");dojo.require("ibm.widget.OrderDetails");var B=this;var D=dojo.byId("order-input").value;dojo.byId("main-nav-home").className="";dojo.byId("main-nav-catalog").className="";dojo.byId("main-nav-management").className="active";dojo.byId("main-nav-about").className="";dojo.byId("main-nav-dealer").className="";dojo.byId("wrapper_home").style.display="none";dojo.byId("wrapper_search").style.display="none";dojo.byId("wrapper_order").style.display="block";dojo.byId("wrapper_aboutus").style.display="none";dojo.byId("wrapper_dealer").style.display="none";var A=dijit.byId("rootOrderWidgetId");if(!A){rootOrderWidget=new dijit.layout.ContentPane({id:"rootOrderWidgetId",href:"pane-order.html"},dojo.doc.createElement("div"));dijit.byId("rootOrderWidgetId").startup();rootOrderWidget.startup();var C=dojo.byId("wrapper_order");C.innerHTML="";C.appendChild(rootOrderWidget.domNode)}submitOrder()}function getCatalogName(B){var A=null;if(B=="000"){A="ALL"}else{if(B=="990"){A="UPC/FIVE STAR SKU"}else{if(B=="991"){A="MANUFACTURER NUMBER"}else{if(B=="999"){A="VENDOR"}}}}return A}function trim(C){var C=C.replace(/^\s\s*/,""),A=/\s/,B=C.length;while(A.test(C.charAt(--B))){}return C.slice(0,B+1)}function login(D){var F=dojo.byId("login_username").value;var C=dojo.byId("login_password").value;if(F==""){document.getElementById("errorDialogMessage").innerHTML="Please enter username.";dijit.byId("errorDialog").show();return }if(C==""){document.getElementById("errorDialogMessage").innerHTML="Please enter password.";dijit.byId("errorDialog").show();return }var B=this;var E="/fivestargroup/servlet/AccountServlet?action=login&username="+F+"&password="+C+"&isAuth="+dojo.byId("isAuthenticated").innerHTML;document.body.style.cursor="wait";var A=dojo.rawXhrPost({url:E,timeout:12000,headers:{"Content-Type":"text/xml"},handleAs:"xml",postData:"<authentication>login</authentication>",load:function(H,G){document.body.style.cursor="default";B._loadItemsFromXMLForAuth(H);dijit.byId("loginDialog").hide();return H},error:function(H,G){document.body.style.cursor="default";console.log("***AJAX call error status: ",G.xhr.status);if(G.xhr.status==403){dijit.byId("timeoutDialog").show()}return"error"}})}function sessiontimeout(){window.location.href="/fivestargroup/loginRedirect.jsp"}var rootAboutusWidget;var rootHomeWidget;var rootSearchWidget;var rootOrderWidget;var rootDealerWidget;function create(A){if(A=="home"){bannerRotation();dojo.require("dijit.layout.ContentPane");dojo.byId("main-nav-home").className="active";dojo.byId("main-nav-catalog").className="";dojo.byId("main-nav-management").className="";dojo.byId("main-nav-about").className="";dojo.byId("main-nav-dealer").className="";showHideSubNav("homeSubNav");dojo.byId("wrapper_home").style.display="block";dojo.byId("wrapper_search").style.display="none";dojo.byId("wrapper_order").style.display="none";dojo.byId("wrapper_aboutus").style.display="none";dojo.byId("wrapper_dealer").style.display="none"}else{if(A=="dealer"){LazyLoad.loadOnce("./dojo/fivestardojo_dealer.js?v=200811101651",onLazyLoad_dealer,this,true,true)}else{if(A=="catalog"){dojo.require("dijit.layout.LayoutContainer");dojo.require("dijit.layout.ContentPane");dojo.require("ibm.widget.HtmlShoppingCart");dojo.require("ibm.widget.ItemDetails");dojo.require("ibm.widget.InventoryGrid");dojo.require("ibm.widget.InventoryGridRow");dojo.require("ibm.widget.InventoryItem");dojo.require("ibm.widget.CategoryGrid");dojo.require("ibm.widget.VenderGrid");dojo.byId("main-nav-home").className="";dojo.byId("main-nav-catalog").className="active";dojo.byId("main-nav-management").className="";dojo.byId("main-nav-about").className="";dojo.byId("main-nav-dealer").className="";showHideSubNav("productsSubNav");clickon("search");dojo.byId("wrapper_home").style.display="none";dojo.byId("wrapper_search").style.display="block";dojo.byId("wrapper_order").style.display="none";dojo.byId("wrapper_aboutus").style.display="none";dojo.byId("wrapper_dealer").style.display="none";if(isCatalogSearchFirstTime=="Y"){this.inputitem.keywords="";this.inputitem.venderNum="0";this.inputitem.venderName="ALL";this.inputitem.venderCrumbName="ALL";this.inputitem.catalogClass="000";this.inputitem.catalogName="ALL";this.inputitem.catalogCrumbName="ALL";this.lastFocusNodeId=this.inputitem.catalogClass;dojo.byId("categoryTree").style.display="none";dojo.cookie("fivestar.searchType","KEYWORD");dojo.cookie("fivestar.searchFrom","initial");dojo.cookie("fivestar.keywords",this.inputitem.keywords);dojo.cookie("fivestar.catalogClass",this.inputitem.catalogClass);dojo.cookie("fivestar.catalogName",this.inputitem.catalogName);dojo.cookie("fivestar.catalogCrumbName",this.inputitem.catalogCrumbName);dojo.cookie("fivestar.venderNum",this.inputitem.venderNum);dojo.cookie("fivestar.venderName",this.inputitem.venderName);dojo.cookie("fivestar.venderCrumbName",this.inputitem.venderCrumbName);dojo.publish("searchCatalogInitial",[self.inputitem]);isCatalogSearchFirstTime="N"}}else{if(A=="order"){LazyLoad.loadOnce("./dojo/fivestardojo_order.js?v=200811101651",onLazyLoad_order,this,true,true)}else{if(A=="aboutus"){dojo.require("dijit.layout.ContentPane");showHideSubNav("aboutUsSubNav");dojo.byId("main-nav-home").className="";dojo.byId("main-nav-catalog").className="";dojo.byId("main-nav-management").className="";dojo.byId("main-nav-about").className="active";dojo.byId("main-nav-dealer").className="";dojo.byId("wrapper_home").style.display="none";dojo.byId("wrapper_search").style.display="none";dojo.byId("wrapper_order").style.display="none";dojo.byId("wrapper_aboutus").style.display="block";dojo.byId("wrapper_dealer").style.display="none";createAboutUs("profile")}}}}}}function createAboutUs(H){showHideSubNav("aboutUsSubNav");dojo.byId("main-nav-home").className="";dojo.byId("main-nav-catalog").className="";dojo.byId("main-nav-management").className="";dojo.byId("main-nav-about").className="active";dojo.byId("main-nav-dealer").className="";dojo.byId("wrapper_home").style.display="none";dojo.byId("wrapper_search").style.display="none";dojo.byId("wrapper_order").style.display="none";dojo.byId("wrapper_aboutus").style.display="block";dojo.byId("wrapper_dealer").style.display="none";if(H=="investor"){dojo.byId("aboutUsInvestor").style.display="block";dojo.byId("aboutUsRegions").style.display="none";dojo.byId("aboutUsVendors").style.display="none";dojo.byId("aboutUsRetails").style.display="none";dojo.byId("aboutUsProfile").style.display="none";dojo.byId("aboutUsDirectory").style.display="none";var E=dijit.byId("rootAboutusInvestorWidgetId");if(!E){C=new dijit.layout.ContentPane({id:"rootAboutusInvestorWidgetId",href:"pane-aboutus-investor.html",loadingMessage:"<img src='images/loading.gif' alt='image'/><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"},dojo.doc.createElement("div"));dijit.byId("rootAboutusInvestorWidgetId").startup();C.startup();var A=dojo.byId("aboutUsInvestor");A.innerHTML="";A.appendChild(C.domNode)}}else{if(H=="regions"){dojo.byId("aboutUsInvestor").style.display="none";dojo.byId("aboutUsRegions").style.display="block";dojo.byId("aboutUsVendors").style.display="none";dojo.byId("aboutUsRetails").style.display="none";dojo.byId("aboutUsProfile").style.display="none";dojo.byId("aboutUsDirectory").style.display="none";var D=dijit.byId("rootAboutusRegionsWidgetId");if(!D){C=new dijit.layout.ContentPane({id:"rootAboutusRegionsWidgetId",href:"pane-aboutus-regions.html",loadingMessage:"<img src='images/loading.gif' alt='image'/><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"},dojo.doc.createElement("div"));dijit.byId("rootAboutusRegionsWidgetId").startup();C.startup();var A=dojo.byId("aboutUsRegions");A.innerHTML="";A.appendChild(C.domNode)}}else{if(H=="vendors"){dojo.byId("aboutUsInvestor").style.display="none";dojo.byId("aboutUsRegions").style.display="none";dojo.byId("aboutUsVendors").style.display="block";dojo.byId("aboutUsRetails").style.display="none";dojo.byId("aboutUsProfile").style.display="none";dojo.byId("aboutUsDirectory").style.display="none";var B=dijit.byId("rootAboutusVendorsWidgetId");if(!B){var C=new dijit.layout.ContentPane({id:"rootAboutusVendorsWidgetId",href:"pane-aboutus-venders.html",loadingMessage:"<img src='images/loading.gif' alt='image'/><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"},dojo.doc.createElement("div"));dijit.byId("rootAboutusVendorsWidgetId").startup();C.startup();var A=dojo.byId("aboutUsVendors");A.innerHTML="";A.appendChild(C.domNode)}}else{if(H=="retail"){dojo.byId("aboutUsInvestor").style.display="none";dojo.byId("aboutUsRegions").style.display="none";dojo.byId("aboutUsVendors").style.display="none";dojo.byId("aboutUsRetails").style.display="block";dojo.byId("aboutUsProfile").style.display="none";dojo.byId("aboutUsDirectory").style.display="none";var I=dijit.byId("rootAboutusRetailsWidgetId");if(!I){C=new dijit.layout.ContentPane({id:"rootAboutusRetailsWidgetId",href:"pane-aboutus-retail.html",loadingMessage:"<img src='images/loading.gif' alt='image'/><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"},dojo.doc.createElement("div"));dijit.byId("rootAboutusRetailsWidgetId").startup();C.startup();var A=dojo.byId("aboutUsRetails");A.innerHTML="";A.appendChild(C.domNode)}}else{if(H=="profile"){dojo.byId("aboutUsInvestor").style.display="none";dojo.byId("aboutUsRegions").style.display="none";dojo.byId("aboutUsVendors").style.display="none";dojo.byId("aboutUsRetails").style.display="none";dojo.byId("aboutUsProfile").style.display="block";dojo.byId("aboutUsDirectory").style.display="none";var F=dijit.byId("rootAboutusProfileWidgetId");if(!F){C=new dijit.layout.ContentPane({id:"rootAboutusProfileWidgetId",href:"pane-aboutus-profile.html",loadingMessage:"<img src='images/loading.gif' alt='image'/><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"},dojo.doc.createElement("div"));dijit.byId("rootAboutusProfileWidgetId").startup();C.startup();var A=dojo.byId("aboutUsProfile");A.innerHTML="";A.appendChild(C.domNode)}}else{if(H=="directory"){dojo.byId("aboutUsInvestor").style.display="none";dojo.byId("aboutUsRegions").style.display="none";dojo.byId("aboutUsVendors").style.display="none";dojo.byId("aboutUsRetails").style.display="none";dojo.byId("aboutUsProfile").style.display="none";dojo.byId("aboutUsDirectory").style.display="block";var G=dijit.byId("rootAboutusDirectoryWidgetId");if(!G){C=new dijit.layout.ContentPane({id:"rootAboutusDirectoryWidgetId",href:"pane-aboutus-directory.html",loadingMessage:"<img src='images/loading.gif' alt='image'/><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"},dojo.doc.createElement("div"));dijit.byId("rootAboutusDirectoryWidgetId").startup();C.startup();var A=dojo.byId("aboutUsDirectory");A.innerHTML="";A.appendChild(C.domNode)}}}}}}}}function createDealer(F){if(F=="service"){dojo.byId("wrapper_dealer_service").style.display="block";dojo.byId("wrapper_dealer_download").style.display="none";dojo.byId("wrapper_dealer_cdelsched").style.display="none";dojo.byId("wrapper_dealer_retail").style.display="none";var C=dijit.byId("rootDealerServiceWidgetId");if(!C){rootDealerWidget=new dijit.layout.ContentPane({id:"rootDealerServiceWidgetId",href:"pane-dealer-service.html",style:"overflow-y: auto; overflow-x: hidden;"},dojo.doc.createElement("div"));dijit.byId("rootDealerServiceWidgetId").startup();rootDealerWidget.startup();var D=dojo.byId("wrapper_dealer_service");D.innerHTML="";D.appendChild(rootDealerWidget.domNode)}getSpecialFileList()}else{if(F=="download"){dojo.byId("wrapper_dealer_service").style.display="none";dojo.byId("wrapper_dealer_download").style.display="block";dojo.byId("wrapper_dealer_cdelsched").style.display="none";dojo.byId("wrapper_dealer_retail").style.display="none";var B=dijit.byId("rootDealerDownloadWidgetId");if(!B){rootDealerWidget=new dijit.layout.ContentPane({id:"rootDealerDownloadWidgetId",href:"pane-dealer-download.html",style:"overflow-y: auto; overflow-x: hidden;"},dojo.doc.createElement("div"));dijit.byId("rootDealerDownloadWidgetId").startup();rootDealerWidget.startup();var D=dojo.byId("wrapper_dealer_download");D.innerHTML="";D.appendChild(rootDealerWidget.domNode)}getDownloadFiles("nav_download")}else{if(F=="cdelsched"){dojo.byId("wrapper_dealer_service").style.display="none";dojo.byId("wrapper_dealer_download").style.display="none";dojo.byId("wrapper_dealer_cdelsched").style.display="block";dojo.byId("wrapper_dealer_retail").style.display="none";var E={99:[99]};_loadDeliverySpecialDaysCalender(E)}else{if(F=="retail"){dojo.byId("wrapper_dealer_service").style.display="none";dojo.byId("wrapper_dealer_download").style.display="none";dojo.byId("wrapper_dealer_cdelsched").style.display="none";dojo.byId("wrapper_dealer_retail").style.display="block";var A=dijit.byId("rootDealerRetailWidgetId");if(!A){rootDealerWidget=new dijit.layout.ContentPane({id:"rootDealerRetailWidgetId",href:"pane-dealer-retail.html",style:"overflow-y: auto; overflow-x: hidden;"},dojo.doc.createElement("div"));dijit.byId("rootDealerRetailWidgetId").startup();rootDealerWidget.startup();var D=dojo.byId("wrapper_dealer_retail");D.innerHTML="";D.appendChild(rootDealerWidget.domNode)}}}}}}function onLazyLoad_dealer(){dojo.byId("main-nav-dealer").className="active";dojo.byId("main-nav-home").className="";dojo.byId("main-nav-catalog").className="";dojo.byId("main-nav-management").className="";dojo.byId("main-nav-about").className="";showHideSubNav("dealerSubNav");dojo.byId("wrapper_dealer").style.display="block";dojo.byId("wrapper_home").style.display="none";dojo.byId("wrapper_search").style.display="none";dojo.byId("wrapper_order").style.display="none";dojo.byId("wrapper_aboutus").style.display="none";getDownloadFiles("nav_dealer");createDealer("service")}function onLazyLoad_order(){dojo.byId("main-nav-home").className="";dojo.byId("main-nav-catalog").className="";dojo.byId("main-nav-management").className="active";dojo.byId("main-nav-about").className="";dojo.byId("main-nav-dealer").className="";showHideSubNav("orderSubNav");dojo.byId("wrapper_home").style.display="none";dojo.byId("wrapper_search").style.display="none";dojo.byId("wrapper_order").style.display="block";dojo.byId("wrapper_aboutus").style.display="none";dojo.byId("wrapper_dealer").style.display="none";clickon("order");var A=dijit.byId("rootOrderWidgetId");if(!A){rootOrderWidget=new dijit.layout.ContentPane({id:"rootOrderWidgetId",href:"pane-order.html",style:"overflow-y: auto; overflow-x: hidden;"},dojo.doc.createElement("div"));dijit.byId("rootOrderWidgetId").startup();rootOrderWidget.startup();var B=dojo.byId("wrapper_order");B.innerHTML="";B.appendChild(rootOrderWidget.domNode)}}function _handleSearchCatalog(A){this.inputitem.searchFrom=dojo.cookie("fivestar.searchFrom");if(dojo.cookie("fivestar.keywords")){this.inputitem.keywords=dojo.cookie("fivestar.keywords")}else{this.inputitem.keywords=""}this.inputitem.venderNum=dojo.cookie("fivestar.venderNum");this.inputitem.venderName=dojo.cookie("fivestar.venderName");this.inputitem.venderCrumbName=dojo.cookie("fivestar.venderCrumbName");this.inputitem.catalogClass=dojo.cookie("fivestar.catalogClass");this.inputitem.catalogName=dojo.cookie("fivestar.catalogName");this.inputitem.catalogCrumbName=dojo.cookie("fivestar.catalogCrumbName");if(this.inputitem.searchFrom!="categoryTree"){this.lastFocusNodeId=this.inputitem.catalogClass}}function _handleSearchCatalogByVender(A){this.inputitem.searchFrom=dojo.cookie("fivestar.searchFrom");if(dojo.cookie("fivestar.keywords")){this.inputitem.keywords=dojo.cookie("fivestar.keywords")}else{this.inputitem.keywords=""}this.inputitem.venderNum=dojo.cookie("fivestar.venderNum");this.inputitem.venderName=dojo.cookie("fivestar.venderName");this.inputitem.venderCrumbName=dojo.cookie("fivestar.venderCrumbName");this.inputitem.catalogClass=dojo.cookie("fivestar.catalogClass");this.inputitem.catalogName=dojo.cookie("fivestar.catalogName");this.inputitem.catalogCrumbName=dojo.cookie("fivestar.catalogCrumbName")}function _handleSearchManufacturers(A){this.lastFocusNodeId="000"}var selectedItem;var selectedCategoryLevel=1;var selectedIndex=0;var lastFocusNodeId=null;var lastFocusCategoryClass=null;var categoryTimestamp=null;var selectedItemNodeId=null;function loadTreeFromJSON(I){var J=dijit.byId("categoryTree");var C=selectedItem?{parent:selectedItem,attribute:"children"}:null;if(I.items[0].id.length==3){var D=J._itemNodeMap["000"];J._collapseNode(D);categoryStore.fetchItemByIdentity({identity:"000",onItem:function(K){if(K){selectedItemNodeId="000";selectedItem=K;selectedIndex=0}else{selectedItem=null}}});C=selectedItem?{parent:selectedItem,attribute:"children"}:null}if(selectedItem){var F=categoryStore.getValues(selectedItem,"children");for(var B=0;B<F.length;B++){categoryStore.fetchItemByIdentity({identity:F[B].id,onItem:function(K){if(K){categoryStore.deleteItem(K);categoryStore.save()}}})}}if(selectedCategoryLevel==1){var E=new Date();categoryTimestamp=E.getMonth()+"_"+E.getDate()+"_"+E.getHours()+"_"+E.getMinutes()+"_"+E.getSeconds();selectedIndex=0}dojo.forEach(I.items,function(K){categoryStore.fetchItemByIdentity({identity:K.id,onItem:function(L){if(L){console.debug("child.id exist.."+K.id)}else{if(K.id.length==3){categoryStore.newItem({id:K.id,name:K.name+K.count,crumbname:K.name,fullname:K.fullname,index:K.index},C)}else{categoryStore.newItem({id:K.id+"-"+categoryTimestamp,name:K.name+K.count,crumbname:K.name,fullname:K.fullname,index:K.index},C)}}}})});var D=J._itemNodeMap[selectedItemNodeId];J._expandNode(D);if(this.inputitem.searchFrom!="categoryTree"){if(lastFocusNodeId.length>3){var A=lastFocusNodeId.split("-");lastFocusCategoryClass=A[0];if(selectedCategoryLevel<lastFocusCategoryClass.length/3){selectedCategoryClass=lastFocusCategoryClass.substring(0,selectedCategoryLevel*3);var H;if(selectedCategoryClass.length==3){H=selectedCategoryClass}else{H=selectedCategoryClass+"-"+categoryTimestamp}categoryStore.fetchItemByIdentity({identity:H,onItem:function(K){if(K){selectedItem=K;selectedIndex=selectedIndex+parseInt(K.index);selectedItemNodeId=H;searchCatalogFromTree(K,"loadCategory")}else{console.debug("selectedCategoryClass not exist.."+selectedCategoryClass+categoryTimestamp)}}});selectedCategoryLevel++}else{lastFocusNodeId=lastFocusCategoryClass+"-"+categoryTimestamp;categoryStore.fetchItemByIdentity({identity:lastFocusNodeId,onItem:function(K){if(K){selectedIndex=selectedIndex+parseInt(K.index)}else{console.debug("lastFocusNodeId not exist.."+lastFocusNodeId)}}});var G=J._itemNodeMap[lastFocusNodeId];if(G){G.labelNode.style.cssText="font-weight: bold; color: #2baae1";setTimeout(categoryTreeDivScrollTop,200,selectedIndex)}selectedCategoryLevel=1}}else{if(lastFocusNodeId.length==3){categoryStore.fetchItemByIdentity({identity:lastFocusNodeId,onItem:function(K){if(K){selectedIndex=selectedIndex+parseInt(K.index)}else{console.debug("lastFocusNodeId not exist.."+lastFocusNodeId)}}});var G=J._itemNodeMap[lastFocusNodeId];if(G){G.labelNode.style.cssText="font-weight: bold; color: #2baae1";setTimeout(categoryTreeDivScrollTop,200,selectedIndex)}selectedCategoryLevel=1}}}else{var G=J._itemNodeMap[lastFocusNodeId];if(G){G.labelNode.style.cssText="font-weight: bold; color: #2baae1"}selectedCategoryLevel=1}}function categoryTreeDivScrollTop(A){dojo.byId("categoryTreeDiv").scrollTop=(selectedIndex-1)*18}function onClick(A){selectedItem=A;searchCatalogFromTree(A,"onClick")}function collapseMyTree(){var A=dijit.byId("categoryTree");dojo.query("[wairole='treeitem']",A.domNode).forEach(function(C){var B=dijit.getEnclosingWidget(C);this._collapseNode(B)},A)}function expandMyTree(){var A=dijit.byId("categoryTree");dojo.query("[wairole='treeitem']",A.domNode).forEach(function(C){var B=dijit.getEnclosingWidget(C);this._expandNode(B)},A)}function searchCatalogFromTree(G,F){var H=this;if(G){var J=dijit.byId("categoryTree");var B=G?categoryStore.getValue(G,"id"):"";var A=B.split("-");var D=A[0];H.inputitem.catalogClass=D;H.inputitem.catalogName=G?categoryStore.getValue(G,"fullname"):"";H.inputitem.catalogCrumbName=G?categoryStore.getValue(G,"crumbname"):"";dojo.cookie("fivestar.catalogClass",H.inputitem.catalogClass);dojo.cookie("fivestar.catalogName",H.inputitem.catalogName);dojo.cookie("fivestar.catalogCrumbName",H.inputitem.catalogCrumbName);if(F=="onClick"){if(lastFocusNodeId){var E=J._itemNodeMap[lastFocusNodeId];if(E){E.labelNode.style.cssText="font-weight: normal; color: #636466"}}var C=G?categoryStore.getValue(G,"id"):"";lastFocusNodeId=C;var I=J._itemNodeMap[C];selectedItemNodeId=C;I.labelNode.style.cssText="font-weight: bold; color: #2baae1";dojo.publish("searchCatalogFromTree",[H.inputitem])}else{if(F=="loadCategory"){dojo.publish("loadCategoryForTree",[H.inputitem])}}}else{console.debug("Category Tree click on root ... ")}}function searchResultsRemove(B){var A={type:""};if(B=="Vendor"){A.type="Vendor";dojo.byId("searchResultsVendorRemove").style.display="none";dojo.publish("searchResultsRemove",[A])}else{if(B=="Category"){A.type="Category";dojo.byId("searchResultsCategoryRemove").style.display="none";dojo.publish("searchResultsRemove",[A])}else{if(B=="Keywords"){A.type="Keywords";dojo.byId("searchResultsKeywordsRemove").style.display="none";dojo.publish("searchResultsRemove",[A])}}}}function onMouseOverSR(A){if(A=="Vendor"){if(dojo.byId("searchResultsVendor").innerHTML!="ALL"&&dojo.byId("searchResultsVendor").innerHTML!=""){dojo.byId("searchResultsVendor").style.cssText="color:#F78E1E; font-weight:bold;";dojo.byId("searchResultsVendorRemove").style.display="inline"}}else{if(A=="Category"){if(dojo.byId("searchResultsCategory").innerHTML!="ALL"&&dojo.byId("searchResultsCategory").innerHTML!=""){dojo.byId("searchResultsCategory").style.cssText="color:#F78E1E; font-weight:bold;";dojo.byId("searchResultsCategoryRemove").style.display="inline"}}else{if(A=="Keywords"){if(dojo.byId("searchResultsKeywords").innerHTML!=""){dojo.byId("searchResultsKeywords").style.cssText="color:#F78E1E; font-weight:bold;";dojo.byId("searchResultsKeywordsRemove").style.display="inline"}}}}}function onMouseOutSR(A){dojo.byId("searchResultsVendorRemove").style.display="none";dojo.byId("searchResultsCategoryRemove").style.display="none";dojo.byId("searchResultsKeywordsRemove").style.display="none";dojo.byId("searchResultsVendor").style.cssText="color:white; font-weight:normal;";dojo.byId("searchResultsCategory").style.cssText="color:white; font-weight:normal;";dojo.byId("searchResultsKeywords").style.cssText="color:white; font-weight:normal;"}function stockinquiry_addToCart(){dojo.byId("main-nav-home").className="";dojo.byId("main-nav-catalog").className="active";dojo.byId("main-nav-management").className="";dojo.byId("main-nav-about").className="";dojo.byId("main-nav-dealer").className="";showHideSubNav("productsSubNav");dojo.byId("wrapper_home").style.display="none";dojo.byId("wrapper_search").style.display="block";dojo.byId("wrapper_order").style.display="none";dojo.byId("wrapper_aboutus").style.display="none";dojo.byId("wrapper_dealer").style.display="none";if(isCatalogSearchFirstTime=="Y"){this.inputitem.keywords="";this.inputitem.venderNum="0";this.inputitem.venderName="ALL";this.inputitem.venderCrumbName="ALL";this.inputitem.catalogClass="000";this.inputitem.catalogName="ALL";this.inputitem.catalogCrumbName="ALL";this.lastFocusNodeId=this.inputitem.catalogClass;dojo.byId("categoryTree").style.display="none";dojo.cookie("fivestar.searchType","KEYWORD");dojo.cookie("fivestar.searchFrom","initial");dojo.cookie("fivestar.keywords",this.inputitem.keywords);dojo.cookie("fivestar.catalogClass",this.inputitem.catalogClass);dojo.cookie("fivestar.catalogName",this.inputitem.catalogName);dojo.cookie("fivestar.catalogCrumbName",this.inputitem.catalogCrumbName);dojo.cookie("fivestar.venderNum",this.inputitem.venderNum);dojo.cookie("fivestar.venderName",this.inputitem.venderName);dojo.cookie("fivestar.venderCrumbName",this.inputitem.venderCrumbName);dojo.publish("searchCatalogInitial",[self.inputitem]);isCatalogSearchFirstTime="N"}var A={id:"",qty:1};A.id=trim(dojo.byId("productNumElement").innerHTML);A.qty=trim(dojo.byId("packQtyElement").innerHTML);dojo.publish("HtmlShoppingCart_add",[A]);dijit.byId("stockInquiryDialog").hide()}function initModalAccountInput(B){dijit.byId("webord_cust").setValue(this.loginCustNumber);dojo.require("dojo.data.ItemFileReadStore");dojo.require("dijit.form.FilteringSelect");try{jsonrpc=new JSONRpcClient("/fivestargroup/JSON-RPC?isAuth="+dojo.byId("isAuthenticated").innerHTML);jsonrpc.JobItemService.getSubmitOrderJobListByCust(submitOrderJobListResultCallBack,"0")}catch(A){console.log("JSONRpcClientException code = "+A.code);if(A.code==403){dijit.byId("timeoutDialog").show()}else{alert(A)}}}var submitordercombo;function submitOrderJobListResultCallBack(A,C){var D={};D.items=A.list;var B=dojo.byId("submitorder-input");B.options.length=0;dojo.forEach(D.items,function(F){var E=B.options.length;B.options.length++;B.options[E].value=F.name;B.options[E].text=F.name})}function submitOrder(){dojo.byId("orderPane").style.display="block";dojo.byId("statementPane").style.display="none";dojo.byId("statementTransactionsPane").style.display="none";dojo.byId("transDetailsPane").style.display="none";dojo.requireLocalization("i18n","orderinquiry");dojo.byId("orderType").innerHTML="OPEN ORDER INQUIRY RESULTS";try{document.body.style.cursor="wait";jsonrpc=new JSONRpcClient("/fivestargroup/JSON-RPC?isAuth="+dojo.byId("isAuthenticated").innerHTML);var A=dojo.byId("order-input");jsonrpc.OrderService.getOrderListByJob(orderResultCallBack,A.value)}catch(B){console.log("JSONRpcClientException code = "+B.code);if(B.code==403){dijit.byId("timeoutDialog").show()}else{alert(B)}}}function orderResultCallBack(A,B){document.body.style.cursor="default";dojo.publish("hideorderdetails");try{renderOrderResult("open",A,B)}catch(C){alert(C)}}function allOrderResultCallBack(A,B){document.body.style.cursor="default";dojo.publish("hideorderdetails");try{renderOrderResult("all",A,B)}catch(C){alert(C)}}function submitAllOrder(){dojo.byId("orderPane").style.display="block";dojo.byId("statementPane").style.display="none";dojo.byId("statementTransactionsPane").style.display="none";dojo.byId("transDetailsPane").style.display="none";dojo.requireLocalization("i18n","orderinquiry");dojo.byId("orderType").innerHTML="INVOICES INQUIRY RESULTS";try{document.body.style.cursor="wait";jsonrpc=new JSONRpcClient("/fivestargroup/JSON-RPC?isAuth="+dojo.byId("isAuthenticated").innerHTML);var A=dojo.byId("order-input");jsonrpc.OrderService.getAllOrderListByJob(allOrderResultCallBack,A.value)}catch(B){console.log("JSONRpcClientException code = "+B.code);if(B.code==403){dijit.byId("timeoutDialog").show()}else{alert(B)}}}function getOrderDetails(A){var E={orderNumKey:"00",shipDate:"NA",jobKey:"00",orderType:"NO"};dojo.requireLocalization("i18n","orderinquiry");var D=gridWidget.model.getDatum(A.rowIndex,7);var C=gridWidget.model.getDatum(A.rowIndex,2);var B=gridWidget.model.getDatum(A.rowIndex,5);if(dojo.byId("orderType").innerHTML=="OPEN ORDER INQUIRY RESULTS"){E.orderType="OpenOrder"}else{E.orderType="AllOrder"}E.orderNumKey=D;E.shipDate=C;E.jobKey=B;dojo.publish("orderdetails",[E]);gridWidget.autoHeight=false;gridWidget.autoWidth=false;dojo.contentBox(gridWidget.domNode,{w:460,h:450});gridWidget.update()}function getJobList(){dojo.require("dojo.data.ItemFileReadStore");dojo.require("dijit.form.FilteringSelect");try{jsonrpc=new JSONRpcClient("/fivestargroup/JSON-RPC?isAuth="+dojo.byId("isAuthenticated").innerHTML);jsonrpc.JobItemService.getJobListByCust(jobListResultCallBack,"0")}catch(A){console.log("JSONRpcClientException code = "+A.code);if(A.code==403){dijit.byId("timeoutDialog").show()}else{alert(A)}}}var combo;function jobListResultCallBack(A,C){var D={};D.items=A.list;var B=new dojo.data.ItemFileReadStore({data:D});combo=new dijit.form.FilteringSelect({name:"job",autoComplete:"true",store:B,onkeypress:searchOrder_onkeypress,searchAttr:"name"},dojo.byId("order-input"));combo.setValue("000-Main Account");combo.setDisplayedValue("000-Main Account");combo_schedule=new dijit.form.FilteringSelect({name:"job",autoComplete:"true",store:B,onkeypress:_getDeliverySpecialDays_onkeypress,searchAttr:"name"},dojo.byId("schedule-input"));combo_schedule.setValue("000-Main Account");combo_schedule.setDisplayedValue("000-Main Account")}function getStatementBalance(){dojo.byId("custStatementAccountName").innerHTML=this.loginCustName;dojo.byId("custStatementAccountNumber").innerHTML=this.loginCustNumber;createStatementPane();dojo.byId('custStatementAvailableDate').innerHTML=Date.today().addMonths(-3).toString('yyyy/MM/dd');publishStatementEvent()}function createStatementPane(){dojo.byId("orderPane").style.display="none";dojo.byId("statementPane").style.display="block";dojo.byId("statementTransactionsPane").style.display="none";dojo.connect(dojo.byId("custStatementFromDate"),"onkeypress",getStatementTransactionsByDate_onkeypress)}function publishStatementEvent(){var A={orderNumKey:"00",shipDate:"NA",orderType:"NO"};dojo.publish("statementbalance",[A])}function getStatementTransactionsByDate_onkeypress(A){if(A.keyCode==dojo.keys.ENTER){getStatementTransactionsByDate()}}function getStatementTransactionsByDate(){dojo.publish("custStatementTransactionsByDate")}function backToStatementSecondPage(A){dojo.byId("orderPane").style.display="none";dojo.byId("statementPane").style.display="none";dojo.byId("statementTransactionsPane").style.display="block";dojo.byId("transDetailsPane").style.display="none"}function createWebOrderOnClick(D){var H=dojo.byId("submitorder-input").value;var E=dojo.byId("webord_ponum").value;var I=dojo.byId("webord_dept").value;var C=dojo.byId("webord_userid").value;var A=dojo.byId("webord_fax").value;if(H==""){document.getElementById("createOrder_result_message").innerHTML="Please select Ship to Address.";return }if(I==""){document.getElementById("createOrder_result_message").innerHTML="Please enter Department";return }if(E==""){document.getElementById("createOrder_result_message").innerHTML="Please enter Purchase Order #";return }if(C==""){document.getElementById("createOrder_result_message").innerHTML="Please enter User Name";return }if(A==""){document.getElementById("createOrder_result_message").innerHTML="Please enter Fax #";return }if(isNaN(A)||A.length!=10){document.getElementById("createOrder_result_message").innerHTML="Fax # Should be 10 Digits";return }dijit.byId("createOrderDialog").hide();dojo.publish("HtmlShoppingCart_clear");var G=this;var B="/fivestargroup/servlet/OrderServlet?action=createorder&cust="+dojo.byId("webord_cust").value+"&job="+H+"&ponum="+E+"&dept="+I+"&userid="+C+"&fax="+A+"&isAuth="+dojo.byId("isAuthenticated").innerHTML;document.body.style.cursor="wait";var F=dojo.rawXhrPost({url:B,timeout:12000,headers:{"Content-Type":"text/xml"},handleAs:"xml",postData:"<order><web>webord</web></order>",load:function(K,J){document.body.style.cursor="default";G._loadCreateWebOrderResp(K);return K},error:function(K,J){document.body.style.cursor="default";console.log("***AJAX call error status: ",J.xhr.status);if(J.xhr.status==403){dijit.byId("timeoutDialog").show()}return"error"}})}function _loadCreateWebOrderResp(B){var A=B.getElementsByTagName("isSuccess")[0].firstChild.nodeValue;var C;if(A=="Y"){C=B.getElementsByTagName("message")[0].firstChild.nodeValue;document.getElementById("messageDialogMessage").innerHTML=C;dijit.byId("messageDialog").show()}else{C=B.getElementsByTagName("message")[0].firstChild.nodeValue;document.getElementById("errorDialogMessage").innerHTML=C;dijit.byId("errorDialog").show()}}function handleI18N(){}var downloadSource="none";function getSpecialFileList(){var B=this;var C="/fivestargroup/servlet/AccountServlet?action=getSpecialFiles&isAuth="+dojo.byId("isAuthenticated").innerHTML;document.body.style.cursor="wait";var A=dojo.rawXhrPost({url:C,timeout:12000,headers:{"Content-Type":"text/xml"},handleAs:"xml",postData:"<authentication>getSpecialFiles</authentication>",load:function(E,D){document.body.style.cursor="default";B._loadSpecialFilesFromXML(E);return E},error:function(E,D){document.body.style.cursor="default";console.log("***AJAX call error status: ",D.xhr.status);if(D.xhr.status==403){dijit.byId("timeoutDialog").show()}return"error"}})}function _loadSpecialFilesFromXML(F){var G=F.getElementsByTagName("count")[0].firstChild.nodeValue;if(G=="0"){return }var E=F.getElementsByTagName("item");var C="";if(E.length>0){for(var B=0;B<E.length;B++){var D=E[B].getElementsByTagName("filename")[0].firstChild.nodeValue;var A=E[B].getElementsByTagName("desc")[0].firstChild.nodeValue;C+="<li><a href='/fivestargroup/servlet/AccountServlet?action=downloadSpecial&filename="+D+"'>"+A+"</a></li>"}var H=dojo.byId("specailDealsUl");H.innerHTML=C}}function getDownloadFiles(D){var B=this;this.downloadSource=D;var C="/fivestargroup/servlet/AccountServlet?action=getDownloadFiles&isAuth="+dojo.byId("isAuthenticated").innerHTML;document.body.style.cursor="wait";var A=dojo.rawXhrPost({url:C,timeout:12000,headers:{"Content-Type":"text/xml"},handleAs:"xml",postData:"<authentication>GetDownloadFiles</authentication>",load:function(F,E){document.body.style.cursor="default";B._loadDownLoadFilesFromXML(F);return F},error:function(F,E){document.body.style.cursor="default";console.log("***AJAX call error status: ",E.xhr.status);if(E.xhr.status==403){dijit.byId("timeoutDialog").show()}return"error"}})}function _loadDownLoadFilesFromXML(F){var G=F.getElementsByTagName("count")[0].firstChild.nodeValue;if(G=="NA"){dojo.byId("dealerSubNav-download").style.display="none";return }if(this.downloadSource=="nav_download"){var E=F.getElementsByTagName("item");var C="";if(E.length>0){for(var B=0;B<E.length;B++){var D=E[B].getElementsByTagName("filename")[0].firstChild.nodeValue;C+="<li><a href='/fivestargroup/servlet/AccountServlet?action=downloadFile&filename="+D+"'>"+D+"</a></li>"}var A=dojo.byId("downloadfilesUl");A.innerHTML=C}}}function changepassword(C){if(C.confirmpw!=C.newpw){document.getElementById("errorDialogMessage").innerHTML="Confirmation password is different.  Password is unchanged.";dijit.byId("errorDialog").show()}else{var B=this;var D="/fivestargroup/servlet/AccountServlet?action=changepassword&oldpw="+C.oldpw+"&newpw="+C.newpw+"&isAuth="+dojo.byId("isAuthenticated").innerHTML;document.body.style.cursor="wait";var A=dojo.rawXhrPost({url:D,timeout:12000,headers:{"Content-Type":"text/xml"},handleAs:"xml",postData:"<authentication>change</authentication>",load:function(F,E){document.body.style.cursor="default";B._loadChangePasswordResp(F);return F},error:function(F,E){document.body.style.cursor="default";console.log("***AJAX call error status: ",E.xhr.status);if(E.xhr.status==403){dijit.byId("timeoutDialog").show()}return"error"}})}}function _loadChangePasswordResp(B){var A=B.getElementsByTagName("isSuccess")[0].firstChild.nodeValue;var C;if(A=="Y"){C=B.getElementsByTagName("message")[0].firstChild.nodeValue;document.getElementById("messageDialogMessage").innerHTML=C;dijit.byId("messageDialog").show()}else{C=B.getElementsByTagName("message")[0].firstChild.nodeValue;document.getElementById("errorDialogMessage").innerHTML=C;dijit.byId("errorDialog").show()}}function _getDeliverySpecialDays_onkeypress(A){if(A.keyCode==dojo.keys.ENTER){_getDeliverySpecialDays()}}function _getDeliverySpecialDays(){var B=this;document.body.style.cursor="wait";var A=dojo.rawXhrPost({url:"/fivestargroup/servlet/OrderServlet?action=getDeliverySpecialDays&job="+dojo.byId("schedule-input").value+"&isAuth="+dojo.byId("isAuthenticated").innerHTML,timeout:12000,handleAs:"json",headers:{"Content-Type":"text/plain"},postData:"{}",load:function(D,C){document.body.style.cursor="default";_loadDeliverySpecialDaysCalender(D);return D},error:function(D,C){document.body.style.cursor="default";console.log("***AJAX call error status: ",C.xhr.status);if(C.xhr.status==403){dijit.byId("timeoutDialog").show()}return"error"}})}function _loadDeliverySpecialDaysCalender(B){var D=dojo.byId("calendar-container");D.innerHTML="";var F=B;var A=F[99];if(!A){document.getElementById("messageDialogMessage").innerHTML="No Delivery Schedule.";dijit.byId("messageDialog").show()}function E(I,K,G){var L=new Date();L.setFullYear(I);L.setMonth(K);L.setDate(G);var J=L.getDay();if(!A){return false}for(var H in A){if(A[H]==J){return true}}return false}function C(G){console.debug(" calender dateChanged ... ")}Calendar.setup({flat:"calendar-container",flatCallback:C,dateStatusFunc:function(H,J,G,I){if(E(J,G,I)){return"special"}else{return false}}})}function showQuickCartDialog(){var A=dijit.getViewport();dojo.byId("quickCartDialogDiv").style.cssText="height:"+A.h*0.8+"px;width: 500px; overflow-y: auto; overflow-x: hidden;";initializeTable();dijit.byId("quickCartDialog").show()}function createQuickCart(){var A=handleValidate();if(A!="passed"){return }document.body.style.cursor="wait";dojo.xhrPost({url:"/fivestargroup/servlet/ShoppingServlet?action=createquickcart&isAuth="+dojo.byId("isAuthenticated").innerHTML,timeout:12000,handleAs:"xml",mimetype:"text/xml",load:function(C,B){document.body.style.cursor="default";self._loadItemsFromXMLForCreate(C);return C},error:function(C,B){document.body.style.cursor="default";console.log("***AJAX call error status: ",B.xhr.status);if(B.xhr.status==403){dijit.byId("timeoutDialog").show()}return"error"},form:"quickCartForm"})}function validateQuickCart(){document.getElementById("quickcart_result_error").innerHTML="";document.getElementById("quickcart_result_message").innerHTML="";removeEmptyRowFromTable();var A=handleValidate();if(A=="passed"){document.body.style.cursor="wait";dojo.xhrPost({url:"/fivestargroup/servlet/ShoppingServlet?action=validatequickcart&isAuth="+dojo.byId("isAuthenticated").innerHTML,timeout:12000,handleAs:"xml",mimetype:"text/xml",load:function(C,B){document.body.style.cursor="default";self._loadItemsFromXMLForValidate(C);return C},error:function(C,B){document.body.style.cursor="default";console.log("***AJAX call error status: ",B.xhr.status);if(B.xhr.status==403){dijit.byId("timeoutDialog").show()}return"error"},form:"quickCartForm"})}else{return }}function _loadItemsFromXMLForValidate(C){var E=C.getElementsByTagName("item");for(var D=0;D<E.length;D++){var J=E[D].getElementsByTagName("row")[0].firstChild.nodeValue;var F=E[D].getElementsByTagName("itemValidate")[0].firstChild.nodeValue;var G=E[D].getElementsByTagName("quantityValidate")[0].firstChild.nodeValue;var H=E[D].getElementsByTagName("quantityMessage")[0].firstChild.nodeValue;var B=E[D].getElementsByTagName("newQuantity")[0].firstChild.nodeValue;if(F=="N"){document.getElementById("itemValidate"+J).style.display="inline";document.getElementById("itemCheck"+J).style.display="none"}else{document.getElementById("itemValidate"+J).style.display="none";document.getElementById("itemCheck"+J).style.display="inline"}if(G=="N"){document.getElementById("quantityValidate"+J).style.display="inline";document.getElementById("quantityMessage"+J).innerHTML=""}else{if(G=="Y"){document.getElementById("quantityValidate"+J).style.display="none";if(H!="N"){document.getElementById("quantityMessage"+J).innerHTML=H;document.getElementById("quantityRow"+J).value=parseInt(B)}else{document.getElementById("quantityMessage"+J).innerHTML=""}}}}var A=C.getElementsByTagName("isSuccess")[0].firstChild.nodeValue;var I=C.getElementsByTagName("message")[0].firstChild.nodeValue;if(A=="N"){document.getElementById("quickcart_result_error").innerHTML="";document.getElementById("quickcart_result_message").innerHTML="";document.getElementById("createShoppingCartButton").style.display="none"}else{document.getElementById("quickcart_result_message").innerHTML="Validation Passed.";document.getElementById("quickcart_result_error").innerHTML="";document.getElementById("createShoppingCartButton").style.display="inline"}}function _loadItemsFromXMLForCreate(B){var A=B.getElementsByTagName("isSuccess")[0].firstChild.nodeValue;if(A=="N"){var C=B.getElementsByTagName("message")[0].firstChild.nodeValue;document.getElementById("quickcart_result_error").innerHTML=C;document.getElementById("quickcart_result_message").innerHTML=""}else{dojo.byId("main-nav-home").className="";dojo.byId("main-nav-catalog").className="active";dojo.byId("main-nav-management").className="";dojo.byId("main-nav-about").className="";dojo.byId("main-nav-dealer").className="";showHideSubNav("productsSubNav");dojo.byId("wrapper_home").style.display="none";dojo.byId("wrapper_search").style.display="block";dojo.byId("wrapper_order").style.display="none";dojo.byId("wrapper_aboutus").style.display="none";dojo.byId("wrapper_dealer").style.display="none";if(isCatalogSearchFirstTime=="Y"){this.inputitem.keywords="";this.inputitem.venderNum="0";this.inputitem.venderName="ALL";this.inputitem.venderCrumbName="ALL";this.inputitem.catalogClass="000";this.inputitem.catalogName="ALL";this.inputitem.catalogCrumbName="ALL";this.lastFocusNodeId=this.inputitem.catalogClass;dojo.byId("categoryTree").style.display="none";dojo.cookie("fivestar.searchType","KEYWORD");dojo.cookie("fivestar.searchFrom","initial");dojo.cookie("fivestar.keywords",this.inputitem.keywords);dojo.cookie("fivestar.catalogClass",this.inputitem.catalogClass);dojo.cookie("fivestar.catalogName",this.inputitem.catalogName);dojo.cookie("fivestar.catalogCrumbName",this.inputitem.catalogCrumbName);dojo.cookie("fivestar.venderNum",this.inputitem.venderNum);dojo.cookie("fivestar.venderName",this.inputitem.venderName);dojo.cookie("fivestar.venderCrumbName",this.inputitem.venderCrumbName);dojo.publish("searchCatalogInitial",[self.inputitem]);isCatalogSearchFirstTime="N"}dijit.byId("searchResultsFloater").resize({w:680,h:590,t:0,l:0});dijit.byId("itemDetailsFloater").resize({w:0,h:590,t:0,l:0});dijit.byId("shoppingCartFloater").resize({w:240,h:590,t:0,l:700});var D={isDisplayCart:"Y"};dojo.publish("displayCart",[D]);dojo.publish("loadQuickShoppingCart",[B]);dijit.byId("quickCartDialog").hide()}}function addRowToTable(){document.getElementById("quickcart_result_error").innerHTML="";document.getElementById("quickcart_result_message").innerHTML="";document.getElementById("createShoppingCartButton").style.display="none";var H=document.getElementById("tblQuickCart");var M=H.rows.length;var D=M;var L=H.insertRow(M);var K=L.insertCell(0);var C=document.createElement("img");C.id="itemCheck"+D;C.style.cssText="display:none;";C.src="images/check.gif";K.appendChild(C);var C=document.createElement("img");C.id="itemValidate"+D;C.style.cssText="display:none;";C.src="images/x.gif";K.appendChild(C);K.style.cssText="padding: 0 0 0 5px;";var G=L.insertCell(1);var F=document.createElement("span");var E=document.createTextNode(D);F.setAttribute("name","rowNumber");F.appendChild(E);G.appendChild(F);var A=L.insertCell(2);var C=document.createElement("input");C.type="text";C.name="itemRow"+D;C.id="itemRow"+D;C.size=30;C.onchange=onchangeforQuickCart;A.appendChild(C);var I=L.insertCell(3);var C=document.createElement("input");C.type="text";C.name="quantityRow"+D;C.id="quantityRow"+D;C.size=10;C.onchange=onchangeforQuickCart;I.appendChild(C);var B=L.insertCell(4);var C=document.createElement("img");C.id="quantityValidate"+D;C.style.cssText="display:none;";C.src="images/x.gif";B.appendChild(C);var C=document.createElement("span");C.id="quantityMessage"+D;var J=document.createAttribute("class");J.value="errorMessage";C.setAttributeNode(J);B.appendChild(C);B.style.cssText="padding: 0 0 0 5px;"}function onchangeforQuickCart(C,B){document.getElementById("createShoppingCartButton").style.display="none";var A;if(B!=null){A=B.id}else{A=this.id}}function keyPressTest(F,E){var D=document.getElementById("chkValidateOnKeyPress");if(D.checked){var C=document.getElementById("spanOutput");var B;if(window.event){B=window.event.keyCode}else{if(F.which){B=F.which}}var A;if(E!=null){A=E.id}else{A=this.id}C.innerHTML=A+" : "+String.fromCharCode(B)}}function initializeTable(){document.getElementById("quickcart_result_error").innerHTML="";document.getElementById("quickcart_result_message").innerHTML="";document.getElementById("createShoppingCartButton").style.display="none";var B=document.getElementById("tblQuickCart");var A=B.rows.length-1;for(i=A;i>1;i--){B.deleteRow(i)}document.getElementById("itemRow1").value="";document.getElementById("quantityRow1").value="";document.getElementById("itemValidate1").style.display="none";document.getElementById("itemCheck1").style.display="none";document.getElementById("quantityValidate1").style.display="none";document.getElementById("quantityMessage1").innerHTML="";addRowToTable();addRowToTable();addRowToTable();addRowToTable();addRowToTable();addRowToTable();addRowToTable();addRowToTable();addRowToTable()}function removeEmptyRowFromTable(){var D=document.getElementById("tblQuickCart");var B=D.rows.length-1;var C=0;for(i=B;i>0;i--){var G=document.getElementById("itemRow"+i);var E=trim(G.value);var F=document.getElementById("quantityRow"+i);var A=trim(F.value);if(E==""&&A==""){if(!(i==1&&C==0)){D.deleteRow(i)}}else{C++}}changeRowId()}function changeRowId(){var E=document.getElementById("tblQuickCart");var F;if(E&&(F=E.rows)){for(var C=0,H=F.length;C<H;++C){var B=F[C].getElementsByTagName("INPUT");var D=F[C].getElementsByTagName("SPAN");var G=F[C].getElementsByTagName("IMG");for(var A=0;A<D.length;A++){if(D.item(A).getAttribute("name")=="rowNumber"){D.item(A).innerHTML=C}else{if(D.item(A).id.indexOf("quantityMessage")==0){D.item(A).id="quantityMessage"+C}}}for(var A=0;A<B.length;A++){if(B.item(A).name.indexOf("itemRow")==0){B.item(A).id="itemRow"+C;B.item(A).name="itemRow"+C}else{if(B.item(A).name.indexOf("quantityRow")==0){B.item(A).id="quantityRow"+C;B.item(A).name="quantityRow"+C}}}for(var A=0;A<G.length;A++){if(G.item(A).id.indexOf("itemCheck")==0){G.item(A).id="itemCheck"+C}else{if(G.item(A).id.indexOf("itemValidate")==0){G.item(A).id="itemValidate"+C}else{if(G.item(A).id.indexOf("quantityValidate")==0){G.item(A).id="quantityValidate"+C}}}}}}}function removeRowFromTable(){document.getElementById("quickcart_result_error").innerHTML="";document.getElementById("quickcart_result_message").innerHTML="";var B=document.getElementById("tblQuickCart");var A=B.rows.length;if(A>2){B.deleteRow(A-1)}}function handleValidate(){var D=document.getElementById("tblQuickCart");var C=D.rows.length-1;var B;for(B=1;B<=C;B++){var G=document.getElementById("itemRow"+B);var E=trim(G.value);var F=document.getElementById("quantityRow"+B);var A=trim(F.value);if(E==""&&A==""&&C==1){document.getElementById("quickcart_result_error").innerHTML="Please enter at least one item number.";document.getElementById("quickcart_result_message").innerHTML="";document.getElementById("createShoppingCartButton").style.display="none";return }}return"passed"}