/*
 * Smart Window scripts 0.1
 * Copyright(c) 2008, Conduit IT.
 * 
 */


var $_SmartWin=function(){this.addEvents("datarequest","datareceived","dataerror");$_SmartWin.superclass.constructor.call(this);};Ext.extend($_SmartWin,Ext.util.Observable,{trackerCode:"addtocart",_rootUrl:"",_scriptProxyOn:false,_gateway:"json.php?target=smart_win_gateway",_gatewayConfig:{"prodDetail":{"detail":{"gateway":null,"method":"getProductDetail","extraParams":{"params[include_options]":1,"params[include_related]":0,"params[include_specs]":1,"params[include_features]":1,"params[include_related_count]":1,"params[image_size]":"image2"}},"option":{"gateway":null,"method":"getProductDetail","extraParams":{"params[include_specs]":1,"params[include_features]":1,"params[include_related_count]":1,"params[image_size]":"image2"}},"related":{"gateway":null,"method":"getRelatedProducts","extraParams":{"params[include_options]":1,"params[limit]":9,"params[image_size]":"image"}},"add2Order":{"gateway":"json.php?target=cart_gateway","method":"addProductToCart","extraParams":{"condition_id":0}},"seeAlso":{"gateway":"json.php?target=epc_b2c_gateway","method":"getBomItemSeeAlso"},"seeAlsoProd":{"gateway":"json.php?target=epc_b2c_gateway","method":"getProductSeeAlsoManuals"},"canSeeNotes":{"gateway":"json.php?target=epc_b2c_gateway","method":"canViewProductNotes"},"notes":{"gateway":"json.php?target=epc_b2c_gateway","method":"getProductNotes"},"noteTypes":{"gateway":"json.php?target=epc_b2c_gateway","method":""},"getNote":{"gateway":"json.php?target=epc_b2c_gateway","method":"getProductNote"},"saveNote":{"gateway":"json.php?target=epc_b2c_gateway","method":"addProductNote"},"deleteNote":{"gateway":"json.php?target=epc_b2c_gateway","method":"deleteNote"},"canSeeBulletins":{"gateway":"json.php?target=epc_b2c_gateway","method":"areProductBulletins"},"bulletinlist":{"gateway":"json.php?target=epc_b2c_gateway","method":"getAllBoundArticles"},"bulletin":{"gateway":"json.php?target=epc_b2c_gateway","method":"getArticleDetail"},"bulletinattach":{"gateway":"json.php?target=epc_b2c_gateway","method":"getObjectAttachments"},"cookieDealer":{"gateway":"json.php?target=epc_b2c_gateway","method":"findCookieDealer"},"addBookmark":{"gateway":null,"method":"addBookMark","extraParams":{"namespaces[store]":"webstore","namespaces[epc]":"epc"}}},"add2OrdOpts":{"orderlist":{"gateway":null,"method":"genAddToCartList","extraParams":{}},"detail":{"gateway":null,"method":"getProductDetail","extraParams":{"params[include_options]":1,"params[include_related]":0,"params[include_specs]":1,"params[include_features]":1,"params[include_related_count]":1,"params[image_size]":"image2"}},"option":{"gateway":null,"method":"getProductDetail","extraParams":{"params[include_specs]":1,"params[include_features]":1,"params[include_related_count]":1,"params[image_size]":"image2"}},"related":{"gateway":null,"method":"getRelatedProducts","extraParams":{"params[include_options]":1,"params[limit]":6,"params[image_size]":"image"}},"add2Order":{"gateway":"json.php?target=cart_gateway","method":"addProductToCart","extraParams":{"condition_id":0}},"addBulk2Order":{"gateway":"json.php?target=cart_gateway","method":"addBulkProductsToCart"},"seeAlso":{"gateway":"json.php?target=epc_b2c_gateway","method":"getBomItemSeeAlso"},"seeAlsoProd":{"gateway":"json.php?target=epc_b2c_gateway","method":"getProductSeeAlsoManuals"},"canSeeNotes":{"gateway":"json.php?target=epc_b2c_gateway","method":"canViewProductNotes"},"notes":{"gateway":"json.php?target=epc_b2c_gateway","method":"getProductNotes"},"noteTypes":{"gateway":"json.php?target=epc_b2c_gateway","method":""},"getNote":{"gateway":"json.php?target=epc_b2c_gateway","method":"getProductNote"},"saveNote":{"gateway":"json.php?target=epc_b2c_gateway","method":"addProductNote"},"deleteNote":{"gateway":"json.php?target=epc_b2c_gateway","method":"deleteNote"},"canSeeBulletins":{"gateway":"json.php?target=epc_b2c_gateway","method":"areProductBulletins"},"bulletinlist":{"gateway":"json.php?target=epc_b2c_gateway","method":"getAllBoundArticles"},"bulletin":{"gateway":"json.php?target=epc_b2c_gateway","method":"getArticleDetail"},"bulletinattach":{"gateway":"json.php?target=epc_b2c_gateway","method":"getObjectAttachments"},"cookieDealer":{"gateway":"json.php?target=epc_b2c_gateway","method":"findCookieDealer"},"addBookmark":{"gateway":null,"method":"addBookMark","extraParams":{"namespaces[store]":"webstore","namespaces[epc]":"epc"}}}},_windowClass:{"prodDetail":"Product","add2OrdOpts":"Add2Order"},_windowConfig:{"prodDetail":{"orderBarLoc":"b-r","closeBtnLoc":"l","closeAfterAdd":false,"prodDetailShowLoad":true,"seeAlsoOpenLinksInNewWindow":false,"paramMap":{"sku":"sku","qty":"quantity","catalog_code":"superceding_product_group","vendor_code":"superceding_vendor"},"placeDims":{"target":null,"width":600,"tx":null,"ty":null,"tw":false,"maxWidth":0},"detailCols":[{availHeight:400,columnWidth:0.65,resizeToFill:false},{availHeight:400,columnWidth:0.35,resizeToFill:false}],"detailComps":[{type:"info",col:1,colHeight:0.5},{type:"tabs",col:1,colHeight:0.5},{type:"price",col:2,colHeight:0.45},{type:"options",col:2,colHeight:0.55},{type:"super",col:2,height:30},{type:"superceded",col:2,height:30}],"relatedProdLoc":"b","relatedProd":{"cells":3,"optOverlay":2,"height":180,"hideTitle":false,"hideIfNone":true,"fadeIn":"increment"},"supercess":{"height":200,"hideTitle":false,"highLiteOn":true,"hideSupercessionLinks":false,"redirectToNewPart":false},"superceded":{"height":200,"hideTitle":false,"highLiteOn":false},"prodInfo":{"includeImage":true,"allowImageZoom":true,"includeSubhd":true,"includeDischd":true,"hdField":"display_name","descField":"full_description","subHdField":"product","discHdField":"product_note","includePrice":true,"includeWeight":false,"includeDims":false},"prodTabs":{"includeDesc":false,"descField":"full_description","includeFeatures":true,"includeSpecs":true,"includeSeeAlso":false,"includeNotes":false,"includeBulletins":false},"includeBookmarking":false,"includeDealerLocator":false,"noteWindow":{"includeNoteTypes":false,"includeGlobalCheck":false}},"add2OrdOpts":{"layoutHeight":560,"orderBarLoc":null,"submitBarLoc":"r","closeBtnLoc":"l","closeAfterAdd":true,"prodDetailShowLoad":true,"useShowConditions":false,"paramMap":{"sku":"sku","qty":"quantity","catalog_code":"superceding_product_group","vendor_code":"superceding_vendor"},"placeDims":{"target":null,"width":600,"tx":null,"ty":null,"tw":false,"maxWidth":0},"detailCols":[{availHeight:380,columnWidth:1,resizeToFill:true},{availHeight:380,width:225,resizeToFill:true}],"detailComps":[{type:"info",col:1,colHeight:0.45},{type:"tabs",col:1,colHeight:0.55},{type:"price",col:2,colHeight:0.5},{type:"options",col:2,colHeight:0.5},{type:"qty",col:2,height:30},{type:"super",col:2,height:30}],"orderListLoc":"l","orderList":{"height":560,"width":225,"hideTitle":false,"highLiteOn":true,"hdField":"bom_item_name"},"relatedProdLoc":"b","relatedProd":{"cells":2,"optOverlay":2,"height":180,"hideTitle":false,"hideIfNone":false,"fadeIn":"full"},"supercess":{"height":200,"hideTitle":false,"highLiteOn":true,"hideSupercessionLinks":false,"redirectToNewPart":false},"superceded":{"height":200,"hideTitle":false,"highLiteOn":false},"prodInfo":{"includeImage":true,"allowImageZoom":true,"includeDesc":false,"includeSubhd":true,"includeDischd":true,"hdField":"display_name","descField":"full_description","subHdField":"product","discHdField":"product_note","includePrice":true,"includeWeight":false,"includeDims":false},"prodTabs":{"includeDesc":true,"descField":"full_description","includeFeatures":true,"includeSpecs":true,"includeSeeAlso":false,"includeNotes":false,"includeBulletins":false},"includeBookmarking":false,"includeDealerLocator":false,"noteWindow":{"includeNoteTypes":false,"includeGlobalCheck":false}}},_cartDisplayConfig:{"amountElId":"cartAmount","totalElId":"cartSubTotal","cartElId":"topmenu-cartinfo-viewcartlink","checkOutElId":"topmenu-cartinfo-checkoutlink","cartInActCls":["inactive","ws-inactive"],"checkOutInActCls":["inactive","ws-inactive"]},_viewPortMeth:{fn:null,obj:null},_noImageUrl:"image.php?image_id=0",_windows:{"prodDetail":null,"add2OrdOpts":null},_imgZoom:null,_historyListen:false,_lang:{label:{qty:"Qty: ",sku:"Product No: ",price:"Price: ",list_price:"List Price: ",your_price:"Your Price: ",weight:"Weight: ",weight_dimension:"lbs.",length:"Length: ",length_dimension:"inches",width:"Width: ",width_dimension:"inches",height:"Height: ",height_dimension:"inches"},button:{add_to_order:"Add to Order",add_parts_to_order:"Add These Parts To Order",rel_add_to_order:"+ to Order",new_note:"New Note",select:"Select",pick_option:"Pick Option",next:"Next",previous:"Previous",close:"Close",del:"Delete",unDel:"Undo Delete",update:"Update",change_item:"[ change ]",zoom:"Zoom",selectSuper:"[ select these products ]",selectSuperceded:"[ select these products ]",bookmark:"Bookmark",save:"Save",cancel:"Cancel"},title:{product_detail_win:"Product Information",add_order_opts_win:"Add To Order Options",description:"Description",other_options:"Alternate Parts",other_options_single:"Alternate Parts [ 1 option ]",other_options_multi:"Alternate Parts [ {0} options ]",select_qty:"Select Quantity and Add to Order:",select_option_and_qty:"Select an option and quantity:",related_parts:"Related Parts",related_parts_prod_name:"Related Parts for {0}",order_list:"Update Quantities / Options for Order Items",prod_supercession:"This Product has been Superceded",prod_superceded:"Product Supercession",see_also:"See Also",notes:"Notes",error:"Error",success:"Success",bookmark:"Bookmark"},msg:{no_product_info:"&nbsp;",no_options:"No Options Available",no_related_parts:"No Related Parts Available",no_order_items:"No Order Items Available",no_supercession_items:"No Supercession Items Available",no_superceded_items:"No Superceding Items Available"},wait:{adding_to_order:"Adding to Order",loading_order_items:"Loading...",loading_related_prods:"Loading...",loading_prod_detail:"Loading...",processing_order_items:"Processing..."},error:{product_does_not_exist:"That product was not found in our system",no_order_items:"No products could found to match those order items"},tracker:{addtocart:"addtocart",addProdFormat:"{0} ({1})"}},setPrimaryGateway:function(_1){if(_1){this._gateway=_1;}},getPrimaryGateway:function(){return this._rootUrl+this._gateway;},setScriptProxyOn:function(_2){this._scriptProxyOn=_2?true:false;if(this._scriptProxyOn&&typeof Ext.data.ScriptTagJsonStore=="undefined"){Ext.data.ScriptTagJsonStore=function(_3){_3.proxy=new Ext.data.ScriptTagProxy(_3);_3.reader=new Ext.data.JsonReader(_3,_3.fields);Ext.data.ScriptTagJsonStore.superclass.constructor.call(this,_3);};Ext.extend(Ext.data.ScriptTagJsonStore,Ext.data.Store,{});}},getScriptProxyOn:function(){return this._scriptProxyOn;},setRootURL:function(_4){this._rootUrl=_4;},getRootURL:function(){return this._rootUrl;},setNoImageURL:function(_5){if(_5){this._noImageUrl=_5;}},getNoImageURL:function(){return this._rootUrl+this._noImageUrl;},updateWinConfig:function(_6,_7,_8){var o=this._windowConfig[_6];if(o&&Ext.type(_7)=="object"){if(_8){o=o[_8];}
if(o){o=Ext.apply(o,_7);}}},getWindowConfig:function(_a,_b){var o=this._windowConfig[_a];if(o){if(_b){return o[_b];}
return o;}
return false;},displayProdWin:function(_d,_e){_d=_d?_d:{};var o=this.prepParamObj(_d,"prodDetail",(Ext.isArray(_e)?_e:["product_id,sku,ses_has_assemblies_bound"]));if(!o){return;}
var win=this._genWindow("prodDetail");if(win){win.loadData(o);}},displayAdd2OrderWin:function(_11,_12){var a=this.prepParamObj(_11,"add2OrdOpts",(Ext.isArray(_12)?_12:["product_id,sku,ses_has_assemblies_bound"]));if(!Ext.isArray(a)||!a.length){return;}
var win=this._genWindow("add2OrdOpts");if(win){win.loadData(a);}},closeActiveWindows:function(){if(this._windows){var i;for(i in this._windows){try{if(this._windows[i].isVisible()){this._windows[i].hide();}}
catch(e){}}}},prepParamObj:function(_16,_17,_18){if(this._windowConfig[_17]){var r;if(Ext.isArray(_18)){var l=_18.length;var i,a;r=[];for(i=0;i<l;i++){a=_18[i].split(",");if(a.length>1){r.push(a);}else{if(a[0]){r.push(a[0]);}}}}
if(Ext.isArray(_16)){var a=[];var i,o;var l=_16.length;for(i=0;i<l;i++){o=this._prepParamObj(_16[i],this._windowConfig[_17].paramMap,r);if(o){a.push(o);}}
return a;}else{if(Ext.type(_16)=="object"){return this._prepParamObj(_16,this._windowConfig[_17].paramMap,r);}}}
return false;},_prepParamObj:function(obj,_1f,_20){if(obj){var b,v;var o={};var i,j,l,k;for(i in _1f){o[i]=obj[_1f[i]];}
if(Ext.isArray(_20)){v=true;l=_20.length;for(i=0;i<l;i++){if(Ext.isArray(_20[i])){k=_20[i].length;for(j=0;j<k;j++){if(o[_20[i][j]]){break;}
if(j==(k-1)){v=false;}}}else{if(!o[_20[i]]){v=false;}}}
b=v;}else{b=true;}
if(b){return o;}}
return false;},_genWindow:function(_28){this._setHistoryListener();if(this._windows[_28]){return this._windows[_28];}
if(this._windowClass[_28]){var win=new SmartWin.window[this._windowClass[_28]](this._windowConfig[_28]);this._windows[_28]=win;return win;}
return false;},_setHistoryListener:function(){if(!this._historyListen){try{Ext.History.on("change",this.closeActiveWindows,this);this._historyListen=true;}
catch(e){}}},langLookup:function(key,_2b,_2c){try{if(_2b){return(this._lang[_2b][key]?this._lang[_2b][key]:_2c);}
return(this._lang[key]?this._lang[key]:_2c);}
catch(e){return _2c;}},updateLang:function(_2d,_2e){try{if(_2e){if(!this._lang[_2e]){this._lang[_2e]={};}
this._lang[_2e]=Ext.apply(this._lang[_2e],_2d);}else{this._lang=Ext.apply(this._lang,_2d);}}
catch(e){}},setViewportSizeMethod:function(_2f,_30){this._viewPortMeth={fn:_2f,obj:_30};},getViewportSize:function(){var _31=[0,0];if(this._viewPortMeth["fn"]){_31=(this._viewPortMeth["obj"])?this._viewPortMeth["obj"][this._viewPortMeth["fn"]]():this._viewPortMeth["fn"]();}else{_31=this._getViewportSize();}
return _31;},_getViewportSize:function(){var _32=[0,0];try{if(typeof window.innerWidth!="undefined"){_32=[window.innerWidth,window.innerHeight];}else{if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){_32=[document.documentElement.clientWidth,document.documentElement.clientHeight];}else{var b=Ext.getBody();_32=[b.getWidth(),b.getHeight()];}}}
catch(e){}
return _32;},_validateEvent:function(_34){if(!this.hasListener(_34)){this.addEvents(_34);}},updateGatewayConfig:function(_35,_36,_37){var o=this._gatewayConfig[_35];if(o&&Ext.type(_36)=="object"){if(_37){o=o[_37];}
if(o){o=Ext.apply(o,_36);}}},getGatewayConfig:function(_39,_3a,_3b){var o=this._gatewayConfig[_39];if(o&&_3a){return(o[_3a]?o[_3a]:_3b);}
return o;},formatRequestParams:function(_3d,_3e){var o={};if(Ext.type(_3d)=="object"&&Ext.type(_3e)=="string"){var i;for(i in _3d){o[String.format(_3e,i)]=_3d[i];}}
return o;},formatArrayForRequest:function(_41,_42){var o={};if(Ext.isArray(_41)&&Ext.type(_42)=="string"){var i,l=_41.length;for(i=0;i<l;i++){o[String.format(_42,i)]=_41[i];}}
return o;},requestData:function(_46){if(Ext.type(_46)!="object"){return;}
var _47=this._gatewayConfig[_46["group"]];if(!_47){return;}
var _48=_47[_46["request"]];if(!_48){return;}
var _49=_46["params"]?_46["params"]:{};_49["method"]=_48["method"];if(Ext.type(_48["extraParams"])=="object"){_49=Ext.apply(_49,_48["extraParams"]);}
if(_46["waitLang"]){var txt=this.langLookup(_46["waitLang"],"wait");if(txt){Ext.Msg.wait(txt,null);}}
this.fireEvent("datarequest",this,_46["request"],_46["group"],_49);if(this._scriptProxyOn){_46["storeId"]=Ext.id();var _4b=new Ext.data.ScriptTagJsonStore({autoLoad:true,storeId:_46["storeId"],url:this._rootUrl+(_48["gateway"]?_48["gateway"]:this._gateway),fields:["__blank__"],baseParams:_49,listeners:{load:this._filterProxyRequestData.createDelegate(this,[_46],true),loadexception:this._filterProxyRequestError.createDelegate(this,[_46])}});}else{Ext.Ajax.request({url:this._rootUrl+(_48["gateway"]?_48["gateway"]:this._gateway),params:_49,success:this._filterAjaxRequestData.createDelegate(this,[_46],true),failure:this._filterAjaxRequestError.createDelegate(this,[_46],true)});}},_filterAjaxRequestData:function(_4c,_4d,_4e){var _4f;try{_4f=Ext.util.JSON.decode(_4c.responseText);}
catch(e){_4f=false;}
this._finishRequestData(_4f,_4e);},_filterProxyRequestData:function(_50,_51,_52,_53){var _54;try{_54=Ext.apply({},_50.reader.jsonData);}
catch(e){_54=false;}
this._finishRequestData(_54,_53);try{_50.purgeListeners();Ext.StoreMgr.remove(_50);}
catch(e){}},_filterAjaxRequestError:function(_55,_56,_57){var _58;try{_58=Ext.util.JSON.decode(_55.responseText);}
catch(e){}
this._errorRequestData(_58,_57);},_filterProxyRequestError:function(_59){var _5a=false;this._finishRequestData(_5a,_59);try{var _5b=Ext.StoreMgr.lookup(_59["storeId"]);_5b.purgeListeners();Ext.StoreMgr.remove(_5b);}
catch(e){}},_finishRequestData:function(_5c,_5d){if(_5d["waitLang"]){Ext.Msg.hide();}
if(_5d["showMessage"]&&_5c){this._displayRequestMessage.defer(500,this,[_5c.message,_5c.errors]);}
if(_5d["successFn"]){try{if(_5d["scopeObj"]){_5d["scopeObj"][_5d["successFn"]](_5c,_5d);}else{_5d["successFn"](_5c,_5d);}}
catch(e){}}
this.fireEvent("datareceived",this,_5d["request"],_5d["group"],_5c,_5d);},_errorRequestData:function(_5e,_5f){if(_5f["waitLang"]){Ext.Msg.hide();}
if(_5f["showMessage"]&&_5e){this._displayRequestMessage.defer(250,this,[_5e.message,_5e.errors]);}
if(_5f["errorFn"]){try{if(_5f["scopeObj"]){_5f["scopeObj"][_5f["errorFn"]](_5e,_5f);}else{_5f["errorFn"](_5e,_5f);}}
catch(e){}}
this.fireEvent("dataerror",this,_5f["request"],_5f["group"],_5e,_5f);},_displayRequestMessage:function(_60,_61){if(_60){if(_61){Ext.Msg.alert(this.langLookup("error","title"),_60);}else{Ext.Msg.alert(this.langLookup("success","title"),_60);}}},updateCartDisplayConfig:function(obj){try{if(group){this._cartDisplayConfig=Ext.apply(this._cartDisplayConfig,obj);}}
catch(e){}},makeCartDisplayChanges:function(amt,_64){var o=this._cartDisplayConfig;if(amt&&o["amountElId"]){try{Ext.fly(o["amountElId"]).update(amt);}
catch(e){}}
if(_64&&o["totalElId"]){try{Ext.fly(o["totalElId"]).update(_64);}
catch(e){}}
if(amt||_64){if(o["checkOutElId"]&&o["checkOutInActCls"]){try{Ext.fly(o["checkOutElId"]).removeClass(o["checkOutInActCls"]);}
catch(e){}}
if(o["cartElId"]&&o["cartInActCls"]){try{Ext.fly(o["cartElId"]).addClass(o["cartInActCls"]);}
catch(e){}}}},showLargeImgView:function(_66,_67,_68,_69,_6a){_66=(Ext.type(_66)=="string")?_66:"";_67=Number(_67);_68=Number(_68);this.closeLargeImgView();if(_66&&_67&&_68){var _6b=this.getViewportSize();var bw=Math.round(_6b[0]*0.75);var bh=Math.round(_6b[1]*0.75);if((_67>bw)||(_68>bh)){var _6e=bw/_67;var _6f=bh/_68;if(_6e<=_6f){_67=bw;_68=Math.round(_6e*_68);}else{_68=bh;_67=Math.round(_6f*_67);}}
this._imgZoom=new Ext.Window({layout:"fit",closable:true,cls:"wse-win-img",shim:true,bodyStyle:"padding:0;",width:_67+20,buttonAlign:"center",animCollapse:false,closeAction:"close",border:false,bodyBorder:false,animateTarget:null,shadow:false,resizable:false,listeners:{close:this.closeLargeImgView.createDelegate(this)},items:[{xtype:"panel",border:false,html:"<div class=\"wse-wrap wse-wrap-img\">"+"<img onclick=\"SmartWin.closeLargeImgView(); return false;\" "+"src=\""+_66+"\" width=\""+_67+"\" height=\""+_68+"\" alt=\"\" />"+"</div>"}]});if(_69){try{_69=Ext.get(_69);if(_6a){_69=_69.up(_6a);}}
catch(e){}}
this._imgZoom.show(_69);}},closeLargeImgView:function(){if(this._imgZoom){try{this._imgZoom.close();}
catch(e){}
this._imgZoom=null;}},isWindowVisible:function(_70){var _71=false;try{if(_70&&this._windows[_70]&&this._windows[_70].isVisible()){_71=true;}}
catch(e){}
return _71;},trackingOn:function(){try{return GaTracker?true:false;}
catch(e){}
return false;},addTracker:function(key,_73,_74,_75,_76){try{if(GaTracker){GaTracker.addTracker(key,_73,_74,_75,_76);}}
catch(e){}},addTrackerUrlCodes:function(key,_78,_79){try{if(GaTracker){GaTracker.addTrackerUrlCodes(key,_78,_79);}}
catch(e){}},addTrackerEventCodes:function(key,_7b,_7c){try{if(GaTracker){GaTracker.addTrackerEventCodes(key,_7b,_7c);}}
catch(e){}},setVpvRoot:function(_7d){try{if(GaTracker){GaTracker.setVpvRoot(_7d);}}
catch(e){}},getVpvRoot:function(){try{if(GaTracker){return GaTracker.getVpvRoot();}}
catch(e){}
return"";},setVpvSep:function(sep){try{if(GaTracker){GaTracker.setVpvSep(sep);}}
catch(e){}},getVpvSep:function(){try{if(GaTracker){return GaTracker.getVpvSep();}}
catch(e){}
return"";},track:function(url){try{if(GaTracker){GaTracker.track(url);}}
catch(e){}},addProductsToTracker:function(_80){if(this.trackingOn()&&_80){var _81,i,l,sF,o,id,_87;switch(Ext.type(_80)){case"array":_81=_80;break;case"object":_81=[_80];break;default:return;break;}
sF=SmartWin.langLookup("addProdFormat","tracker");_87=SmartWin.langLookup("addtocart","tracker");l=_81.length;o={"products":[]};for(i=0;i<l;i++){this.trackVpv({code:this.trackerCode,url:[_87,(sF?String.format(sF,_81[i]["product"],_81[i]["product_code"]):_81[i]["product"])]});if(!o["order"]){var _t=new Date().getTime();var _r=Math.floor(Math.random()*1000001);id=(_81[i]["user_id"]?_81[i]["user_id"]:0)+"_"+_t+"_"+_r;o["order"]={"orderId":id,"dealer":_81[i]["dealer"],"total":0,"tax":"0","shipping":"0","city":"","state":"","country":""};}
var _8a=(parseInt(_81[i]["qty_added"])||1);o["products"].push({"orderId":id,"sku":_81[i]["product_code"],"name":_81[i]["product"],"category":_81[i]["catalog_name"],"price":_81[i]["price_unformatted"],"qty":_8a});o["order"]["total"]+=parseFloat(_81[i]["price_unformatted"]*_8a);}
this.trackTrans(o["order"],o["products"],{"code":this.trackerCode,"trans":true});delete(o);}},trackVpv:function(_8b){try{if(GaTracker){GaTracker.trackVpv(_8b);}}
catch(e){}},trackEvent:function(_8c,_8d,_8e,_8f){try{if(GaTracker){GaTracker.trackEvent(_8c,_8d,_8e,_8f);}}
catch(e){}},trackTrans:function(_90,_91,_92){try{if(GaTracker){GaTracker.trackTrans(_90,_91,_92);}}
catch(e){}}});var SmartWin=new $_SmartWin();
SmartWin.window={};
SmartWin.window.Base=Ext.extend(Ext.Window,{autoHeight:true,closable:true,shim:true,bodyStyle:"padding:0; margin:0;",buttonAlign:"center",width:600,animateTarget:null,animCollapse:false,closeAction:"hide",border:false,bodyBorder:false,resizable:false,modal:true,shadow:false,draggable:true,placeDims:null,parentConfig:"prodDetail",cls:"wse-swin",prodDetailShowLoad:false,_compIds:null,_initProdId:0,_currentProdId:0,initComponent:function(){if(!this.placeDims){this.placeDims={"width":600,"target":null,"tx":null,"ty":null,"tw":false};}
this._compIds={};this.title=this._genTitle();this.items=this._genContent();this.buttons=this._genButtonBar();this.bbar=this._genBottomBar();this.on("beforeshow",this._updateBeforeShow.createDelegate(this));this.on("show",this._updateAfterShow.createDelegate(this));this.on("beforehide",this._updateBeforeHide.createDelegate(this));this.on("hide",this._updateAfterHide.createDelegate(this));SmartWin.window.Base.superclass.initComponent.call(this);},initEvents:function(){Ext.History.on("change",function(){this.hide();},this);SmartWin.window.Base.superclass.initEvents.call(this);},onRender:function(ct,_2){SmartWin.window.Base.superclass.onRender.call(this,ct,_2);},_updateBeforeShow:function(){this._onBeforeShow();},_onBeforeShow:function(){},_updateAfterShow:function(){this.positionAndSize(false);this._onAfterShow();},_onAfterShow:function(){},_updateBeforeHide:function(){SmartWin.closeLargeImgView();this._onBeforeHide();},_onBeforeHide:function(){},_updateAfterHide:function(){this._onAfterHide();},_onAfterHide:function(){},positionAndSize:function(_3){var w=this.placeDims["width"];var mW=Number(this.placeDims["maxWidth"]);var x=-1,y=-1,el;var _9=0;if(this.placeDims["target"]){try{el=Ext.get(this.placeDims["target"]);w=(this.placeDims["tw"])?el.getWidth():w;if(mW&&w>mW){_9=Math.round((w-mW)/2);w=mW;}
switch(this.placeDims["tx"]){case"left":x=el.getLeft()+_9;break;case"right":x=el.getRight()-_9;break;case"fromRight":x=el.getRight()-w;break;}
switch(this.placeDims["ty"]){case"top":y=el.getTop();break;case"bottom":y=el.getBottom();break;}}
catch(e){}}
this.setSize(w);this.syncSize();var p=this.getEl().getCenterXY();x=(x>-1)?x:((p[0]>0)?p[0]:0);y=(y>-1)?y:((p[1]>0)?p[1]:0);if(_3){this.setPositionAnim(x,y);}else{this.setPosition(x,y);}},showAndFocus:function(){try{this.show();this.toFront();}
catch(e){}},setPositionAnim:function(x,y,_d){if(x&&typeof x[1]=="number"){y=x[1];x=x[0];}
this.x=x;this.y=y;_d=_d?_d:0.5;if(!this.boxReady){return this;}
var _e=this.adjustPosition(x,y);var ax=_e.x,ay=_e.y;var el=this.getPositionEl();if(ax!==undefined||ay!==undefined){if(ax!==undefined&&ay!==undefined){el.shift({x:ax,y:ay,duration:_d});}else{if(ax!==undefined){el.shift({x:ax,duration:_d});}else{if(ay!==undefined){el.shift({y:ay,duration:_d});}}}
this.onPosition(ax,ay);this.fireEvent("move",this,ax,ay);}
return this;},_genContent:function(){return[{border:false,html:"This is a base class only. No content available",height:200}];},_genButtonBar:function(){return false;},_genBottomBar:function(){return false;},_genTitle:function(){return"Window";},_createProdDetailComp:function(_12){if(this._compIds["proddtl"]){return o;}
this._compIds["proddtl"]=this.getId()+"-proddtl";var o={xtype:"SmartWin.comp.ProdDetail",parentConfig:this.parentConfig,id:this._compIds["proddtl"]};if(Ext.type(_12)=="object"){o=Ext.apply(o,_12);}
return o;},_hideProdDetailAsVisible:function(_14){if(this._compIds["proddtl"]){try{this.findById(this._compIds["proddtl"]).hideAsVisible(_14);}
catch(e){}}},_displayProdDetailLoad:function(_15){if(this._compIds["proddtl"]&&this.prodDetailShowLoad){try{this.findById(this._compIds["proddtl"]).displayLoadMsg(_15);}
catch(e){}}},_createRelProdComp:function(_16){if(this._compIds["rldprd"]){return false;}
this._compIds["rldprd"]=this.getId()+"-rldprd";var o={xtype:"SmartWin.comp.RelatedProd",parentConfig:this.parentConfig,id:this._compIds["rldprd"]};if(Ext.type(_16)=="object"){o=Ext.apply(o,_16);}
return o;},_hideRelProdIfNeeded:function(num){if(!this._compIds["rldprd"]){return false;}
num=num?num:0;var _19=this.findById(this._compIds["rldprd"]);try{if(this.relatedProd["hideIfNone"]&&!num){_19.hide();}else{_19.show();}}
catch(e){}},_createOrderListComp:function(_1a){if(this._compIds["ordlst"]){return false;}
this._compIds["ordlst"]=this.getId()+"-ordlst";var o={xtype:"SmartWin.comp.OrderList",parentConfig:this.parentConfig,id:this._compIds["ordlst"]};if(Ext.type(_1a)=="object"){o=Ext.apply(o,_1a);}
return o;},loadData:function(_1c){switch(Ext.type(_1c)){case"object":case"array":this._loadData(_1c);break;}},_loadData:function(_1d){},clearData:function(_1e){var i;for(i in this._compIds){try{this.findById(this._compIds[i]).clearData(_1e);}
catch(e){}}
this._clearData();},_clearData:function(){},setProdId:function(id,_21){if(_21){this._initProdId=id;}
this._currentProdId=id;this._afterProdIdChange({currProdId:this._currentProdId,initProdId:this._initProdId});},_afterProdIdChange:function(ids){},getProdId:function(_23){if(_23){return this._initProdId;}
return this._currentProdId;},showErrorMsg:function(msg,_25){Ext.Msg.alert(SmartWin.langLookup("error","title"),msg);if(_25===true){this.hide();}}});
SmartWin.window.Product=Ext.extend(SmartWin.window.Base,{parentConfig:"prodDetail",cls:"wse-swin wse-swin-prod",xtype:"SmartWin.window.Product",_orderItemData:null,_genContent:function(){var _1=[];var _2=this._createProdDetailComp({listeners:{optionselect:this._getOptionData.createDelegate(this),additem2order:this._addItem2Order.createDelegate(this),closerequest:SmartWin.closeActiveWindows.createDelegate(SmartWin),tabsunhide:this.positionAndSize.createDelegate(this,[false])}});switch(this.relatedProdLoc){case"b":_1.push(_2,this._createRelProdComp());break;case"t":_1.push(this._createRelProdComp(),_2);break;default:_1.push(_2);break;}
return _1;},_genTitle:function(){return SmartWin.langLookup("product_detail_win","title");},_onAfterShow:function(){this.clearData();this._hideRelProdIfNeeded(0);},_onBeforeHide:function(){this.clearData();this._hideRelProdIfNeeded(0);},_loadData:function(_3){SmartWin.closeLargeImgView();this._hideProdDetailAsVisible(true);this._displayProdDetailLoad(true);var o=SmartWin.formatRequestParams(_3,"params[{0}]");SmartWin.requestData({group:"prodDetail",request:"detail",waitLang:"loading_prod_detail",params:o,scopeObj:this,successFn:"_displayProdData",errorFn:"_displayProdData"});},_clearData:function(){this._orderItemData=null;},_displayProdData:function(_5,_6){_5=_5?_5:{};var _7;this._displayProdDetailLoad(false);if(_5["product"]){this.showAndFocus();_7=this.findById(this._compIds["proddtl"]);_7.clearData();this.setProdId(_5["product"]["product_id"],true);try{_7.displayData(_5,true);}
catch(e){}
this._hideProdDetailAsVisible(false);this._orderItemData=Ext.apply({},_5["order_line_item_data"]);}else{this.setProdId(0,true);this.showErrorMsg(SmartWin.langLookup("product_does_not_exist","error"),true);return;}
if(this._compIds["rldprd"]){_7=this.findById(this._compIds["rldprd"]);var _8=Number(_5["related_product_count"]);try{_7.loadDataById((_8?this.getProdId(true):0),(_5["product"]?_5["product"]["product"]:""));}
catch(e){}
this._hideRelProdIfNeeded(_8);}
this.positionAndSize(false);},_afterProdIdChange:function(_9){},_getOptionData:function(_a,id){if(this.getProdId()!=id){SmartWin.closeLargeImgView();this._displayProdDetailLoad(true);this.setProdId(id);SmartWin.requestData({group:"prodDetail",request:"option",params:{"params[product_id]":id},scopeObj:this,successFn:"_displayOptionData",errorFn:"_displayOptionData"});}},_displayOptionData:function(_c,_d){_c=_c?_c:{};var _e=this.findById(this._compIds["proddtl"]);_e.clearData(true);this._displayProdDetailLoad(false);if(_c["product"]){try{_e.displayData(_c);}
catch(e){}}
if(this._compIds["rldprd"]){_e=this.findById(this._compIds["rldprd"]);var _f=Number(_c["related_product_count"]);try{_e.loadDataById((_f?this.getProdId():0),(_c["product"]?_c["product"]["product"]:""));}
catch(e){}
this._hideRelProdIfNeeded(_f);}
this.syncSize();},_addItem2Order:function(_10,qty){qty=Number(qty)?qty:1;var _12=this.getProdId();if(_12){SmartWin.closeLargeImgView();this.findById(this._compIds["proddtl"]).updateOrdBar(0,false);var o=SmartWin.formatRequestParams(this._orderItemData,"order_line_item_data[{0}]");o=Ext.apply(o,{"product_id":_12,"qty":qty});SmartWin.requestData({group:"prodDetail",request:"add2Order",waitLang:"adding_to_order",showMessage:true,params:o,scopeObj:this,successFn:"_updateAfterAdd",errorFn:"_updateAfterAdd"});}},_updateAfterAdd:function(_14,_15){if(_14){if(_14.results){SmartWin.addProductsToTracker(_14.results);}
SmartWin.makeCartDisplayChanges(_14["amount"],_14["subtotal"]);}
this.findById(this._compIds["proddtl"]).updateOrdBar(0,true);if(SmartWin.getWindowConfig(this.parentConfig,"closeAfterAdd")){SmartWin.closeActiveWindows();}}});Ext.reg("SmartWin.window.Product",SmartWin.window.Product);
SmartWin.window.Add2Order=Ext.extend(SmartWin.window.Base,{parentConfig:"add2OrdOpts",cls:"wse-swin wse-swin-ordopts",xtype:"SmartWin.window.Add2Order",_curOrdItemId:0,_itemQueue:null,_sesData:null,_trackProds:null,_genContent:function(){var _1=[{layout:"border",border:false,region:"center",height:(this.layoutHeight?this.layoutHeight:500),items:[this._createProdDetailComp({listeners:{optionselect:this.getOptionData.createDelegate(this),additem2orderlist:this._addOrderItem.createDelegate(this),produpdate:this._updateOrderItem.createDelegate(this),closerequest:this.hide.createDelegate(this),tabsunhide:this.positionAndSize.createDelegate(this,[false])},parentConfig:this.parentConfig,region:"center"})]}];switch(this.relatedProdLoc){case"b":_1[0].items.push(this._createRelProdComp({region:"south"}));break;case"t":_1[0].items.push(this._createRelProdComp({region:"north"}));break;}
var o={listeners:{itemselect:this.displayProdInfo.createDelegate(this)}};switch(this.orderListLoc){case"r":o["region"]="east";break;default:o["region"]="west";break;}
_1.push(this._createOrderListComp(o));return{layout:"border",border:false,id:this.getId()+"-innerbord",items:_1,height:(this.layoutHeight?this.layoutHeight:500)};},_genTitle:function(){return SmartWin.langLookup("add_order_opts_win","title");},_genBottomBar:function(){var _3=SmartWin.getWindowConfig(this.parentConfig,"closeBtnLoc");var b={xtype:"button",id:this.getId()+"-sbmt",text:SmartWin.langLookup("add_parts_to_order","button"),cls:"wse-xbtn-sbmt",handler:this.submitOrderItems.createDelegate(this)};var _5;var _6=[];switch(_3){case"r":case"l":_5={xtype:"button",text:SmartWin.langLookup("close","button"),handler:SmartWin.closeActiveWindows.createDelegate(SmartWin),cls:"wse-xbtn-minor wse-xbtn-close"};break;}
if(_3=="l"){_6.push(_5,"-");}
switch(this.submitBarLoc){case"l":_6.push(b,"->");break;default:_6.push("->",b);break;}
if(_3=="r"){_6.push("-",_5);}
return _6;},_onAfterShow:function(){try{this.findById(this.getId()+"-innerbord").doLayout();}
catch(e){}
this.clearData();this._hideRelProdIfNeeded(0);},_onBeforeHide:function(){this.clearData();this._hideRelProdIfNeeded(0);},_clearData:function(){this._curOrdItemId=0;this.setProdId(0,true);this.enableSubmitBtn(false);},_loadData:function(_7){SmartWin.closeLargeImgView();var _8={};var _9=[];this._sesData=[];var i,o;var l=_7.length;for(i=0;i<l;i++){var _d={};var _e=[];_d.sku=_7[i]["sku"];_d.bom_item_name=_7[i]["bom_item_name"];_d.catalog_code=_7[i]["catalog_code"];_d.qty=_7[i]["qty"];_d.vendor_code=_7[i]["vendor_code"];_d.ses_has_assemblies_bound=_7[i]["ses_has_assemblies_bound"];_d.index=i;_9[i]=_d;this._sesData[i]=Ext.apply({},_7[i]);}
for(i=0;i<l;i++){Ext.apply(_8,SmartWin.formatRequestParams(_9[i],"params[items]["+i+"][{0}]"));}
if(this._compIds["ordlst"]){if(this._compIds["ordlst"]){try{this.findById(this._compIds["ordlst"]).setEmptyText(SmartWin.langLookup("loading_order_items","wait"),true);}
catch(e){}}}
this._hideProdDetailAsVisible(true);SmartWin.requestData({group:"add2OrdOpts",request:"orderlist",params:_8,waitLang:"processing_order_items",scopeObj:this,successFn:"_displayOrderList",errorFn:"_displayOrderList"});},_displayOrderList:function(_f,_10){_f=_f?_f:{results:[]};var b=SmartWin.getWindowConfig(this.parentConfig,"useShowConditions");if(!_f.results||!_f.results.length){this.showErrorMsg(SmartWin.langLookup("no_order_items","error"));return;}
var i,l=_f.results.length;for(i=0;i<l;i++){try{Ext.applyIf(_f.results[i]["order_line_item_data"],this._sesData[_f.results[i]["index"]]);Ext.applyIf(_f.results[i]["product"],this._sesData[_f.results[i]["index"]]);}
catch(e){}}
if(!b||_f["conditions_met"]){this.showAndFocus();if(this._compIds["ordlst"]){var _14=this.findById(this._compIds["ordlst"]);_14.loadData(_f["results"]);}
this.enableSubmitBtn(true);}else{this._submitOrderItems(_f["results"]);}},displayProdInfo:function(_15,_16){if(this._curOrdItemId==_15){return;}
SmartWin.closeLargeImgView();this._curOrdItemId=_15?_15:0;this._hideProdDetailAsVisible(true);this._displayProdDetailLoad(true);var _17=SmartWin.formatRequestParams(_16,"params[{0}]");SmartWin.requestData({group:"add2OrdOpts",request:"detail",params:_17,scopeObj:this,successFn:"_displayProdData",errorFn:"_displayProdData"});},_displayProdData:function(_18,_19){if(SmartWin.isWindowVisible(this.parentConfig)){_18=_18?_18:{};var _1a=this.findById(this._compIds["proddtl"]);_1a.clearData();this._displayProdDetailLoad(false);if(_18["product"]){this.setProdId(_18["product"]["product_id"],true);try{_1a.displayData(_18,true);}
catch(e){}
this._hideProdDetailAsVisible(false);}else{this.setProdId(0,true);}
if(this._compIds["rldprd"]){_1a=this.findById(this._compIds["rldprd"]);var num=Number(_18["related_product_count"]);try{_1a.loadDataById((num?this.getProdId(true):0),(_18["product"]?_18["product"]["product"]:""));}
catch(e){}
this._hideRelProdIfNeeded(num);}
this.positionAndSize(false);}},getOptionData:function(_1c,id){if(this.getProdId()!=id){SmartWin.closeLargeImgView();this._displayProdDetailLoad(true);this.setProdId(id);SmartWin.requestData({group:"prodDetail",request:"option",params:{"params[product_id]":id},scopeObj:this,successFn:"_displayOptionData",errorFn:"_displayOptionData"});}},_displayOptionData:function(_1e,_1f){_1e=_1e?_1e:{};var _20=this.findById(this._compIds["proddtl"]);_20.clearData(true);this._displayProdDetailLoad(false);if(_1e["product"]){try{_20.displayData(_1e);}
catch(e){}}
if(this._compIds["rldprd"]){_20=this.findById(this._compIds["rldprd"]);var num=Number(_1e["related_product_count"]);try{_20.loadDataById((num?this.getProdId():0),(_1e["product"]?_1e["product"]["product"]:""));}
catch(e){}
this._hideRelProdIfNeeded(num);}
this.syncSize();},_addOrderItem:function(_22){if(this._compIds["ordlst"]){try{var _23=this.findById(this._compIds["ordlst"]).addOrderItems(_22);}
catch(e){}}},_updateOrderItem:function(_24,_25){if(this._compIds["ordlst"]){try{var _26=this.findById(this._compIds["ordlst"]).updateOrderItem(this._curOrdItemId,_25);}
catch(e){}}},enableSubmitBtn:function(_27){try{Ext.getCmp(this.getId()+"-sbmt")[_27?"enable":"disable"]();}
catch(e){}},submitOrderItems:function(btn){if(this._compIds["ordlst"]){SmartWin.closeLargeImgView();try{var _29=this.findById(this._compIds["ordlst"]).getAvailOrderItems();this._submitOrderItems(_29);}
catch(e){}}},_submitOrderItems:function(_2a){this._itemQueue=new Ext.util.MixedCollection();this._trackProds=null;try{var l=_2a.length;if(l){var i,o,ses;var p={};for(i=0;i<l;i++){o=_2a[i];ses=(this._sesData&&this._sesData[i]?this._sesData[i]:{});Ext.applyIf(o,ses);p=Ext.apply(p,SmartWin.formatRequestParams({"product_id":o["product"]["product_id"],"amount":(o["product"]["qty"]?o["product"]["qty"]:1)},"product_data["+o["product"]["product_id"]+"][{0}]"));p=Ext.apply(p,SmartWin.formatRequestParams(o["order_line_item_data"],"product_data["+i+"][order_line_item_data][{0}]"));this._itemQueue.add(i,p);p={};}
this._sesData=null;this._startItemQueue();}else{if(SmartWin.getWindowConfig(this.parentConfig,"closeAfterAdd")){this.hide();this.showErrorMsg(SmartWin.langLookup("no_order_items","error"));}}}
catch(e){this.enableSubmitBtn(true);}},_startItemQueue:function(){var txt=SmartWin.langLookup("adding_to_order","wait");Ext.Msg.wait(txt,null);this._processItemQueue();},_processItemQueue:function(){if(this._itemQueue.getCount()>=1){var _31=this._itemQueue.removeAt(0);SmartWin.requestData({group:this.parentConfig,request:"addBulk2Order",waitLang:false,showMessage:true,params:_31,scopeObj:this,successFn:"_updateAfterAdd",errorFn:"_updateAfterAdd"});}},_updateAfterAdd:function(_32,_33){if(_32&&_32.results&&SmartWin.trackingOn()){if(!this._trackProds){this._trackProds=[];}
var i,l=_32.results.length;for(i=0;i<l;i++){this._trackProds.push(_32.results[i]);}}
if(this._itemQueue.getCount()>=1){this._processItemQueue();}else{Ext.Msg.hide();if(_32){SmartWin.makeCartDisplayChanges(_32["amount"],_32["subtotal"]);}
this.findById(this._compIds["proddtl"]).updateOrdBar(0,true);if(SmartWin.getWindowConfig(this.parentConfig,"closeAfterAdd")){SmartWin.closeActiveWindows();}
if(SmartWin.trackingOn()&&this._trackProds&&this._trackProds.length){SmartWin.addProductsToTracker(this._trackProds);}}}});Ext.reg("SmartWin.window.Add2Order",SmartWin.window.Add2Order);
SmartWin.comp={};
SmartWin.comp.ProdDetail=Ext.extend(Ext.Panel,{xtype:"SmartWin.comp.ProdDetail",border:false,autoHeight:true,parentConfig:"prodDetail",cls:"wse-swin-cmp wse-swin-cmp-prod",_compIds:null,_curProdInfo:null,_loadMask:null,_tabCount:0,_includeBookmarking:false,initComponent:function(){this.addEvents("additem2order","tabsunhide");var _1=SmartWin.getWindowConfig(this.parentConfig);var _2=_1["detailCols"];var _3=_1["detailComps"];this._includeBookmarking=_1["includeBookmarking"];var i,l,o;this.items=[];this._compIds={};this._curProdInfo={};if(_2&&Ext.isArray(_2)){var _7=this._genNewColGroup();l=_2.length;for(i=0;i<l;i++){o=_2[i];if(o["newGroup"]&&i>0){this.items.push(_7);_7=this._genNewColGroup();}
_7.items.push({xtype:"SmartWin.comp.Column",cls:"wse-smartcol wse-smartcol-"+(i+1),width:(o["width"]?o["width"]:""),availHeight:(o["availHeight"]?o["availHeight"]:400),resizeToFill:(o["resizeToFill"]?o["resizeToFill"]:false),columnWidth:(o["columnWidth"]?Number(o["columnWidth"]):""),border:false,items:this._genCompConfig(_3,i+1)});}
this.items.push(_7);}else{if(_3&&Ext.isArray(_3)){this.items=this._genCompConfig(_3);}}
this._genOrderBar();SmartWin.comp.ProdDetail.superclass.initComponent.call(this);},_genNewColGroup:function(){return{xtype:"panel",layout:"column",border:false,autoHeight:true,items:[]};},onRender:function(ct,_9){SmartWin.comp.ProdDetail.superclass.onRender.call(this,ct,_9);this.doLayout.defer(100,this);},getCurProdInfo:function(){return this._curProdInfo;},hideAsVisible:function(_a){if(this.rendered){try{var el=this.body;this.body.setVisibilityMode(Ext.Element.VISIBILITY);this.body.setVisible(!_a);}
catch(e){}}},displayLoadMsg:function(_c){if(this._loadMask){try{this._loadMask.hide();delete(this._loadMask);}
catch(e){}}
if(_c&&this.rendered){try{this._loadMask=new Ext.LoadMask(this.getEl(),{msg:SmartWin.langLookup("loading_prod_detail","wait"),removeMask:true,msgCls:"wse-mask wse-mask-proddtl"});this._loadMask.show();}
catch(e){}}},displayData:function(_d,_e){this.displayLoadMsg();if(Ext.type(_d)!="object"){this.clearData(_e,true);return;}else{this._curProdInfo={"product":_d["product"],"prices":_d["prices"]};if(this._compIds["info"]){this.findById(this._compIds["info"]).displayInfo(_d["product"],_d["image"]);}
if(this._compIds["tabs"]){var _f=[];var _10=SmartWin.getWindowConfig(this.parentConfig,"prodTabs");var i,o,l;if(_10["includeDesc"]&&_d["product"][_10["descField"]]){_f.push({title:SmartWin.langLookup("description","title"),text:_d["product"][_10["descField"]],type:"description"});}
if(_10["includeFeatures"]&&_d["feature_groups"]){l=_d["feature_groups"].length;for(i=0;i<l;i++){o=_d["feature_groups"][i];_f.push({title:o["name"],values:o["values"],type:"features"});}}
if(_10["includeSpecs"]&&_d["spec_groups"]){l=_d["spec_groups"].length;for(i=0;i<l;i++){o=_d["spec_groups"][i];_f.push({title:o["name"],values:o["values"],type:"specs"});}}
if(_d["order_line_item_data"]){if(_10["includeSeeAlso"]){if(_d["order_line_item_data"]["ses_bom_item_id"]){SmartWin.requestData({group:this.parentConfig,request:"seeAlso",params:{bom_item_id:_d["order_line_item_data"]["ses_bom_item_id"]},scopeObj:this,successFn:"_displaySeeAlso",errorFn:"_displaySeeAlso"});}else{if(_d["order_line_item_data"]["ses_product_id"]){SmartWin.requestData({group:this.parentConfig,request:"seeAlsoProd",params:{product_id:_d["order_line_item_data"]["ses_product_id"]},scopeObj:this,successFn:"_displaySeeAlso",errorFn:"_displaySeeAlso"});}}}
if(_10["includeNotes"]&&(_d["order_line_item_data"]["ses_bom_item_id"]||_d["order_line_item_data"]["ses_product_id"])){SmartWin.requestData({group:this.parentConfig,request:"canSeeNotes",params:{bom_item_id:_d["order_line_item_data"]["ses_bom_item_id"],product_id:_d["order_line_item_data"]["ses_product_id"]},scopeObj:this,successFn:"_displayNotes",errorFn:"_displayNotes"});}
if(_10["includeBulletins"]&&_d["order_line_item_data"]["ses_product_id"]){SmartWin.requestData({group:this.parentConfig,request:"canSeeBulletins",params:{product_id:_d["order_line_item_data"]["ses_product_id"]},scopeObj:this,successFn:"_displayBulletins",errorFn:"_displayBulletins"});}}
if(_f.length){this.findById(this._compIds["tabs"]).show().addProdTabs(_f,true,true);this._tabCount=_f.length;}else{this.findById(this._compIds["tabs"]).hide().clearTabs(true);this._tabCount=0;}
this.findById(this._compIds["info"]).displayInfo(_d["product"],_d["image"]);}
if(_e){if(this._compIds["price"]){this.findById(this._compIds["price"]).displayInfo(_d,(this._compIds["options"]&&_d["other_options"]));}
if(this._compIds["options"]){if(_d["other_options"]){this.findById(this._compIds["options"]).show().displayOptions(_d["other_options"]);}else{this.findById(this._compIds["options"]).hide().clearOptions();}}
var qty=(_d["product"]&&_d["product"]["qty"])?_d["product"]["qty"]:1;if(this._compIds["qty"]){if(_d["product"]["not_available_for_ordering"]=="Y"){this.findById(this._compIds["qty"]).hide();}else{this.findById(this._compIds["qty"]).show();this.findById(this._compIds["qty"]).setQty(qty);}}else{if(_d["product"]["not_available_for_ordering"]=="Y"){this.updateOrdBar(0,false);}else{this.updateOrdBar(qty,true);}}
if(this._compIds["super"]){if(_d["supercession_product_groups"]){this.findById(this._compIds["super"]).show().displaySupercession(_d["supercession_product_groups"]);}else{this.findById(this._compIds["super"]).hide().clearSupercession();}}
if(this._compIds["superceded"]){if(_d["superceded_product_groups"]){this.findById(this._compIds["superceded"]).show().displaySupercession(_d["superceded_product_groups"]);}else{this.findById(this._compIds["superceded"]).hide().clearSupercession();}}
if(this._compIds["bookmark"]){if(this._includeBookmarking){this.findById(this._compIds["bookmark"]).show().setData(_d["product"],_d["order_line_item_data"]);}else{this.findById(this._compIds["bookmark"]).hide().clearData();}}}}
this._resizeColumns.defer(50,this);},_displayNotes:function(_15,_16){if(SmartWin.isWindowVisible(this.parentConfig)&&_15&&_15["can_view"]){var _17=_16["params"]?_16["params"]:{};var cfg=SmartWin.getWindowConfig(this.parentConfig,"noteWindow");var _19=[{title:SmartWin.langLookup("notes","title"),bomItemId:_17["bom_item_id"],canAddNotes:_15["can_add"],includeNoteTypes:cfg["includeNoteTypes"],includeGlobalCheck:cfg["includeGlobalCheck"],productId:_17["product_id"],type:"notes"}];this.findById(this._compIds["tabs"]).show().addProdTabs(_19,false,true);this._updateTabCount();}},_displayBulletins:function(_1a,_1b){if(SmartWin.isWindowVisible(this.parentConfig)&&_1a&&_1a["can_view"]){var _1c=_1b["params"]?_1b["params"]:{};var _1d=[{title:SmartWin.langLookup("bulletins","title"),bindType:"product_id",bindId:_1c["product_id"],type:"bulletins"}];this.findById(this._compIds["tabs"]).show().addProdTabs(_1d,false,true);this._updateTabCount();}},_displaySeeAlso:function(_1e,_1f){if(SmartWin.isWindowVisible(this.parentConfig)){_1e=_1e?_1e:{};if(!_1e.total||Number(_1e.total)<=0){return;}
var _20=[{title:SmartWin.langLookup("see_also","title"),data:_1e.results,type:"seeAlso"}];this.findById(this._compIds["tabs"]).show().addProdTabs(_20,false,true);this._updateTabCount();}},_updateTabCount:function(){if(!this._tabCount){this._resizeColumns();this.fireEvent("tabsunhide",this);}
this._tabCount++;},clearData:function(_21,_22){this.displayLoadMsg();if(this._compIds["info"]){this.findById(this._compIds["info"]).displayInfo();}
if(this._compIds["tabs"]){this.findById(this._compIds["tabs"]).hide().clearTabs();this._tabCount=0;}
if(!_21){if(this._compIds["options"]){this.findById(this._compIds["options"]).hide().clearOptions();}
if(this._compIds["price"]){this.findById(this._compIds["price"]).displayInfo();}
if(this._compIds["qty"]){this.findById(this._compIds["qty"]).setQty(1);}}
this._curProdInfo={};if(_22){this._resizeColumns();}},changeOption:function(_23,_24){var id=_23.getId();if(id==this._compIds["price"]){this.findById(this._compIds["price"]).showAsActive(true);if(this._compIds["options"]){this.findById(this._compIds["options"]).selectOption(0);}}else{if(id==this._compIds["options"]){this.findById(this._compIds["options"]).selectOption(_24);if(this._compIds["price"]){this.findById(this._compIds["price"]).showAsActive(false);}}}
this.fireEvent("optionselect",this,_24);},_genOrderBar:function(){if(this._compIds["qty"]){return;}
var loc=SmartWin.getWindowConfig(this.parentConfig,"orderBarLoc");var _27=SmartWin.getWindowConfig(this.parentConfig,"closeBtnLoc");var _28=this.getId();var ctn;if(loc){var a=loc.split("-");var bar="bbar";var _2c=[];if(a[0]=="t"){bar="tbar";}
switch(_27){case"r":case"l":ctn={xtype:"button",text:SmartWin.langLookup("close","button"),handler:this._sendCloseEvent.createDelegate(this),cls:"wse-xbtn-minor wse-xbtn-close"};break;}
if(_27=="l"){_2c.push(ctn,"-");}
if(a[1]=="r"){_2c.push("->");}
_2c.push("<span class=\"wse-lbl\">"+SmartWin.langLookup("qty","label")+"</span>",{xtype:"numberfield",name:"qty",width:40,id:_28+"-qty",minValue:1,value:1},{xtype:"button",id:_28+"-btn",text:SmartWin.langLookup("add_to_order","button"),disabled:true,handler:this._sendOrdAddEvent.createDelegate(this),cls:"wse-xbtn-add"});if(a[1]!="r"){_2c.push("->");}
if(_27=="r"){_2c.push("-",ctn);}
this._compIds["ordbar"]=_28+"-ordbar";this[bar]=new Ext.Toolbar({cls:"wse-swin-ordbar",id:this._compIds["ordbar"],items:_2c});}},updateOrdBar:function(qty,_2e){if(this._compIds["ordbar"]&&this.rendered){var _2f=this.getId();if(qty>=0){try{Ext.getCmp(_2f+"-qty").setValue(qty);}
catch(e){}}
if(_2e===true){try{Ext.getCmp(_2f+"-btn").enable();}
catch(e){}}else{if(_2e===false){try{Ext.getCmp(_2f+"-btn").disable();}
catch(e){}}}}},_genCompConfig:function(_30,col){var _32=[];var i,o,s,xt,c,_38,_39;var l=_30.length;var _3b=this.getId();for(i=0;i<l;i++){o=_30[i];if(this._compIds[o["type"]]){continue;}
s=_3b+"-"+o["type"];xt=null;_38:null;_39=false;if(!col||(o["col"]==col)){switch(o["type"]){case"info":xt="SmartWin.widget.ProdInfo";break;case"tabs":xt="SmartWin.widget.ProdTabs";_39=true;break;case"price":xt="SmartWin.widget.PriceBox";_38={optionselect:this.changeOption.createDelegate(this)};_39=true;break;case"options":xt="SmartWin.widget.ProdOpts";_38={optionselect:this.changeOption.createDelegate(this)};_39=true;break;case"qty":xt="SmartWin.widget.QtyUpdateBar";_38={update:this._sendProdUpdate.createDelegate(this)};_39=true;break;case"bookmark":xt="SmartWin.widget.Bookmark";_38={};_39=true;break;case"super":xt="SmartWin.widget.ProdSupercession";_38={itemselect:this._sendSupercessionSelect.createDelegate(this)};_39=true;break;case"superceded":xt="SmartWin.widget.ProdSuperceded";_39=true;break;default:break;}
if(xt){_32.push({xtype:xt,parentConfig:this.parentConfig,id:s,listeners:_38,autoHeight:false,autoScroll:true,colHeight:o["colHeight"],height:o["height"],hidden:o["hidden"]});this._compIds[o["type"]]=s;}}}
return _32;},_sendOrdAddEvent:function(){var qty;var _3d=this.getId();try{qty=Ext.getCmp(_3d+"-qty").getValue();}
catch(e){qty=1;}
if(qty){this.fireEvent("additem2order",this,qty);}},_sendProdUpdate:function(_3e,qty){var o={};if(this._curProdInfo){try{var o=Ext.apply({},this._curProdInfo);o["product"]["qty"]=qty?qty:1;this.fireEvent("produpdate",this,o);}
catch(e){}}},_sendSupercessionSelect:function(_41){if(_41){for(i=0;i<_41.length;i++){this.fireEvent("additem2orderlist",_41[i]);}}},_sendCloseEvent:function(){this.fireEvent("closerequest",this);},_resizeColumns:function(){try{var i,_43=this.findByType("SmartWin.comp.Column");var l=_43.length;for(i=0;i<l;i++){_43[i].sizeItemHeights();}}
catch(e){}}});Ext.reg("SmartWin.comp.ProdDetail",SmartWin.comp.ProdDetail);
SmartWin.comp.Column=Ext.extend(Ext.Panel,{xtype:"SmartWin.comp.Column",availHeight:400,resizeToFill:false,_colHgtItems:null,_hgtItems:null,cls:"wse-swin-col",initComponent:function(){this._colHgtItems=[];this._hgtItems=[];if(!this.items||!this.items.length){this.items=[{border:false,html:"&nbsp;"}];}else{var i;var l=this.items.length;for(i=0;i<l;i++){if(this.items[i].colHeight&&this.items[i].colHeight<=1){this._colHgtItems.push(i);}else{this._hgtItems.push(i);}}
this.sizeItemHeights();}
SmartWin.comp.Column.superclass.initComponent.call(this);},onRender:function(ct,_4){SmartWin.comp.ProdDetail.superclass.onRender.call(this,ct,_4);},changeAvailHeight:function(_5){this.availHeight=_5;if(this.rendered){this.sizeItemHeights();}},sizeItemHeights:function(){var r=this.rendered;var aH=this.availHeight;var i,l,c,h;l=this._hgtItems.length;for(i=0;i<l;i++){if(r){c=this.getComponent(this._hgtItems[i]);if(c.isVisible()){try{h=c.getSize()["height"];}
catch(e){h=0;}
h=(aH>h)?h:aH;if(h>0){c.setSize({height:h});aH=aH-h;}else{c.hide();}}}else{c=this.items[this._hgtItems[i]];if(!c["hidden"]){h=c["height"];h=(aH>h)?h:aH;if(h>0){c["height"]=h;aH=aH-h;}else{c["hidden"]=true;}}}}
l=this._colHgtItems.length;var _c=0,xH=0;if(this.resizeToFill){for(i=0;i<l;i++){if(r){c=this.getComponent(this._colHgtItems[i]);if(!c.isVisible()){xH+=Math.round(c.colHeight*aH);}else{_c++;}}else{c=this.items[this._colHgtItems[i]];if(c["hidden"]){xH+=Math.round(c["colHeight"]*aH);}else{_c++;}}}}
if(_c&&xH){xH=Math.round(xH/_c);}
for(i=0;i<l;i++){if(r){c=this.getComponent(this._colHgtItems[i]);if(c.isVisible()){h=Math.round(c.colHeight*aH);if(h>0){c.setSize({height:h+xH});}else{c.hide();}}}else{c=this.items[this._colHgtItems[i]];if(!c["hidden"]){h=Math.round(c["colHeight"]*aH);if(h>0){c["height"]=h+xH;}else{c["hidden"]=true;}}}}}});Ext.reg("SmartWin.comp.Column",SmartWin.comp.Column);
SmartWin.comp.RelatedProd=Ext.extend(Ext.Panel,{cls:"wse-swin-cmp wse-swin-cmp-relprds",xtype:"SmartWin.comp.ProdDetail",border:false,autoHeight:true,parentConfig:"prodDetail",_ordFlds:null,_ordMask:null,fadeIn:"none",displayCells:3,optPnlCellOverlay:2,_optPnlWidth:400,initComponent:function(){var _1=SmartWin.getWindowConfig(this.parentConfig,"relatedProd");var n=Number(_1["height"]);if(n){this.height=n;this.autoHeight=false;}
this.store=new Ext.data.JsonStore({data:[],autoLoad:false,fields:["image","option_info","other_options","option_info","prices","product"]});if(_1["fadeIn"]){this.fadeIn=_1["fadeIn"];}
if(_1["cells"]){this.displayCells=_1["cells"];}
if(_1["optOverlay"]){this.optPnlCellOverlay=_1["optOverlay"];}
if(this.optPnlCellOverlay>this.displayCells){this.optPnlCellOverlay=this.displayCells;}
if(_1["hideTitle"]===true){this.header=false;}
this.genRelTitle();this.items=[{xtype:"dataview",tpl:this._genTPL(),store:this.store,itemSelector:"div.wse-box",emptyText:"",loadingText:null,singleSelect:true,autoHeight:true}];SmartWin.comp.RelatedProd.superclass.initComponent.call(this);},onRender:function(ct,_4){SmartWin.comp.RelatedProd.superclass.onRender.call(this,ct,_4);this.doLayout.defer(100,this);this.on("resize",this._sizeProdCells,this);},genRelTitle:function(_5){var _6=0;var s;try{_6=this.store.getCount();}
catch(e){}
if(_5){s=String.format(SmartWin.langLookup("related_parts_prod_name","title"),_5);}else{s=SmartWin.langLookup("related_parts","title");}
if(this.rendered){this.setTitle(s);}else{this.title=s;}},setEmptyText:function(_8,_9){try{var _a=this.getComponent(0);_a.emptyText="<div class=\"wse-noresults\">"+_8+"</div>";if(_9){_a.refresh();}}
catch(e){}},loadDataById:function(_b,_c){this.clearData(true);this.genRelTitle(_c);if(_b){this.setEmptyText(SmartWin.langLookup("loading_related_prods","wait"),true);SmartWin.requestData({group:this.parentConfig,request:"related",params:{"params[product_id]":_b},scopeObj:this,successFn:"_displayProdData",errorFn:"_displayProdData"});}},clearData:function(_d){if(!_d){this.genRelTitle();}
this.setEmptyText(SmartWin.langLookup("no_related_parts","msg"));this.closeOptionBox();this._clearOrdItems();this._removeAddMask();try{this.store.removeAll();this.getComponent(0).refresh();}
catch(e){}},showOptionPanel:function(_e,_f){this.closeOptionBox();var el=Ext.get(_f);try{this._optBox=new SmartWin.widget.RelOptionBox({renderTo:this.getEl().child("div.wse-optpnl-hld"),width:(this._optPnlWidth?this._optPnlWidth:400),data:this.store.getAt(_e).data,indexRef:_e,listeners:{closeneeded:this.closeOptionBox.createDelegate(this),addtoorder:this.getAddFromOptBox.createDelegate(this)}});}
catch(e){}
if(el){el.blur();this._positionOptBox(el);}},_positionOptBox:function(el){if(this._optBox&&el){try{var pEl=el.up("div.wse-box");var _13=pEl.getXY();var _14=this.getEl().child("div.wse-glry");var r=_14.getRight();var w=this._optBox.getEl().getWidth();if((_13[0]+w)>r){_13[0]=(r-w);}
this._optBox.setPagePosition(_13[0],_13[1]);}
catch(e){}}},closeOptionBox:function(){if(this._optBox){try{this._optBox.destroy();}
catch(e){}
this._optBox=null;}},getAddFromOptBox:function(_17,_18,qty,_1a){_1a=_1a?_1a:0;var btn;try{btn=this._ordFlds[_1a]["btn"];}
catch(e){}
this.addToOrder(_18,qty,btn,"div.wse-box");},addToOrder:function(_1c,qty,btn,_1f){this.closeOptionBox();try{if(_1c&&qty){var _20={group:this.parentConfig,request:"add2Order",params:{"product_id":_1c,"qty":qty},scopeObj:this,successFn:"_updateAfterAdd",errorFn:"_updateAfterAdd"};if(btn){_20["btnId"]=btn.getId();if(_1f){_20["loadMskId"]=this._genAddMask(btn.getEl().up(_1f));}
btn.disable();}
SmartWin.requestData(_20);}}
catch(e){}},_updateAfterAdd:function(_21,_22){if(_21){SmartWin.makeCartDisplayChanges(_21["amount"],_21["subtotal"]);}
if(_22){if(_22["btnId"]){try{Ext.getCmp(_22["btnId"]).enable();}
catch(e){}}
if(_22["loadMskId"]){this._removeAddMask.defer(250,this,[_22["loadMskId"]]);}}},_genAddMask:function(el){if(el){var id=Ext.id();this._ordMask=this._ordMask?this._ordMask:{};this._ordMask[id]=new Ext.LoadMask(el,{msg:SmartWin.langLookup("adding_to_order","wait"),removeMask:true});this._ordMask[id].show();return id;}
return null;},_removeAddMask:function(id){if(id){try{this._ordMask[id].hide();delete(this._ordMask[id]);}
catch(e){}}else{if(this._ordMask){try{var i;for(i in this._ordMask){this._ordMask[i].hide();}}
catch(e){}
this._ordMask=null;}}},scrollProds:function(_27,_28){this.closeOptionBox();try{Ext.fly(_28).focus().blur();}
catch(e){}
try{var div=this.getEl().child("div.wse-glry");var w=div.getWidth();div.scroll(_27,w,true);}
catch(e){}},_displayProdData:function(_2b,_2c){_2b?_2b:{results:[]};this.setEmptyText(SmartWin.langLookup("no_related_parts","msg"));this.store.loadData(_2b.results);this._updateDisplayAfterLoad();},_genTPL:function(){var _2d=this.getId();var tpl="<div class=\"wse-app\">"+"<div class=\"wse-cntrls\" style=\"display: none;\">"+"<div class=\"wse-prev\"><a href=\"#\" onclick=\"Ext.getCmp('"+_2d+"').scrollProds('r', this); return false;\">"+"<span>"+SmartWin.langLookup("previous","button")+"</span></a></div>"+"<div class=\"wse-next\"><a href=\"#\" onclick=\"Ext.getCmp('"+_2d+"').scrollProds('l', this); return false;\">"+"<span>"+SmartWin.langLookup("next","button")+"</span></a></div>"+"</div>"+"<div class=\"wse-optpnl-hld\"></div>"+"<div class=\"wse-glry-hld\">"+"<div class=\"wse-glry\">"+"<table cellspacing=\"0\" class=\"wse-tbl\""+(this.fadeIn=="full"?" style=\"visibility: hidden;\"":"")+">"+"<tr>"+"<tpl for=\".\">"+"<td class=\"wse-td-prod{[ xindex == 1 ? \" wse-first\" : \"\"]}{[ xindex == xcount ? \" wse-last\" : \"\"]}\">"+"<div class=\"wse-box\""+(this.fadeIn=="increment"?" style=\"visibility: hidden;\"":"")+">"+"<div class=\"wse-wrap-box\">"+"<div class=\"wse-img\">"+"{[this.genImageHTML(values.image)]}"+"</div>"+"<div class=\"wse-cont\">"+"{[this.genContHTML(values.product)]}"+"</div>"+"{[this.genPriceHTML(values.prices, values.other_options)]}"+"{[values.other_options ? this.genOptionHTML(\""+_2d+"\", xindex) : \"\" ]}"+"<div class=\"wse-ord\">"+"<div class=\"wse-fld\"></div>"+"<div class=\"wse-btngrp\"></div>"+"</div>"+"</div>"+"</div>"+"</td>"+"</tpl>"+"</tr>"+"</table>"+"</div>"+"</div>"+"</div>";return new Ext.XTemplate(tpl,{noImageURL:SmartWin.getNoImageURL(),optionsText:SmartWin.langLookup("pick_option","button"),priceTxt:SmartWin.langLookup("price","label"),skuTxt:SmartWin.langLookup("sku","label"),listPriceTxt:SmartWin.langLookup("list_price","label"),yourPriceTxt:SmartWin.langLookup("your_price","label"),conf:SmartWin.getWindowConfig(this.parentConfig,"prodInfo"),genImageHTML:function(_2f){if(_2f){return"<img src=\""+_2f["url"]+"\" width=\""+_2f["width"]+"\" height=\""+_2f["height"]+"\" />";}else{return"<img src=\""+this.noImageURL+"\"/>";}},genContHTML:function(_30){if(_30){return(_30["product"]?"<h4 class=\"wse-hd\">"+_30["product"]+"</h4>":"")+(_30["product_code"]?"<p class=\"wse-sku\"><span class=\"wse-lbl\">"+this.skuTxt+" </span><span class=\"wse-val\">"+_30["product_code"]+"</span></p>":"");}
return"";},genPriceHTML:function(_31,_32){if(_31&&this.conf["includePrice"]){return"<div class=\"wse-prices"+(_32?" wse-prices-w-opts":"")+"\">"+(_31["list_price"]?"<div class=\"wse-price wse-price-ret\">"+"<span class=\"wse-lbl\">"+this.listPriceTxt+"</span>"+"<span class=\"wse-val\">"+_31["list_price"]+"</span>"+"</div>":"")+"<div class=\"wse-price wse-price-store\">"+"<span class=\"wse-lbl\">"+(_31["list_price"]?this.yourPriceTxt:this.priceTxt)+"</span>"+"<span class=\"wse-val\">"+_31["price"]+"</span>"+"</div>"+"</div>";}
return"";},genOptionHTML:function(_33,_34){if(_33){_34-=1;_34=(_34>-1)?_34:0;return"<div class=\"wse-lnk-opts\">"+"<a href=\"#\" onclick=\"Ext.getCmp('"+_33+"').showOptionPanel("+_34+", this); return false;\">"+this.optionsText+"</a></div>";}
return"";}});},_updateDisplayAfterLoad:function(){var _35=this.store.getRange();if(!_35){return;}
var l=_35.length;var i,o,_39,c;var dv=this.getComponent(0);var _3c=this.getId();var txt=SmartWin.langLookup("rel_add_to_order","button");this._ordFlds=[];var _3e=(this.fadeIn=="increment");var _3f=100;for(i=0;i<l;i++){o=_35[i].data;_39=dv.getNode(i);if(o["product"]&&o["product"]["product_id"]&&_39){this._genOrdItems(_39,_3c,o["product"]["product_id"],(o["product"]["quantity"]?o["product"]["qty"]:1),txt,null,i);if(_3e){try{c=Ext.get(_39);c.show.defer(_3f,c,[true]);_3f+=200;}
catch(e){}}}}
this._sizeProdCells();if(this.fadeIn=="full"){try{this.getEl().child("table.wse-tbl").show(true);}
catch(e){}}},_genOrdItems:function(_40,_41,_42,qty,txt,_45,_46){if(_40&&_42){this._ordFlds=this._ordFlds?this._ordFlds:[];_41=_41?_41:this.getId();txt=txt?txt:SmartWin.langLookup("rel_add_to_order","button");_45=_45?_45:"div.wse-box";qty=qty?qty:1;_46=_46?_46:this._ordFlds.length;var id=Ext.id();try{this._ordFlds.push({"hidden":new Ext.form.Hidden({value:_42,name:"prodId",renderTo:Ext.get(_40).child("div.wse-fld"),id:id+"-prodId"}),"input":new Ext.form.NumberField({name:"qty",width:30,minValue:1,value:qty,id:id+"-qty",renderTo:Ext.get(_40).child("div.wse-fld")}),"btn":new Ext.Button({text:txt,handler:function(btn){try{Ext.getCmp(_41).addToOrder(Ext.getCmp(id+"-prodId").getValue(),Ext.getCmp(id+"-qty").getValue(),btn,_45);}
catch(e){}},renderTo:Ext.get(_40).child("div.wse-btngrp")})});}
catch(e){}}},_clearOrdItems:function(){if(this._ordFlds){var i,o;var l=this._ordFlds.length;for(i=0;i<l;i++){o=this._ordFlds[i];try{o["input"].destroy();o["btn"].destroy();o["hidden"].destroy();}
catch(e){}}}
this._ordFlds=null;},_sizeProdCells:function(){try{var c=this.displayCells?this.displayCells:3;var aW=this.getEl().child("div.wse-glry").getWidth();var _4e=this.getComponent(0).getNodes();var n=Math.round(aW/c);var ex=aW%c;var j=1;var i;var l=_4e.length;for(i=0;i<l;i++){if(j>c){j=1;}
Ext.fly(_4e[i]).setWidth(n+(j==c?ex:0));j++;}}
catch(e){}
try{this._optPnlWidth=(n*this.optPnlCellOverlay)+2;}
catch(e){}
try{var _54=this.getEl().child("div.wse-cntrls");_54.setVisibilityMode(Ext.Element.DISPLAY);_54[((l>c)?"show":"hide")]();}
catch(e){}}});Ext.reg("SmartWin.comp.RelatedProd",SmartWin.comp.RelatedProd);
SmartWin.comp.OrderList=Ext.extend(Ext.Panel,{xtype:"SmartWin.comp.OrderList",border:false,height:200,width:200,autoScroll:true,parentConfig:"add2OrdOpts",highLiteOn:false,updateColor:"ffcc00",deleteColor:"ff0000",hdField:"product",cls:"wse-swin-cmp wse-swin-cmp-ordlst",_haltChange:false,initComponent:function(){this.addEvents("itemselect");var _1=SmartWin.getWindowConfig(this.parentConfig,"orderList");var n=Number(_1["height"]);if(n){this.height=n;this.autoHeight=false;}
n=Number(_1["width"]);this.width=n;this.title=SmartWin.langLookup("order_list","title");if(_1["hideTitle"]===true){this.header=false;}
if(_1["hdField"]){this.hdField=_1["hdField"];}
if(_1["highLiteOn"]===true){this.highLiteOn=true;if(_1["updateColor"]){this.updateColor=_1["updateColor"];}
if(_1["deleteColor"]){this.deleteColor=_1["deleteColor"];}}
this.store=new Ext.data.JsonStore({data:[],autoLoad:false,id:"order_item_id",fields:["order_item_id","product","prices","image","order_line_item_data","deleted","unavailable","modified"]});this.items=[{xtype:"dataview",tpl:this._genTPL(),store:this.store,overClass:"wse-box-over",itemSelector:"div.wse-box",selectedClass:"wse-selected",emptyText:"",loadingText:null,singleSelect:true,autoHeight:true,listeners:{selectionchange:this.sendSelection.createDelegate(this),beforeselect:this.checkForHalt.createDelegate(this),beforeclick:this.checkForHalt.createDelegate(this)}}];SmartWin.comp.OrderList.superclass.initComponent.call(this);},onRender:function(ct,_4){SmartWin.comp.OrderList.superclass.onRender.call(this,ct,_4);this.doLayout.defer(100,this);},onDestroy:function(){try{this.store.removeAll();}
catch(e){}
delete(this.store);SmartWin.widget.OrderList.superclass.onDestroy.call(this);},loadData:function(_5){_5=Ext.isArray(_5)?_5:[];this.setEmptyText(SmartWin.langLookup("no_order_items","msg"));this.store.loadData(_5);if(this.store.getCount()){this.getComponent(0).select(0);}},clearData:function(){this.setEmptyText(SmartWin.langLookup("no_order_items","msg"));this.store.removeAll();},setEmptyText:function(_6,_7){try{var _8=this.getComponent(0);_8.emptyText="<div class=\"wse-noresults\">"+_6+"</div>";if(_7){_8.refresh();}}
catch(e){}},getAvailOrderItems:function(){var _9=this.store.getRange();var _a=[];var l=_9.length;var i,o;for(i=0;i<l;i++){o=_9[i].data;if(!o["deleted"]&&!o["unavailable"]&&o["product"]["not_available_for_ordering"]!="Y"){_a.push(o);}}
return _a;},sendSelection:function(dv,_f){var _10=dv.getSelectedRecords();if(_10&&_10[0]){this.fireEvent("itemselect",_10[0].id,_10[0].data["product"]);}},checkForHalt:function(){if(this._haltStatus){this.setHaltStatus(false);return false;}
return true;},delItem:function(_11,_12,el){this.setHaltStatus(true);if(el){try{Ext.fly(el).blur();}
catch(e){}}
try{this.store.suspendEvents();var r=this.store.getById(_11);r.set("deleted",_12);this.store.resumeEvents();this.store.commitChanges();if(this.highLiteOn){var n=this.store.indexOf(r);try{Ext.get(this.getComponent(0).getNode(n)).highlight((_12?this.deleteColor:this.updateColor));}
catch(e){}}}
catch(e){}
this.setHaltStatus.defer(500,this,[false]);},setHaltStatus:function(_16){this._haltStatus=_16;},addOrderItems:function(_17){_17=_17?_17:{};try{var r=this.store.getById(_17["order_item_id"]);if(!r){if(_17["product"]["not_available_for_ordering"]=="Y"){_17["unavailable"]=true;}
_17["deleted"]=false;var t=new Date();_17["modified"]=t.getTime();this.store.loadData([_17],true);}}
catch(e){}},updateOrderItem:function(_1a,_1b){_1b=_1b?_1b:{};var o;try{this.store.suspendEvents();var r=this.store.getById(_1a);if(_1b["product"]){var o=r.get("product");o=Ext.apply(o,_1b["product"]);r.set("product",o);}
if(_1b["prices"]){var o=r.get("prices");o=Ext.apply(o,_1b["prices"]);r.set("prices",o);}
r.set("deleted",false);var t=new Date();r.set("modified",t.getTime());this.store.resumeEvents();this.store.commitChanges();if(this.highLiteOn){var n=this.store.indexOf(r);try{Ext.get(this.getComponent(0).getNode(n)).highlight(this.updateColor);}
catch(e){}}}
catch(e){}},_genTPL:function(){var _20=this.getId();var tpl="<div class=\"wse-boxes\">"+"<tpl for=\".\">"+"<div class=\"wse-box {[xindex % 2 === 0 ? \"wse-even\" : \"wse-odd\"]}{[values.deleted ? \" wse-deleted\" : \"\" ]}{[values.product.not_available_for_ordering == \"Y\" ? \" wse-unavailable\" : \"\" ]}\">"+"<div class=\"wse-wrap\">"+"<div class=\"wse-lnks\">"+"{[this.genDelBtnHTML(values.order_item_id, values.deleted, values.product)]}"+"</div>"+"<div class=\"wse-cont\">"+"{[ this.genContHTML(values.product) ]}"+"{[ this.genPriceHTML(values.prices) ]}"+"{[ this.genQtyHTML(values.product) ]}"+"<p class=\"wse-update\">"+SmartWin.langLookup("change_item","button")+"</p>"+"</div>"+"</div>"+"</div>"+"</tpl>"+"</div>";return new Ext.XTemplate(tpl,{compId:this.getId(),priceTxt:SmartWin.langLookup("price","label"),listPriceTxt:SmartWin.langLookup("list_price","label"),yourPriceTxt:SmartWin.langLookup("your_price","label"),skuTxt:SmartWin.langLookup("sku","label"),qtyTxt:SmartWin.langLookup("qty","label"),delTxt:SmartWin.langLookup("del","button"),unDelTxt:SmartWin.langLookup("unDel","button"),hdField:this.hdField,conf:SmartWin.getWindowConfig(this.parentConfig,"prodInfo"),genDelBtnHTML:function(_22,del,_24){if(_24["not_available_for_ordering"]=="Y"){return"";}else{if(_22){if(del){return"<div class=\"wse-lnk wse-lnk-undel\">"+"<a href=\"#\" onclick=\"Ext.getCmp('"+this.compId+"').delItem('"+_22+"', false, this); return false;\">"+"<span>"+this.unDelTxt+"</span></a></div>";}
return"<div class=\"wse-lnk wse-lnk-del\">"+"<a href=\"#\" onclick=\"Ext.getCmp('"+this.compId+"').delItem('"+_22+"', true, this); return false;\">"+"<span>"+this.delTxt+"</span></a></div>";}}
return"";},genContHTML:function(_25){if(_25){return(_25["product"]?"<h4 class=\"wse-hd\">"+_25[this.hdField]+"</h4>":"")+"<p class=\"wse-sku\"><span class=\"wse-lbl\">"+this.skuTxt+" </span><span class=\"wse-val\">"+_25["product_code"]+"</span></p>";}
return"";},genQtyHTML:function(_26){if(_26["not_available_for_ordering"]=="Y"){return"";}
var qty=1;if(_26){qty=_26["qty"]?_26["qty"]:qty;}
return"<p class=\"wse-qty\"><span class=\"wse-lbl\">"+this.qtyTxt+" </span><span class=\"wse-val\">"+qty+"</span></p>";},genPriceHTML:function(_28){if(_28&&this.conf["includePrice"]){return"<div class=\"wse-prices\">"+(_28["list_price"]?"<div class=\"wse-price wse-price-ret\">"+"<span class=\"wse-lbl\">"+this.listPriceTxt+"</span>"+"<span class=\"wse-val\">"+_28["list_price"]+"</span>"+"</div>":"")+"<div class=\"wse-price wse-price-store\">"+"<span class=\"wse-lbl\">"+(_28["list_price"]?this.yourPriceTxt:this.priceTxt)+"</span>"+"<span class=\"wse-val\">"+_28["price"]+"</span>"+"</div>"+"</div>";}
return"";}});}});Ext.reg("SmartWin.comp.OrderList",SmartWin.comp.OrderList);
SmartWin.widget={};SmartWin.widget.tab={};
SmartWin.widget.ProdInfo=Ext.extend(Ext.Panel,{xtype:"SmartWin.widget.ProdInfo",border:false,autoHeight:true,parentConfig:"prodDetail",cls:"wse-swin-wdg wse-swin-wdg-pinfo",_includeImage:false,_allowImageZoom:false,initComponent:function(){var _1=SmartWin.getWindowConfig(this.parentConfig);var _2=_1["prodInfo"];this._includeImage=(_2["includeImage"]===true)?true:false;this._allowImageZoom=(_2["allowImageZoom"]===true)?true:false;var _3="";if(_2["includeDesc"]){_3="<div class=\"wse-desc\"><div class=\"wse-content-block\">{"+_2["descField"]+"}</div></div>";}
var _4="";if(_2["includeSubhd"]){_4="<h3 class=\"wse-subhd\"><span>{"+_2["subHdField"]+"}</span></h3>";}
var _5="";if(_2["includeDischd"]){_5="<h4 class=\"wse-dischd\"><span>{"+_2["discHdField"]+"}</span></h4>";}
var _6="<div class=\"wse-cont {extra_css}\">"+"<h2 class=\"wse-hd\"><span>{"+(_2["hdField"]?_2["hdField"]:"product")+"}</span></h2>"+"{image_str}"+_4+_5+_3+"</div>";this.template=new Ext.XTemplate(_6);this.template.compile();SmartWin.widget.ProdInfo.superclass.initComponent.call(this);},onRender:function(ct,_8){SmartWin.widget.ProdInfo.superclass.onRender.call(this,ct,_8);},displayInfo:function(_9,_a){_9=_9?_9:{};this.body.scrollTo("t",0);this.body.scrollTo("l",0);if(_9["product_id"]>=0){_9["image_str"]="";_9["extra_css"]="wse-cont-noimg";if(this._includeImage){var _b="<div class=\"wse-img\">";if(_a){_b+="<img src=\""+_a["url"]+"\" width=\""+_a["width"]+"\" height=\""+_a["height"]+"\" />";if(this._allowImageZoom&&_a["detailed_url"]){_b+="<a class=\"wse-zoom\" onclick=\"SmartWin.showLargeImgView('"+_a["detailed_url"]+"', '"+_a["detailed_width"]+"', '"+_a["detailed_height"]+"', this, 'div.wse-img'); return false;\"><span>"+SmartWin.langLookup("zoom","button")+"</span></a>";}}else{_b+="<img src=\""+SmartWin.getNoImageURL()+"\"  />";}
_b+="</div>";_9["image_str"]=_b;_9["extra_css"]="wse-cont-w-img";}
if(this.rendered){this.body.update(this.template.apply(_9));}else{this.html=this.template.apply(_9);}}else{if(this.rendered){this.body.update(SmartWin.langLookup("no_product_info","msg"));}else{this.html=SmartWin.langLookup("no_product_info","msg");}}}});Ext.reg("SmartWin.widget.ProdInfo",SmartWin.widget.ProdInfo);
SmartWin.widget.ProdTabs=Ext.extend(Ext.TabPanel,{enableTabScroll:true,layoutOnTabChange:true,_tabIds:null,activeTab:0,border:false,cls:"wse-swin-wdg wse-swin-wdg-tabs",parentConfig:"prodDetail",initComponent:function(){this._tabIds=[];this.items=[{id:this.getId()+"-temp",xtype:"panel",border:false,title:"&nbsp;",html:"&nbsp;"}];SmartWin.widget.ProdTabs.superclass.initComponent.call(this);},clearTabs:function(_1){this._hideFirstTab();var i;var l=this._tabIds.length;for(i=0;i<l;i++){try{this.remove(this._tabIds[i]);}
catch(e){}}
this._tabIds=[];if(_1){this.hide();}},addProdTabs:function(_4,_5,_6){this._hideFirstTab();var b=false;if(_6){this.show();}
if(_5){this.clearTabs();b=true;}
if(Ext.isArray(_4)){var _8=this.getId();var i,o,c,s;var l=_4.length;for(i=0;i<l;i++){o=_4[i];s=Ext.id();switch(o["type"]){case"features":c={xtype:"SmartWin.widget.tab.Features",values:o["values"],id:s,title:o["title"],autoHeight:false,autoScroll:true};break;case"specs":c={xtype:"SmartWin.widget.tab.Specs",values:o["values"],id:s,title:o["title"],autoHeight:false,autoScroll:true};break;case"seeAlso":c={xtype:"SmartWin.widget.tab.SeeAlso",data:o["data"],id:s,title:o["title"],autoHeight:false,parentConfig:this.parentConfig,autoScroll:true};break;case"notes":c={xtype:"EpcPlugins.notes.Panel",id:s,appMgr:SmartWin,parentConfig:this.parentConfig,title:o["title"],canAddNotes:o["canAddNotes"],includeNoteTypes:o["includeNoteTypes"],includeGlobalCheck:o["includeGlobalCheck"],bomItemId:o["bomItemId"],productId:o["productId"]};break;case"bulletins":c={xtype:"EpcPlugins.bulletins.Panel",bindType:o["bindType"],id:s,bindId:o["bindId"],title:o["title"],parentConfig:this.parentConfig,appMgr:SmartWin};break;default:c={xtype:"SmartWin.widget.tab.Description",text:o["text"],id:s,title:o["title"],autoHeight:false,autoScroll:true};break;}
try{this.add(c);}
catch(e){}
this._tabIds.push(s);}
if(b){this.getComponent(this._tabIds[0]).show();}
if((this.getActiveTab().id==this.getId()+"-temp")&&this._tabIds.length>0){this.getComponent(this._tabIds[this._tabIds.length-1]).show();}}},_hideFirstTab:function(){try{this.hideTabStripItem(this.getComponent(0));}
catch(e){}}});Ext.reg("SmartWin.widget.ProdTabs",SmartWin.widget.ProdTabs);
SmartWin.widget.tab.Description=Ext.extend(Ext.Panel,{text:"",cls:"wse-swin-tab wse-swin-tab-desc",initComponent:function(){this.html="<div class=\"wse-cont\"><div class=\"wse-content-block\">"+this.text+"</div></div>";SmartWin.widget.tab.Description.superclass.initComponent.call(this);}});Ext.reg("SmartWin.widget.tab.Description",SmartWin.widget.tab.Description);
SmartWin.widget.tab.Features=Ext.extend(Ext.Panel,{values:null,cls:"wse-swin-tab wse-swin-tab-feat",initComponent:function(){this.values=this.values?this.values:[];this.html=this._genList();SmartWin.widget.tab.Features.superclass.initComponent.call(this);},_genList:function(){var _1="<div class=\"wse-lst\">";var i,o;var l=this.values.length;if(l){_1+="<ul>";}
var _5="wse-odd";for(i=0;i<l;i++){o=this.values[i];_1+="<li class=\""+_5+"\"><span class=\"wse-lbl\">"+o["label"]+":</span> <span class=\"wse-val\">"+o["value"]+"</span></li>";_5=(_5=="wse-even")?"wse-odd":"wse-even";}
if(l){_1+="</ul>";}
_1+="</div>";return _1;}});Ext.reg("SmartWin.widget.tab.Features",SmartWin.widget.tab.Features);
SmartWin.widget.tab.Specs=Ext.extend(Ext.Panel,{values:null,cls:"wse-swin-tab wse-swin-tab-spec",_rowCls:null,initComponent:function(){this.values=this.values?this.values:[];this.html=this._genTable();SmartWin.widget.tab.Specs.superclass.initComponent.call(this);},_genTable:function(){var _1="<div class=\"wse-tbl\">";var i,o;var l=this.values.length;if(l){_1+="<table cellspacing=\"0\">";}
this._rowCls="wse-odd";for(i=0;i<l;i++){o=this.values[i];_1+=this._genSpecHTML(o);}
if(l){_1+="</table>";}
_1+="</div>";return _1;},_genSpecHTML:function(_5){var _6="";if(_5){if(_5.children){_6+="<tr class=\"wse-level-"+_5.level+"\">"+"<th class=\"wse-parent\" colspan=\"2\">"+_5.label+"</th></tr>";this._rowCls="wse-odd";var i;var l=_5.children.length;for(i=0;i<l;i++){_6+=this._genSpecHTML(_5.children[i]);}}else{_6+="<tr class=\""+this._rowCls+"\">"+"<th class=\"wse-lbl\">"+_5["label"]+":</th>"+"<td class=\"wse-val\">"+_5["value"]+"</td>"+"</tr>";this._rowCls=(this._rowCls=="wse-even")?"wse-odd":"wse-even";}}
return _6;}});Ext.reg("SmartWin.widget.tab.Specs",SmartWin.widget.tab.Specs);
SmartWin.widget.tab.SeeAlso=Ext.extend(Ext.Panel,{data:null,cls:"wse-swin-tab wse-swin-tab-seealso",parentConfig:"prodDetail",initComponent:function(){this.data=this.data?this.data:[];this._genHtml();SmartWin.widget.tab.SeeAlso.superclass.initComponent.call(this);},loadManual:function(_1){try{Ext.History.add(_1);}
catch(e){}
SmartWin.closeActiveWindows();},_genHtml:function(){this.html="&nbsp;";if(Ext.isArray(this.data)){this.html="<div class=\"wse-cont\"><div class=\"wse-content-block\"><ul>";var _2=SmartWin.getWindowConfig(this.parentConfig)["seeAlsoOpenLinksInNewWindow"];var _3=this.getId();var i,l=this.data.length;for(i=0;i<l;i++){var _6="epc::mr"+this.data[i].manual_revision_id;if(Number(this.data[i].assembly_revision_id)>0){_6+="ar"+this.data[i].assembly_revision_id;}
if(_2){this.html+="<li><a href=\""+_6+"\" target=\"_blank\">"+this.data[i].name+"</a></li>";}else{this.html+="<li><a href=\"#\" onclick=\"Ext.getCmp('"+_3+"').loadManual('"+_6+"'); return false;\">"+this.data[i].name+"</a></li>";}}
this.html+="</ul></div></div>";}}});Ext.reg("SmartWin.widget.tab.SeeAlso",SmartWin.widget.tab.SeeAlso);
SmartWin.widget.PriceBox=Ext.extend(Ext.Panel,{xtype:"SmartWin.widget.PriceBox",border:false,autoHeight:true,parentConfig:"prodDetail",cls:"wse-swin-wdg wse-swin-wdg-prce",linkText:null,title:" ",initComponent:function(){this.addEvents("optionselect");this.template=this._genTPL();this.template.compile();this.genPriceTitle(false);SmartWin.widget.PriceBox.superclass.initComponent.call(this);},onRender:function(ct,_2){SmartWin.widget.PriceBox.superclass.onRender.call(this,ct,_2);},_genTPL:function(){var _3="<div class=\"wse-cont{[values.option_info ? \" wse-cont-w-opt\" : \"\" ]}\">"+"{[ this.genOptionHTML(values.option_info, values.product) ]}"+"{[ this.genInfoHTML(values.product) ]}"+"{[ this.genPriceHTML(values.prices) ]}"+"</div>";return new Ext.XTemplate(_3,{skuTxt:SmartWin.langLookup("sku","label"),priceTxt:SmartWin.langLookup("price","label"),listPriceTxt:SmartWin.langLookup("list_price","label"),yourPriceTxt:SmartWin.langLookup("your_price","label"),selectTxt:SmartWin.langLookup("select","button"),weightTxt:SmartWin.langLookup("weight","label"),weightDimTxt:SmartWin.langLookup("weight_dimension","label"),lengthTxt:SmartWin.langLookup("length","label"),lengthDimTxt:SmartWin.langLookup("length_dimension","label"),widthTxt:SmartWin.langLookup("width","label"),widthDimTxt:SmartWin.langLookup("width_dimension","label"),heightTxt:SmartWin.langLookup("height","label"),heightDimTxt:SmartWin.langLookup("height_dimension","label"),compId:this.getId(),conf:SmartWin.getWindowConfig(this.parentConfig,"prodInfo"),genInfoHTML:function(_4){var _5="";if(_4){_5="<h4 class=\"wse-hd\">"+_4["product"]+"</h4>"+"<p class=\"wse-sku\">"+"<span class=\"wse-lbl\">"+this.skuTxt+" </span><span class=\"wse-val\">"+_4["product_code"]+"</span>"+"</p>";if(this.conf["includeWeight"]&&_4["weight"]>0){_5+="<p class=\"wse-weight\">"+"<span class=\"wse-lbl\">"+this.weightTxt+" </span><span class=\"wse-val\">"+_4["weight"]+"</span> "+this.weightDimTxt+"</p>";}
if(this.conf["includeDims"]){if(_4["length"]>0){_5+="<p class=\"wse-length\">"+"<span class=\"wse-lbl\">"+this.lengthTxt+" </span><span class=\"wse-val\">"+_4["length"]+"</span> "+this.lengthDimTxt+"</p>";}
if(_4["width"]>0){_5+="<p class=\"wse-width\">"+"<span class=\"wse-lbl\">"+this.widthTxt+" </span><span class=\"wse-val\">"+_4["width"]+"</span> "+this.widthDimTxt+"</p>";}
if(_4["height"]>0){_5+="<p class=\"wse-height\">"+"<span class=\"wse-lbl\">"+this.heightTxt+" </span><span class=\"wse-val\">"+_4["height"]+"</span> "+this.heightDimTxt+"</p>";}}}
return _5;},genOptionHTML:function(_6,_7){if(_6&&_7){return"<div class=\"wse-opt"+(_6["code"]?" wse-opt-"+_6["code"]:"")+"\">"+"<a href=\"#\" onclick=\"Ext.getCmp('"+this.compId+"').selectAsActive('"+_7["product_id"]+"', this); return false;\"><span>"+this.selectTxt+"</span></a>"+(_6["icon"]?"<span class=\"wse-img\"><img src=\""+_6["icon"]["url"]+"\" width=\""+_6["icon"]["width"]+"\" height=\""+_6["icon"]["height"]+"\" /></span>":"")+"<span class=\"wse-name\">"+_6["name"]+"</span>"+"</div>";}
return"";},genPriceHTML:function(_8){if(_8&&this.conf["includePrice"]){return"<div class=\"wse-prices\">"+(_8["list_price"]?"<div class=\"wse-price wse-price-ret\">"+"<span class=\"wse-lbl\">"+this.listPriceTxt+"</span>"+"<span class=\"wse-val\">"+_8["list_price"]+"</span>"+"</div>":"")+"<div class=\"wse-price wse-price-store\">"+"<span class=\"wse-lbl\">"+(_8["list_price"]?this.yourPriceTxt:this.priceTxt)+"</span>"+"<span class=\"wse-val\">"+_8["price"]+"</span>"+"</div>"+"</div>";}
return"";}});},displayInfo:function(_9,_a){_9=_9?_9:{};this.body.scrollTo("t",0);this.body.scrollTo("l",0);if(_9["product"]){if(this.rendered){this.body.update(this.template.apply(_9));}else{this.html=this.template.apply(_9);}
this.show();}else{if(this.rendered){this.body.update("&nbsp;");}else{this.html="&nbsp;";}
this.hide();}
this.showAsActive(true);this.genPriceTitle(_a);},genPriceTitle:function(_b){var s,_d,_e;if(_b){s=SmartWin.langLookup("select_option_and_qty","title");}else{s=SmartWin.langLookup("select_qty","title");}
_d=SmartWin.getWindowConfig(this.parentConfig,"includeDealerLocator");if(_d){this.linkText=s;this.findCookieDealer();}else{_e=s;if(this.rendered){this.setTitle(_e);}else{this.title=_e;}}},findCookieDealer:function(){SmartWin.requestData({group:this.parentConfig,request:"cookieDealer",params:{},scopeObj:this,successFn:"_handleCookieDealer",errorFn:"_handleCookieDealer"});},_handleCookieDealer:function(_f,_10){var _11;if(_f>0){_11=this.linkText;}else{_11="<a href=\"#\" onclick=\"javascript: attemptFuncCall('chooseDealer', [this, null]); return false;\">"+this.linkText+"</a>";}
if(this.rendered){this.setTitle(_11);}else{this.title=_11;}},selectAsActive:function(_12,el){if(el){try{Ext.fly(el).blur();}
catch(e){}}
this.fireEvent("optionselect",this,_12);},showAsActive:function(_14){try{if(_14){this.getEl().removeClass("wse-swin-wdg-inactprce");}else{this.getEl().addClass("wse-swin-wdg-inactprce");}}
catch(e){}}});Ext.reg("SmartWin.widget.PriceBox",SmartWin.widget.PriceBox);
SmartWin.widget.ProdOpts=Ext.extend(Ext.Panel,{xtype:"SmartWin.widget.ProdOpts",border:false,parentConfig:"prodDetail",autoScroll:true,cls:"wse-swin-wdg wse-swin-wdg-opts",store:null,initComponent:function(){this.addEvents("optionselect");this.store=new Ext.data.JsonStore({data:[],autoLoad:false,id:"product_id",fields:["product_code","product_id","product","option_name","option_code","prices","icon"]});this.genOptionTitle();this.items=[{xtype:"dataview",tpl:this._genTPL(),store:this.store,overClass:"wse-box-over",itemSelector:"div.wse-box",selectedClass:"wse-active",emptyText:SmartWin.langLookup("no_options","msg"),loadingText:null,singleSelect:true,autoHeight:true,listeners:{selectionchange:this.sendSelection.createDelegate(this)}}];SmartWin.widget.ProdOpts.superclass.initComponent.call(this);},onRender:function(ct,_2){SmartWin.widget.ProdOpts.superclass.onRender.call(this,ct,_2);},onDestroy:function(){try{this.store.removeAll();}
catch(e){}
delete(this.store);SmartWin.widget.ProdOpts.superclass.onDestroy.call(this);},_genTPL:function(){var _3=this.getId();var _4="<div class=\"wse-boxes\">"+"<tpl for=\".\">"+"<div class=\"wse-box {[xindex % 2 === 0 ? \"wse-even\" : \"wse-odd\"]}\">"+"<div class=\"wse-wrap\">"+"<div class=\"wse-opt{[ values.option_code ? \" wse-opt-\"+values.option_code : \"\" ]}\">"+"<a href=\"#\" onclick=\"Ext.getCmp('"+_3+"').selectOption('{product_id}', this); return false;\"><span>"+SmartWin.langLookup("select","button")+" </span></a>"+"{[ this.genIconHTML(values.icon) ]}"+"<span class=\"wse-name\">{option_name}</span>"+"</div>"+"<h4 class=\"wse-hd\">{product}</h4>"+"<div class=\"wse-sku\">"+"<span class=\"wse-lbl\">"+SmartWin.langLookup("sku","label")+" </span><span class=\"wse-val\">{product_code}</span>"+"</div>"+"{[ this.genPriceHTML(values.prices) ]}"+"</div>"+"</div>"+"</tpl>"+"</div>";return new Ext.XTemplate(_4,{priceTxt:SmartWin.langLookup("price","label"),listPriceTxt:SmartWin.langLookup("list_price","label"),yourPriceTxt:SmartWin.langLookup("your_price","label"),conf:SmartWin.getWindowConfig(this.parentConfig,"prodInfo"),genIconHTML:function(_5){if(_5){return"<span class=\"wse-img\"><img src=\""+_5["url"]+"\" width=\""+_5["width"]+"\" height=\""+_5["height"]+"\" /></span>";}
return"";},genPriceHTML:function(_6){if(_6&&this.conf["includePrice"]){return"<div class=\"wse-prices\">"+(_6["list_price"]?"<div class=\"wse-price wse-price-ret\">"+"<span class=\"wse-lbl\">"+this.listPriceTxt+"</span>"+"<span class=\"wse-val\">"+_6["list_price"]+"</span>"+"</div>":"")+"<div class=\"wse-price wse-price-store\">"+"<span class=\"wse-lbl\">"+(_6["list_price"]?this.yourPriceTxt:this.priceTxt)+"</span>"+"<span class=\"wse-val\">"+_6["price"]+"</span>"+"</div>"+"</div>";}
return"";}});},genOptionTitle:function(){var _7=0;var s;try{_7=this.store.getCount();}
catch(e){}
if(_7==1){s=SmartWin.langLookup("other_options_single","title");}else{if(_7){s=String.format(SmartWin.langLookup("other_options_multi","title"),_7);}else{s=SmartWin.langLookup("other_options","title");}}
if(this.rendered){this.setTitle(s);}else{this.title=s;}},sendSelection:function(dv,_a){var i;var l=_a.length;for(i=0;i<l;i++){var r=dv.getRecord(_a[i]);if(r){this.fireEvent("optionselect",this,r.id);break;}}},clearOptions:function(){this.store.removeAll();this.genOptionTitle();},displayOptions:function(_e){this.store.loadData(_e);this.genOptionTitle();},selectOption:function(_f,el){_f=Number(_f)?_f:0;var _11="-1";var _12=this.getComponent(0);if(el){try{Ext.fly(el).blur();}
catch(e){}}
if(_f){_11=this.store.find("product_id",_f);}
if(_11>=0){var _13=_12.getNode(_11);_12.select(_13,false,true);try{Ext.get(_13).scrollIntoView(this.body);}
catch(e){_12.clearSelections(true);}}else{_12.clearSelections(true);}}});Ext.reg("SmartWin.widget.ProdOpts",SmartWin.widget.ProdOpts);
SmartWin.widget.RelOptionBox=Ext.extend(Ext.Panel,{xtype:"SmartWin.widget.RelOptionBox",border:false,cls:"wse-swin-wdg wse-swin-wdg-rlpdopt",data:null,indexRef:0,_prodId:0,_initProdId:0,floating:true,shim:true,shadow:true,initComponent:function(){this.addEvents("addtoorder","closeneeded");var _1=this.getId();this.store=new Ext.data.JsonStore({data:[],autoLoad:false,id:"product_id",fields:["product_id","product_code","product_name","option_name","option_code","prices"]});this.items=[{xtype:"panel",cls:"wse-lnk-hld",html:"<a href=\"#\" onclick=\"Ext.getCmp('"+_1+"').sendCloseEvent(); return false;\"><span>"+SmartWin.langLookup("close","button")+"</span></a>",border:false},{xtype:"panel",layout:"column",border:false,items:[{xtype:"panel",columnWidth:0.5,border:false,html:"&nbsp;",id:_1+"-info",cls:"wse-swin-col wse-swin-col-1"},{xtype:"panel",columnWidth:0.5,border:false,cls:"wse-swin-col wse-swin-col-2",autoScroll:true,items:[{xtype:"dataview",tpl:this._genOptionTPL(),store:this.store,id:_1+"-opts",itemSelector:"div.wse-box",overClass:"wse-box-over",selectedClass:"wse-selected",emptyText:"<div class=\"wse-noresults\">"+SmartWin.langLookup("no_options","msg")+"</div>",loadingText:null,singleSelect:true,autoHeight:true,listeners:{selectionchange:this.changeSelectProdId.createDelegate(this)}}]}]}];SmartWin.widget.RelOptionBox.superclass.initComponent.call(this);},onRender:function(ct,_3){SmartWin.widget.RelOptionBox.superclass.onRender.call(this,ct,_3);this.displayData.defer(100,this,[this.data]);},onDestroy:function(){this.store.purgeListeners();this.store=null;var _4=this.getId();try{Ext.getCmp(_4+"-btn").destroy();}
catch(e){}
try{Ext.getCmp(_4+"-qty").destroy();}
catch(e){}
SmartWin.widget.RelOptionBox.superclass.onDestroy.call(this,ct,position);},sendCloseEvent:function(){this.fireEvent.defer(250,this,["closeneeded",this]);},displayData:function(_5){if(!this.rendered){this.displayData.defer(250,this,[_5]);return;}
var _6=this.getId();_5=_5?_5:{};if(_5["product"]){this._prodId=_5["product"]["product_id"];this._initProdId=this._prodId;}
var _7=this._genInfoHTML(_5);try{this.findById(_6+"-info").body.update(_7);}
catch(e){}
var _8=new Ext.form.NumberField({name:"qty",width:30,minValue:1,value:(_5["product"]["quantity"]?_5["product"]["quantity"]:1),id:_6+"-qty",renderTo:this.getEl().child("div.wse-fld")});var _9=new Ext.Button({text:SmartWin.langLookup("rel_add_to_order","button"),id:_6+"-btn",handler:this.addToOrder.createDelegate(this),renderTo:this.getEl().child("div.wse-btngrp")});try{this.store.loadData(this._prepareOptionData(_5));this.findById(_6+"-opts").select(0);}
catch(e){}
this.doLayout();},changeSelectProdId:function(dv,_b){var _c=dv.getSelectedRecords();if(_c[0]){this._prodId=_c[0].data["product_id"];}
this.updateMainCls();},updateMainCls:function(){try{this.getEl().child("div.wse-main")[(this._initProdId==this._prodId)?"removeClass":"addClass"]("wse-inactive");}
catch(e){}},addToOrder:function(_d){var _e=0;try{_e=Ext.getCmp(this.getId()+"-qty").getValue();}
catch(e){}
if(this._prodId&&_e){this.fireEvent("addtoorder",this,this._prodId,_e,this.indexRef);}},_prepareOptionData:function(_f){var d=[];_f=_f?_f:{};if(_f["option_info"]){d.push({"option_code":_f["option_info"]["code"],"option_name":_f["option_info"]["name"],"product_name":(_f["product"]?_f["product"]["product"]:""),"product_code":(_f["product"]?_f["product"]["product_code"]:""),"product_id":(_f["product"]?_f["product"]["product_id"]:""),"prices":_f["prices"]});}
if(_f["other_options"]){var i,o;var l=_f["other_options"].length;for(i=0;i<l;i++){o=_f["other_options"][i];d.push({"option_code":o["option_code"],"option_name":o["option_name"],"product_name":o["product"],"product_code":o["product_code"],"prices":o["prices"],"product_id":o["product_id"]});}}
return d;},_genInfoHTML:function(_14){_14=_14?_14:{};var _15="<div class=\"wse-main\">"+"<div class=\"wse-wrap\">"+"<div class=\"wse-img\">";if(_14["image"]){_15+="<img src=\""+_14["image"]["url"]+"\" width=\""+_14["image"]["width"]+"\" height=\""+_14["image"]["height"]+"\" />";}else{_15+="<img src=\""+SmartWin.getNoImageURL()+"\"/>";}
_15+="</div>";if(_14["product"]){_15+="<h4 class=\"wse-hd\">"+_14["product"]["product"]+"</h4>"+"<p class=\"wse-sku\">"+_14["product"]["product_code"]+"</p>";}
if(_14["prices"]){_15+="<div class=\"wse-prices\">"+(_14["prices"]["list_price"]?"<div class=\"wse-price wse-price-ret\">"+"<span class=\"wse-lbl\">"+SmartWin.langLookup("list_price","label")+"</span>"+"<span class=\"wse-val\">"+_14["prices"]["list_price"]+"</span>"+"</div>":"")+"<div class=\"wse-price wse-price-store\">"+"<span class=\"wse-lbl\">"+(_14["prices"]["list_price"]?SmartWin.langLookup("your_price","label"):SmartWin.langLookup("price","label"))+"</span>"+"<span class=\"wse-val\">"+_14["prices"]["price"]+"</span>"+"</div>"+"</div>";}
_15+="<div class=\"wse-ord\">"+"<div class=\"wse-fld\"></div>"+"<div class=\"wse-btngrp\"></div>"+"</div>"+"</div></div>";return _15;},_genOptionTPL:function(){var _16=this.getId();var tpl="<div class=\"wse-boxes\">"+"<tpl for=\".\">"+"<div class=\"wse-box\">"+"<div class=\"wse-wrap\">"+"<div class=\"wse-opt{[ values.option_code ? \" wse-opt-\"+values.option_code : \"\" ]}\">"+"<span class=\"wse-code\">{option_code}</span> "+"<span class=\"wse-name\">{option_name}</span> "+"<span class=\"wse-sku\">{product_code}</span> "+"<span class=\"wse-prod\">{product_name}</span> "+"</div>"+"{[ this.genPriceHTML(values.prices) ]}"+"</div>"+"</div>"+"</tpl>"+"</div>";return new Ext.XTemplate(tpl,{priceTxt:SmartWin.langLookup("price","label"),listPriceTxt:SmartWin.langLookup("list_price","label"),yourPriceTxt:SmartWin.langLookup("your_price","label"),genPriceHTML:function(_18){if(_18){return"<div class=\"wse-prices\">"+(_18["list_price"]?"<div class=\"wse-price wse-price-ret\">"+"<span class=\"wse-lbl\">"+this.listPriceTxt+"</span>"+"<span class=\"wse-val\">"+_18["list_price"]+"</span>"+"</div>":"")+"<div class=\"wse-price wse-price-store\">"+"<span class=\"wse-lbl\">"+(_18["list_price"]?this.yourPriceTxt:this.priceTxt)+"</span>"+"<span class=\"wse-val\">"+_18["price"]+"</span>"+"</div>"+"</div>";}
return"";}});}});Ext.reg("SmartWin.widget.RelOptionBox",SmartWin.widget.RelOptionBox);
SmartWin.widget.QtyUpdateBar=Ext.extend(Ext.Toolbar,{xtype:"SmartWin.widget.QtyUpdateBar",_initQty:1,cls:"wse-swin-wdg wse-swin-wdg-qtybar",initComponent:function(){this.addEvents("update");var _1=this.getId();this.items=["<span class=\"wse-lbl\">"+SmartWin.langLookup("qty","label")+"</span>",{xtype:"numberfield",name:"qty",width:30,id:_1+"-qty",minValue:1,value:this._initQty},{xtype:"button",id:_1+"-btn",text:SmartWin.langLookup("update","button"),handler:this._sendUpdateEvent.createDelegate(this),cls:"wse-xbtn-update"}];SmartWin.widget.QtyUpdateBar.superclass.initComponent.call(this);},setQty:function(_2){_2=_2?_2:1;try{if(this.rendered){Ext.getCmp(this.getId()+"-qty").setValue(_2);}else{this._initQty=_2;}}
catch(e){}},setButtonState:function(_3){_3=_3?_3:false;try{if(this.rendered){Ext.getCmp(this.getId()+"-btn").setEnabled(_3);}else{this._initBtnState=_3;}}
catch(e){}},_sendUpdateEvent:function(){var _4=1;try{_4=Ext.getCmp(this.getId()+"-qty").getValue();}
catch(e){}
_4=_4?_4:1;this.fireEvent("update",this,_4);}});Ext.reg("SmartWin.widget.QtyUpdateBar",SmartWin.widget.QtyUpdateBar);
SmartWin.widget.ProdSuperceded=Ext.extend(Ext.Panel,{xtype:"SmartWin.widget.ProdSuperceded",border:false,height:200,autoScroll:true,parentConfig:"prodDetail",highLiteOn:false,updateColor:"ffcc00",deleteColor:"ff0000",cls:"wse-swin-cmp wse-swin-cmp-superceded",_haltChange:false,initComponent:function(){this.addEvents("itemselect");var _1=SmartWin.getWindowConfig(this.parentConfig,"superceded");var n=Number(_1["height"]);if(n){this.height=n;this.autoHeight=false;}
this.title=SmartWin.langLookup("prod_superceded","title");if(_1["hideTitle"]===true){this.header=false;}
if(_1["highLiteOn"]===true){this.highLiteOn=true;if(_1["updateColor"]){this.updateColor=_1["updateColor"];}}
this.store=new Ext.data.JsonStore({data:[],autoLoad:false,id:"group_id",fields:["group_id","message","type","products"]});this.items=[{xtype:"dataview",tpl:this._genTPL(),store:this.store,overClass:"wse-box-over",itemSelector:"div.wse-box",selectedClass:"wse-selected",emptyText:"",loadingText:null,singleSelect:true,autoHeight:true,autoScroll:true}];SmartWin.widget.ProdSuperceded.superclass.initComponent.call(this);},onRender:function(ct,_4){SmartWin.widget.ProdSuperceded.superclass.onRender.call(this,ct,_4);this.doLayout.defer(100,this);},onDestroy:function(){try{this.store.removeAll();}
catch(e){}
delete(this.store);SmartWin.widget.ProdSuperceded.superclass.onDestroy.call(this);},displaySupercession:function(_5){this._loadData(_5);},clearSupercession:function(){this._loadData();},_loadData:function(_6){_6=Ext.isArray(_6)?_6:[];this.setEmptyText(SmartWin.langLookup("no_superceded_items","msg"));this.store.loadData(_6);if(this.store.getCount()){this.getComponent(0).select(0);}},clearData:function(){this.setEmptyText(SmartWin.langLookup("no_order_items","msg"));this.store.removeAll();},setEmptyText:function(_7,_8){try{var _9=this.getComponent(0);_9.emptyText="<div class=\"wse-noresults\">"+_7+"</div>";if(_8){_9.refresh();}}
catch(e){}},selectItem:function(_a){var r=this.store.getById(_a);if(r){var _c=r.get("products");if(_c){this.fireEvent("itemselect",_c);}}},_genTPL:function(){var _d=this.getId();var _e="<div class=\"wse-boxes\">"+"<tpl for=\".\">"+"<div class=\"wse-box {[xindex % 2 === 0 ? \"wse-even\" : \"wse-odd\"]}\">"+"<div class=\"wse-wrap\">"+"<div class=\"wse-cont\">"+"{[ this.genContHTML(values.group_id, values.message) ]}"+"{[ this.genSelectHTML(values.group_id) ]}"+"</div>"+"</div>"+"</div>"+"</tpl>"+"</div>";return new Ext.XTemplate(_e,{compId:this.getId(),selectTxt:SmartWin.langLookup("selectSuperceded","button"),genContHTML:function(_f,_10){if(_10){return _10;}
return"";},genSelectHTML:function(_11){if(_11&&this.selectTxt){return"<div class=\"wse-lnk\">"+"<a href=\"#\" onclick=\"Ext.getCmp('"+this.compId+"').selectItem('"+_11+"', true, this); return false;\">"+this.selectTxt+"</a></div>";}
return"";}});}});Ext.reg("SmartWin.widget.ProdSuperceded",SmartWin.widget.ProdSuperceded);
SmartWin.widget.ProdSupercession=Ext.extend(Ext.Panel,{xtype:"SmartWin.widget.ProdSupercession",border:false,height:200,autoScroll:true,parentConfig:"prodDetail",highLiteOn:false,updateColor:"ffcc00",deleteColor:"ff0000",cls:"wse-swin-cmp wse-swin-cmp-super",_haltChange:false,initComponent:function(){this.addEvents("itemselect");var _1=SmartWin.getWindowConfig(this.parentConfig,"supercess");var n=Number(_1["height"]);if(n){this.height=n;this.autoHeight=false;}
this.title=SmartWin.langLookup("prod_supercession","title");if(_1["hideTitle"]===true){this.header=false;}
if(_1["highLiteOn"]===true&&_1["hideSupercessionLinks"]!==true){this.highLiteOn=true;if(_1["updateColor"]){this.updateColor=_1["updateColor"];}}else{this.removeClass("wse-swin-cmp-super");this.addClass("wse-swin-cmp-super-not-select");}
this.store=new Ext.data.JsonStore({data:[],autoLoad:false,id:"group_id",fields:["group_id","message","type","products"]});this.items=[{xtype:"dataview",tpl:this._genTPL(),store:this.store,overClass:"wse-box-over",itemSelector:"div.wse-box",selectedClass:"wse-selected",emptyText:"",loadingText:null,singleSelect:true,autoHeight:true,autoScroll:true}];SmartWin.widget.ProdSupercession.superclass.initComponent.call(this);},onRender:function(ct,_4){SmartWin.widget.ProdSupercession.superclass.onRender.call(this,ct,_4);this.doLayout.defer(100,this);},onDestroy:function(){try{this.store.removeAll();}
catch(e){}
delete(this.store);SmartWin.widget.ProdSupercession.superclass.onDestroy.call(this);},displaySupercession:function(_5){this._loadData(_5);},clearSupercession:function(){this._loadData();},_loadData:function(_6){_6=Ext.isArray(_6)?_6:[];this.setEmptyText(SmartWin.langLookup("no_supercession_items","msg"));this.store.loadData(_6);if(this.store.getCount()){this.getComponent(0).select(0);}},clearData:function(){this.setEmptyText(SmartWin.langLookup("no_order_items","msg"));this.store.removeAll();},setEmptyText:function(_7,_8){try{var _9=this.getComponent(0);_9.emptyText="<div class=\"wse-noresults\">"+_7+"</div>";if(_8){_9.refresh();}}
catch(e){}},selectItem:function(_a){var r=this.store.getById(_a);if(r){var _c=r.get("products");if(_c){this.fireEvent("itemselect",_c);}}},_genTPL:function(){var _d=this.getId();var _e=SmartWin.getWindowConfig(this.parentConfig,"supercess");var _f="<div class=\"wse-boxes\">"+"<tpl for=\".\">"+"<div class=\"wse-box {[xindex % 2 === 0 ? \"wse-even\" : \"wse-odd\"]}\">"+"<div class=\"wse-wrap\">"+"<div class=\"wse-cont\">"+"{[ this.genContHTML(values.group_id, values.message) ]}"+"{[ this.genSelectHTML(values.group_id) ]}"+"</div>"+"</div>"+"</div>"+"</tpl>"+"</div>";return new Ext.XTemplate(_f,{compId:this.getId(),selectTxt:SmartWin.langLookup("selectSuper","button"),genContHTML:function(_10,_11){if(_10&&_11){if(_e["hideSupercessionLinks"]===true){return _11;}else{return"<a href=\"#\" onclick=\"Ext.getCmp('"+this.compId+"').selectItem('"+_10+"', true, this); return false;\">"+_11+"</a>";}}
return"";},genSelectHTML:function(_12){if(_12&&_e["hideSupercessionLinks"]!==true){return"<div class=\"wse-lnk\">"+"<a href=\"#\" onclick=\"Ext.getCmp('"+this.compId+"').selectItem('"+_12+"', true, this); return false;\">"+this.selectTxt+"</a></div>";}
return"";}});}});Ext.reg("SmartWin.widget.ProdSupercession",SmartWin.widget.ProdSupercession);
SmartWin.widget.Bookmark=Ext.extend(Ext.Toolbar,{xtype:"SmartWin.widget.Bookmark",data:null,cls:"wse-swin-wdg wse-swin-wdg-bkm",parentConfig:"prodDetail",bkmIdFormatString:"data[{0}]",initComponent:function(){this.addEvents("bookmark");var _1=this.getId();this.items=[{xtype:"button",id:_1+"-btn",text:SmartWin.langLookup("bookmark","button"),handler:this._startBookmark.createDelegate(this),cls:"x-btn-text-icon wse-xbtn-bkm",iconCls:"wse-xbtn-bkm-icon",disabled:true}];SmartWin.widget.Bookmark.superclass.initComponent.call(this);},setData:function(_2,_3){_2=_2?_2:{};_3=_3?_3:{};if(_2["product_id"]||_3["ses_bom_item_id"]){this.data={"name":((_2&&_2["product"])?_2["product"]:_3["bom_item_name"]),"product_id":_2["product_id"],"machine_id":_3["ses_machine_id"],"model_id":_3["ses_model_id"],"manual_revision_id":_3["ses_manual_revision_id"],"assembly_revision_id":_3["ses_assembly_revision_id"],"bom_item_id":_3["ses_bom_item_id"]};this.enableButton(true);}else{this.enableButton(false);}},clearData:function(){if(this.data){delete(this.data);this.data=null;}
this.enableButton(false);},enableButton:function(_4){try{Ext.getCmp(this.getId()+"-btn")[_4?"enable":"disable"]();}
catch(e){}},_startBookmark:function(){if(this.data){var _5={title:SmartWin.langLookup("bookmark","title"),cls:"epwse-swin-bkmwin",buttons:{ok:SmartWin.langLookup("save","button"),cancel:SmartWin.langLookup("cancel","button")},closable:true,width:300,modal:true,prompt:true,scope:this,fn:this._saveBookmark,value:this.data.name};Ext.Msg.show(_5);}},_saveBookmark:function(_6,_7){if(!_7){return false;}
switch(_6){case"ok":case"yes":var o=Ext.apply({},this.data);o["name"]="";var _9=SmartWin.formatRequestParams(o,this.bkmIdFormatString);_9["name"]=_7;SmartWin.requestData({group:this.parentConfig,request:"addBookmark",params:_9});break;default:return false;break;}}});Ext.reg("SmartWin.widget.Bookmark",SmartWin.widget.Bookmark);
