
vjo.ctype("vjo.darwin.pres.buying.cmp.shippingrates.CountrySelect").needs("vjo.dsf.Element").protos({constructs:function(_1,_2,_3,_4){this.sObjType="CountrySelectHandler";this.z=_4;this.sZipBx=_3;this.sZipCode=_2;this.sCountry=_1;},handle:function(_5){var _6=vjo.dsf.Element;var _7=_6.get(this.sZipCode);var _8=_6.get(this.sCountry);var _9=_6.get("shQuantity");var c=_8.options[_8.selectedIndex].value;var z=this.z;var _c=_6.get(this.sZipBx);var _d=_6.get("zipCodeMsg");var _e=_6.get("shZipError");var _f=_6.get("zipArrowImg");var _10=_6.get("clZipError");var _11=_6.get("clZipArrowimg");if(_c){_c.value="";}
if(_9&&_8){if(c==="0"){_9.disabled=true;_9.value="1";}else{_9.disabled=false;}}
var _12=true;if(z){for(var i=0,zl=z.length;i<zl;i++){var _14=z[i].split(",");if(c==_14[0]&&_14[1]=="1"){_12=false;break;}}}
if(_7){if(_12===true){_7.style.display="none";_c.style.display="none";_c.disabled=true;_c.style.backgroundColor="#CCCCCC";if(_d){_d.style.display="none";}
if(_e&&_c.id==="shPostalCode"){_e.style.display="none";_f.style.display="none";}
if(_10&&_c.id==="clPostalCode"){_10.style.display="none";_11.style.display="none";}}else{_7.style.display="inline";_c.style.display="inline";_c.disabled=false;_c.style.backgroundColor="#FFFFFF";}}}}).endType();

vjo.ctype("vjo.darwin.pres.buying.cmp.shippingrates.UpdateHiddenFields").needs("vjo.dsf.Element").protos({constructs:function(_1,_2){this.sHidden=_1;this.sElems=_2;},handle:function(_3){var _4=vjo.dsf.Element;this.updateElems(this.sHidden,this.sElems);},updateElems:function(_5,_6){var _7=vjo.dsf.Element,hE,dE;for(var i=0,el=_6.length;i<el;i++){hE=_7.get(_5[i]);dE=_7.get(_6[i]);if(dE&&dE.type==="select-one"&&hE){if(hE.value===""){hE.value=dE.selectedIndex;}else{dE.selectedIndex=hE.value;}}else{if(dE&&dE.type==="text"&&hE){dE.disabled=hE.disabled;dE.style.backgroundColor=hE.style.backgroundColor;dE.value=hE.value;}}}}}).endType();

vjo.ctype("vjo.darwin.pres.buying.cmp.shippingrates.OnEnterUpdate").needs(["vjo.dsf.Element","vjo.dsf.client.Browser"]).protos({constructs:function(_1){this.sObjType="OnEnterUpdateHandler";this.sGetRateId=_1;},handle:function(_2){var _3=vjo.dsf.Element;var _4=vjo.dsf.client.Browser;var _5=0;if(_4.bIE){_5=window.event.keyCode;}else{if(_4.bFirefox){_5=_2.nativeEvent.keyCode;}}
if(_5==13){var _6=vjo.dsf.Element.get(this.sGetRateId);var aE=new vjo.dsf.Event(_6,"click",_2.nativeEvent);vjo.dsf.EventDispatcher.process(this.sGetRateId,aE);}}}).endType();

vjo.ctype("vjo.darwin.pres.buying.cmp.shippingrates.ShippingRequest").needs(["vjo.Registry","vjo.dsf.Element"]).protos({constructs:function(_1,_2,_3,_4,_5,_6,_7,_8){this.sObjType="ShippingServiceReqHandler";this.sSvcId=_1;this.sRequest=_1+_2;this.sMode=_3;this.sCountry=_4;this.sQuantity=_5;this.sZipCode=_6;this.sItemId=_7;this.sbtn=_8;this.szipDiv="shZipCode";this.E=vjo.dsf.Element;},handle:function(_9){if(this.sMode===0){this.request(this.sRequest);}
if(this.sMode==1){var _a=this.E.get(this.sCountry);var _b=this.E.get(this.sQuantity);if(_a!==null){var c=_a.options[_a.selectedIndex].value;}
var q=1;if(_b){q=_b.value;}
q=this.validate(q,false);var _e=this.sSvcId;_e+="quantity"+"="+q;if(_a!==null){_e+="&"+_a.name+"="+c;}
_e+="&"+"item="+this.sItemId+"&"+"mode="+this.sMode+"&"+"btn="+this.sbtn;var _f=this.E.get(this.sZipCode);var _10=this.E.get(this.szipDiv);var z="";if(_f){z=_f.value;}
z=this.validate(z,true);_e+="&"+"zipCode"+"="+z;if(_a===null&&z===""){return;}
this.request(_e);}},validate:function(str,_13){var _14;_14="`()(\\~!@^&*+\"|%:=,<>";for(var i=0,sl=str.length;i<sl;i++){for(var j=0,spl=_14.length;j<spl;j++){if(str.charAt(i)===_14.charAt(j)){if(_13===true){str="@";break;}else{str="1";break;}}}}
return str;},request:function(url){var _18=vjo.darwin.pres.buying.cmp.shippingrates.ShippingResponse;var req=new vjo.dsf.assembly.VjClientAssemblerRequest(url,this.handleResponse,this,"cb",false);vjo.dsf.assembly.VjClientAssembler.load(req);},resetTextValue:function(z,v){if(z){var _1c=this.E.get(this.sCountry);if(z.disabled===true&&_1c===0){z.value="1";}else{z.value=v;}}},handleResponse:function(_1d){if(!_1d){return;}
var _1e=_1d;var _1f=_1e.contentList;var _20=_1e.layerList;var _21=_1e.item;var _22=vjo.dsf.Element;var _23=_1e.discountSection;var _24=_1e.shipType;var _25=_1e.mode;var _26=_22.get(_1e.panelDiv);var _27=_1e.changeLocSection;var _28=_1e.shippingAvailable;var _29=_1e.shippingError;var _2a=_1e.shippingErrorSupported;var _2b=_1e.shippingServiceSection;var _2c=_1e.serviceLinks;var _2d=_1e.seeMoreServicesDetails;var _2e=_1e.serviceCount;for(var i=0,cl=_1f.length;i<cl;i++){var e=_22.get(_20[i]);var C=vjo.dsf.client,B=C.Browser;if(e){e.innerHTML=_1f[i];if(_1f[i]===""){e.style.display="none";if(_28===false&&_24==1){if(_22.get(_27[1])!==null&&_22.get(_27[2])!==null){(_22.get(_27[1])).style.display="none";(_22.get(_27[2])).style.display="none";}}}else{if(e.id==="fshippingCost"||e.id==="fshippingSvc"){e.style.display="inline";}else{if(e.id==="qtyArrowImg"||e.id==="zipArrowImg"){e.style.display="inline";}else{e.style.display="block";}}}
if(e.id===_23[0]&&e.innerHTML===""&&_22.get(_23[1])!==null){(_22.get(_23[1])).style.display="none";}else{if(e.id===_23[0]&&e.innerHTML!==""){(_22.get(_23[1])).style.display="inline";}}
if(e.id===_27[0]&&e.innerHTML===""){(_22.get(_27[1])).style.display="none";}else{if(e.id===_27[0]&&e.innerHTML!==""){if(_29===true){if(_24==1){(_22.get(_27[1])).style.display="none";(_22.get(_27[2])).style.display="none";}else{(_22.get(_27[1])).style.display="inline";(_22.get(_27[2])).style.display="block";if(_2a===true){(_22.get(_2b[1])).style.display="block";}else{(_22.get(_2b[1])).style.display="none";}}}else{if(_28===true){(_22.get(_27[1])).style.display="inline";(_22.get(_27[2])).style.display="block";(_22.get(_2b[1])).style.display="block";}else{(_22.get(_27[1])).style.display="none";(_22.get(_27[2])).style.display="none";}}}}}}
if(_2d===true){if(_22.get("fshippingCost")!==null){_22.get("fshippingCost").style.display="none";}
if(_22.get("changeLocLink")!==null){_22.get("changeLocLink").firstChild.innerHTML=_2c[0];}
if(_2e>=1&&_22.get(_27[1])!==null){_22.get(_27[1]).style.display="inline";_22.get(_27[2]).style.display="block";}}else{if(_2d===false){if(_22.get("fshippingCost")!==null){_22.get("fshippingCost").style.display="inline";}
if(_22.get("changeLocLink")!==null){_22.get("changeLocLink").firstChild.innerHTML=_2c[1];}}}
if(_1e.ajaxBtn==="shGetRates"){this.resetTextValue(_22.get("shPostalCode"),_1e.zipcode);this.resetTextValue(_22.get("shQuantity"),_1e.quantity);for(var j=0,pl=_1e.panelElems.length;j<pl;j++){var _33=_22.get(_1e.panelElems[j]);var _34=_22.get(_1e.parentPageElems[j]);if(_34!==null&&_33!==null&&_34.type==="select-one"){_33.selectedIndex=_34.selectedIndex;}else{if(_34!==null&&_33!==null&&_34.type==="text"){_33.disabled=_34.disabled;_33.value=_34.value;if(_33.disabled===true){_33.style.backgroundColor="#CCCCCC";}else{if(_33.disabled===false){_33.style.backgroundColor="#FFFFFF";}}}}}}else{if(_1e.ajaxBtn==="clGetRates"){this.resetTextValue(_22.get("clPostalCode"),_1e.zipcode);for(var z=0,pl=_1e.parentPageElems.length;z<pl;z++){var _36=_22.get(_1e.panelElems[z]);var _37=_22.get(_1e.parentPageElems[z]);if(_36!==null&&_37!==null&&_36.type==="select-one"){_37.selectedIndex=_36.selectedIndex;}else{if(_36!==null&&_37!==null&&_36.type==="text"){_37.disabled=_36.disabled;_37.value=_36.value;if(_37.disabled===true){_37.style.backgroundColor="#CCCCCC";if(_37.id==="shPostalCode"){_37.style.display="none";_22.get("shZipCodeTextDiv").style.display="none";}}else{if(_37.disabled===false){_37.style.backgroundColor="#FFFFFF";if(_37.id==="shPostalCode"){_22.get("shZipCode").style.display="inline";_37.style.display="inline";_22.get("shZipCodeTextDiv").style.display="inline";}}}}}}}}
this.updateHiddenElems(_1e.parentPageElems);var _38=_1e.elementDetails;var _39=_1e.zipCountries;if(_38){for(var k=0,el=_38.length;k<el;k++){var _3b=_38[k];var _3c;try{if(_3b[0]=="AJAX"){_3c=new vjo.darwin.pres.buying.cmp.shippingrates.ShippingRequest(this.sSvcId,null,_3b[6],_3b[3],_3b[4],_3b[5],this.sItemId,_3b[2]);}
if(_3b[0]=="JS"){_3c=new vjo.darwin.pres.buying.cmp.shippingrates.CountrySelect(_3b[2],_3b[3],_3b[4],_39);}
if(_3b[0]=="ONENTERCALL"){_3c=new vjo.darwin.pres.buying.cmp.shippingrates.OnEnterUpdate(_3b[3]);}
vjo.dsf.EventDispatcher.detachHandlers(_3b[2],_3b[1]);vjo.dsf.EventDispatcher.add(_3b[2],_3b[1],_3c);}
catch(exc){}}}
if(_26){if(_24==1){_26.style.display="none";}else{_26.style.display="block";}}},updateHiddenElems:function(_3d){var _3e=vjo.dsf.Element;var hZ=_3e.get("hiddenZipCode");var hQ=_3e.get("hiddenQuantity");var hC=_3e.get("hiddenCountry");for(var p=0,pl=_3d.length;p<pl;p++){var _43=_3e.get(_3d[p]);if(_43&&_43.type==="select-one"){hC.value=_43.selectedIndex;}else{if(_43&&_43.type==="text"&&_43.id==="shPostalCode"){hZ.value=_43.value;hZ.disabled=_43.disabled;hZ.style.backgroundColor=_43.style.backgroundColor;}else{if(_43&&_43.type==="text"&&_43.id==="shQuantity"){hQ.value=_43.value;}}}}}}).endType();

vjo.ctype("vjo.darwin.pres.buying.cmp.shippingrates.ShippingResponse").needs(["vjo.dsf.Element","vjo.dsf.Message","vjo.darwin.pres.buying.cmp.shippingrates.ShippingRequest"]).satisfies("vjo.dsf.common.IJsRespHandler").protos({constructs:function(_1,_2){this.sObjType="ShippingServiceResHandler";this.sServiceId=_1;this.sItem=_2;},handleResponse:function(_3){if(!_3.response||_3.response.errors.length>0){return;}
var _4=_3.response.data;var _5=_4.contentList;var _6=_4.layerList;var _7=_4.item;var _8=vjo.dsf.Element;var _9=_4.discountSection;for(var i=0,cl=_5.length;i<cl;i++){var e=_8.get(_6[i]);var C=vjo.dsf.client,B=C.Browser;if(e){e.innerHTML=_5[i];if(B.bMsie){e.style.display="blank";}else{if(B.bFirefox){e.style.display="block";}}
if(e.id===_9[0]&&e.innerHTML===""){(_8.get(_9[1])).style.display="none";}else{if(e.id===_9[0]&&e.innerHTML!==""){(_8.get(_9[1])).style.display="inline";}}}}
if(_4.ajaxBtn==="shGetRates"){for(var j=0,pl=_4.panelElems.length;j<pl;j++){var _e=_8.get(_4.panelElems[j]);var _f=_8.get(_4.parentPageElems[j]);if(_f!==null&&_f.type==="select-one"){_e.selectedIndex=_f.selectedIndex;}else{if(_f!==null&&_f.type==="text"){_e.disabled=_f.disabled;_e.value=_f.value;}}}}else{if(_4.ajaxBtn==="clGetRates"){for(var z=0,pl=_4.parentPageElems.length;z<pl;z++){var _11=_8.get(_4.panelElems[z]);var _12=_8.get(_4.parentPageElems[z]);if(_11!==null&&_11.type==="select-one"){_12.selectedIndex=_11.selectedIndex;}else{if(_11!==null&&_11.type==="text"){_12.disabled=_11.disabled;_12.value=_11.value;}}}}}
var _13=_4.elementDetails;var _14=_4.zipCountries;if(_13){for(var k=0,el=_13.length;k<el;k++){var _16=_13[k];var _17;try{if(_16[0]=="AJAX"){_17=new vjo.darwin.pres.buying.cmp.shippingrates.ShippingRequest(this.sServiceId,null,_16[6],_16[3],_16[4],_16[5],this.sItem,_16[2]);}
if(_16[0]=="JS"){_17=new vjo.darwin.pres.buying.cmp.shippingrates.CountrySelect(_16[2],_16[3],_14);}
vjo.dsf.EventDispatcher.detachHandlers(_16[2],_16[1]);vjo.dsf.EventDispatcher.add(_16[2],_16[1],_17);}
catch(exc){}}}}}).endType();

vjo.ctype("vjo.darwin.pres.buying.cmp.shippingrates.FreightRate").needs(["vjo.dsf.Element","vjo.dsf.window.utils.VjWindowUtils"]).protos({constructs:function(_1,_2,_3,_4,_5){this.sURL=_1;this.sZipId=_2;this.sLocationId=_3;this.sChkBox=_4;this.sHidden=_5;},handle:function(_6){var _7=vjo.dsf.Element;var _8=_7.get(this.sLocationId);var _9=_8.options[_8.selectedIndex].value;var _a=(_7.get(this.sZipId)).value;if(_a===""){_a=this.sHidden;}
var _b=this.sURL+"&"+"destinationZipCode="+_a+"&"+"deliveryLocation="+_9;if(_7.get(this.sChkBox).checked){_b=_b+"&"+"deliveryInsideBuilding=on";}
vjo.dsf.window.utils.VjWindowUtils.openWindow(_b,"freightShipping","height="+800+",width="+620+",scrollbars=no,status=no,toolbar=no,menubar=no,location=no,resizable=no,titlebar=no");}}).endType();

vjo.ctype("vjo.darwin.core.pageleveltab.PageLevelTab").protos({sHtmlName:null,sactiveRgt:null,sactiveLft:null,shighlightLft:null,shighlightRgt:null,sinactiveLft:null,sinactiveRgt:null,shoverLft:null,shoverRgt:null,stabcontentOuterOff:null,stabcontentOuterOn:null,sContentElementId:null,sActiveBkgColor:null,aTabs:[],iCurrTab:0,hon:false,constructs:function(_1){var t=_1,o=this;o.sHtmlName=t.htmlName;o.sactiveRgt=t.activeRgt;o.sactiveLft=t.activeLft;o.shighlightLft=t.highlightLft;o.shighlightRgt=t.highlightRgt;o.sinactiveLft=t.inactiveLft;o.sinactiveRgt=t.inactiveRgt;o.shoverLft=t.hoverLft;o.shoverRgt=t.hoverRgt;o.stabcontentOuterOff=t.tabcontentOuterOff;o.stabcontentOuterOn=t.tabcontentOuterOn;o.sContentElementId=null;o.sActiveBkgColor=t.activeBkgColor;o.aTabs=[];o.iCurrTab=t.activeTabId;o.hon=t.hoverOn;}}).endType();

vjo.ctype("vjo.darwin.core.pageleveltab.TopTabNav").needs("vjo.Registry","RE").needs("vjo.dsf.EventDispatcher","ED").protos({sTbNm:null,sId:null,pdmjs:null,constructs:function(_1,_2,_3,_4,_5){var t=this,J=t.vj$,to=-1,f=function(_7){t.openMenu(_7,_5);};t.sTbNm=_1;t.sId=_4;t.pdmjs=J.RE.get(_2);J.ED.add(_3,"mouseover",f);J.ED.add(_3,"mouseout",f);},openMenu:function(_8,ti){var t=this,id=-1,pTab=vjo.Registry.get(t.sTbNm),pArr=pTab.aTabs;for(var i=0;i<pArr.length;i++){if(pArr[i].iId==ti){id=i;break;}}
if(pArr[id].dsbl==false){if(_8.eventType=="mouseover"){t.pdmjs.appear(_8,t.sId);}else{t.pdmjs.onMouseoutClose(_8);}}}}).endType();

// en_MY/e685i/BuyingApp_ViewItemShipping_e685i11910378_6_en_MY
// b=11910378
