Ext.app.App=function(A){Ext.apply(this,A);this.addEvents({ready:true,beforeunload:true});Ext.onReady(this.initApp,this)};Ext.extend(Ext.app.App,Ext.util.Observable,{isReady:false,modules:null,connection:"connect.php",initApp:function(){var A=new Ext.KeyMap(document,[{key:Ext.EventObject.BACKSPACE,stopEvent:false,fn:function(C,E){var B=E.target.tagName;if(B!="INPUT"&&B!="TEXTAREA"){E.stopEvent()}}}]);this.startConfig=this.startConfig||this.getStartConfig();this.desktop=new Ext.Desktop(this);this.modules=this.getModules();if(this.modules){this.initModules(this.modules);this.initDesktopConfig()}this.init();Ext.EventManager.on(window,"beforeunload",this.onUnload,this);this.fireEvent("ready",this);this.isReady=true},getModules:Ext.emptyFn,getStartConfig:Ext.emptyFn,getDesktopConfig:Ext.emptyFn,init:Ext.emptyFn,initModules:function(B){for(var C=0,A=B.length;C<A;C++){B[C].app=this}},initDesktopConfig:function(A){if(!A){this.getDesktopConfig()}else{this.desktop.config=A;this.desktop.initialConfig=A;this.initContextMenu(A.contextmenu);this.initShortcuts(A.shortcuts);this.initStyles(A.styles);this.initAutoRun(A.autorun)}},initAutoRun:function(E){if(E){for(var C=0,B=E.length;C<B;C++){var A=this.getModule(E[C]);if(A){A.autorun=true;A.createWindow()}}}},initContextMenu:function(C){if(C){for(var B=0,A=C.length;B<A;B++){this.desktop.addContextMenuItem(C[B])}}},initShortcuts:function(C){if(C){for(var B=0,A=C.length;B<A;B++){this.desktop.addShortcut(C[B],false)}}},initStartMenu:function(F){if(F){for(var E=0,B=F.length;E<B;E++){var A=this.getModule(F[E]);if(A){var G=this;C(this.desktop.taskbar.startMenu,A)}}}function C(M,H){if(H.moduleType=="menu"){var I=H.items;for(var J=0,L=I.length;J<L;J++){var K=G.getModule(I[J]);if(K){C(H.menu,K)}}}if(H.launcher){M.add(H.launcher)}}},initQuickStart:function(C){if(C){for(var B=0,A=C.length;B<A;B++){this.desktop.addQuickStartButton(C[B],false)}}},initStyles:function(A){this.desktop.setBackgroundColor(A.backgroundcolor);this.desktop.setTheme(A.theme);this.desktop.setTransparency(A.transparency);this.desktop.setWallpaper(A.wallpaper);this.desktop.setWallpaperPosition(A.wallpaperposition)},getModule:function(B){var C=this.modules;for(var E=0,A=C.length;E<A;E++){if(C[E].moduleId==B||C[E].moduleType==B){return C[E]}}return""},onReady:function(B,A){if(!this.isReady){this.on("ready",B,A)}else{B.call(A,this)}},getDesktop:function(){return this.desktop},onUnload:function(A){if(this.fireEvent("beforeunload",this)===false){A.stopEvent()}}});QoDesk=new Ext.app.App({init:function(){Ext.QuickTips.init()},getModules:function(){var A=new Array(new QoDesk.LandingWindow(),new QoDesk.ShareWindow(),new QoDesk.ProductWindow(),new QoDesk.MapWindow(),new QoDesk.HomeWindow(),new QoDesk.NeighborhoodWindow(),new QoDesk.CategoryWindow(),new QoDesk.SearchWindow(),new QoDesk.NewStuffWindow(),new QoDesk.CompanyWindow(),new QoDesk.BoutiqueWindow(),new QoDesk.CartWindow(),new QoDesk.AccountWindow(),new QoDesk.PreferenceWindow());if(Bsi.USR_ADMIN||Bsi.USR_BTQOWNR){A.push(new QoDesk.MyBoutiqueWindow())}return A},getStartConfig:function(){var A=new QoDesk.NavigationBarPanel();A.app=this;var E=new QoDesk.CartWindow();E.app=this;var B=new QoDesk.AccountWindow();B.app=this;var C=new QoDesk.CompanyWindow();C.app=this;return{title:"Welcome",iconCls:"user",toolItems:[E.launcher,B.launcher,"-",C.launcher,{text:"Logout",iconCls:"logout",handler:function(){window.location="logout"},scope:this}],toolPanelWidth:110,width:220,height:150}},getDesktopConfig:function(){this.initDesktopConfig({autorun:["home-win","newstuff-win","land-win"],styles:{backgroundcolor:"000000",theme:{id:1,description:"Vista Blue",pathtofile:"resources/themes/xtheme-vistablue/css/xtheme-vistablue.css"},transparency:false,wallpaper:{id:1,name:"yellow-pattern",description:"default",pathtofile:"inc/r/wallpapers/yellow-pattern.png"},wallpaperposition:"tile"}})}});Ext.Desktop=function(A){this.taskbar=new Ext.ux.TaskBar(A);var G=this.taskbar;this.el=Ext.get("x-desktop");var K=this.el;var C=Ext.get("ux-taskbar");this.config=null;this.initialConfig=null;var I=new Ext.WindowGroup();I.zseed=7000;var E;function F(M){M.minimized=true;M.hide()}function J(M){if(E&&E!=M){L(E)}G.setActiveButton(M.taskButton);E=M;Ext.fly(M.taskButton.el).addClass("active-win");M.minimized=false}function L(M){if(M==E){E=null;Ext.fly(M.taskButton.el).removeClass("active-win")}}function B(M){G.taskButtonPanel.remove(M.taskButton);H()}function H(){K.setHeight(Ext.lib.Dom.getViewHeight()-C.getHeight())}Ext.EventManager.onWindowResize(H);this.layout=H;this.createWindow=function(N,M){var O=new (M||Ext.Window)(Ext.applyIf(N||{},{manager:I,minimizable:true,maximizable:true,plugins:[new Ext.ux.plugin.CascadeWindows()],offsetX:5,offsetY:-5}));O.render(K);O.taskButton=G.taskButtonPanel.add(O);O.cmenu=new Ext.menu.Menu({items:[]});O.animateTarget=O.taskButton.el;O.on({activate:{fn:J},beforeshow:{fn:J},deactivate:{fn:L},minimize:{fn:F},close:{fn:B}});H();return O};this.getManager=function(){return I};this.getWindow=function(M){return I.get(M)};this.getWinWidth=function(){var M=Ext.lib.Dom.getViewWidth();return M<200?200:M};this.getWinHeight=function(){var M=(Ext.lib.Dom.getViewHeight()-C.getHeight());return M<100?100:M};this.getWinX=function(M){return(Ext.lib.Dom.getViewWidth()-M)/2};this.getWinY=function(M){return(Ext.lib.Dom.getViewHeight()-C.getHeight()-M)/2};this.setBackgroundColor=function(M){if(M){Ext.get(document.body).setStyle("background-color","#"+M);this.config.styles.backgroundcolor=M}};this.setTheme=function(M){if(M&&M.id&&M.name&&M.pathtofile){Ext.util.CSS.swapStyleSheet("theme",M.pathtofile);this.config.styles.theme=M}};this.setTransparency=function(M){if(String(M)!=""){if(M){C.addClass("transparent")}else{C.removeClass("transparent")}this.config.styles.transparency=M}};this.setWallpaper=function(P){if(P&&P.id&&P.name&&P.pathtofile){Ext.MessageBox.show({msg:"Loading wallpaper...",progressText:"Loading...",width:300,wait:true,waitConfig:{interval:500}});var N=new Image();N.src=P.pathtofile;var M=new Ext.util.DelayedTask(O);M.delay(200);this.config.styles.wallpaper=P}function O(){if(N.complete){Ext.MessageBox.hide();M.cancel();document.body.background=N.src}else{M.delay(200)}}};this.setWallpaperPosition=function(N){if(N){if(N==="center"){var M=Ext.get(document.body);M.removeClass("wallpaper-tile");M.addClass("wallpaper-center")}else{if(N==="tile"){var M=Ext.get(document.body);M.removeClass("wallpaper-center");M.addClass("wallpaper-tile")}}this.config.styles.wallpaperposition=N}};this.addAutoRun=function(O){var M=A.getModule(O),N=this.config.autorun;if(M&&!M.autorun){M.autorun=true;N.push(O)}};this.removeAutoRun=function(P){var M=A.getModule(P),O=this.config.autorun;if(M&&M.autorun){var N=0;while(N<O.length){if(O[N]==P){O.splice(N,1)}else{N++}}M.autorun=null}};this.addContextMenuItem=function(N){var M=A.getModule(N);if(M&&!M.contextMenuItem){this.cmenu.add(M.launcher)}};this.addShortcut=function(P,N){var M=A.getModule(P);if(M&&!M.shortcut){var O=M.launcher;M.shortcut=this.shortcutPanel.addShortcut({handler:O.handler,iconCls:O.shortcutIconCls,scope:O.scope,text:O.text});if(N){this.config.shortcuts.push(P)}}};this.removeShortcut=function(Q,N){var M=A.getModule(Q);if(M&&M.shortcut){this.shortcutPanel.removeShortcut(M.shortcut);M.shortcut=null;if(N){var P=this.config.shortcuts,O=0;while(O<P.length){if(P[O]==Q){P.splice(O,1)}else{O++}}}}};this.addQuickStartButton=function(P,N){var M=A.getModule(P);if(M&&!M.quickStartButton){var O=M.launcher;M.quickStartButton=this.taskbar.quickStartPanel.add({handler:O.handler,iconCls:O.iconCls,scope:O.scope,text:O.text,tooltip:O.tooltip||O.text});if(N){this.config.quickstart.push(P)}}};this.removeQuickStartButton=function(Q,O){var N=A.getModule(Q);if(N&&N.quickStartButton){this.taskbar.quickStartPanel.remove(N.quickStartButton);N.quickStartButton=null;if(O){var M=this.config.quickstart,P=0;while(P<M.length){if(M[P]==Q){M.splice(P,1)}else{P++}}}}};H();this.cmenu=new Ext.menu.Menu();K.on("contextmenu",function(N){if(N.target.id===K.id){N.stopEvent();if(!this.cmenu.el){this.cmenu.render()}var M=N.getXY();M[1]-=this.cmenu.el.getHeight();this.cmenu.showAt(M)}},this)};Ext.app.Module=function(A){Ext.apply(this,A);Ext.app.Module.superclass.constructor.call(this);this.init()};Ext.extend(Ext.app.Module,Ext.util.Observable,{init:Ext.emptyFn});Ext.namespace("Ext.ux");Ext.ux.TaskBar=function(A){this.app=A;this.init()};Ext.extend(Ext.ux.TaskBar,Ext.util.Observable,{init:function(){this.navPanel=new Ext.Panel({el:"ux-taskbar-nav-panel",id:"TaskBarNavPanel",border:false,minWidth:60,region:"east",split:false,width:280,cls:"blackbar",tbar:[{id:"ux-taskbar-nav-company",text:"About Us",iconCls:"icon-taskbar-about",active:0,menu:{items:[{text:"About",iconCls:"icon-about",scope:this,handler:function(){this.app.getModule("comp-win").createWindow({tabName:"About"})}},{text:"Buzz",iconCls:"icon-buzz",scope:this,handler:function(){this.app.getModule("comp-win").createWindow({tabName:"Buzz"})}},{text:"Merchants",iconCls:"icon-merchants",scope:this,handler:function(){this.app.getModule("comp-win").createWindow({tabName:"Merchants"})}},{text:"Help",iconCls:"icon-help",scope:this,handler:function(){this.app.getModule("comp-win").createWindow({tabName:"Help"})}},{text:"Policies",iconCls:"icon-legal",scope:this,handler:function(){this.app.getModule("comp-win").createWindow({tabName:"Policies"})}}],listeners:{hide:{fn:function(C){Ext.getCmp("ux-taskbar-nav-company").active=0},scope:this},mouseover:{fn:function(C,F,E){Ext.getCmp("ux-taskbar-nav-company").active=1},scope:this}}},listeners:{menutriggerover:{fn:function(E,C,F){E.active=0;if(!E.hasVisibleMenu()){E.showMenu()}},scope:this,buffer:50},menutriggerout:{fn:function(E,C,F){if(!E.active){E.hideMenu()}},scope:this,buffer:50}}},{id:"ux-taskbar-copyright",text:"&copy;2009 Boutique Street, Inc.",tooltip:"Copyright 2008-09 Boutique Street, Inc.<br>All Rights Reserved Worldwide.",cls:"x-item-no-button",scope:this}]});this.taskButtonPanel=new Ext.ux.TaskButtonsPanel({el:"ux-taskbuttons-panel",id:"TaskBarButtons",region:"center"});var B=new Ext.Container({el:"ux-taskbar-panel-wrap",items:[this.taskButtonPanel,this.navPanel],layout:"border",region:"center"});var A=new Ext.ux.TaskBarContainer({el:"ux-taskbar",layout:"border",items:[B]});this.el=A.el;return this},setActiveButton:function(A){this.taskButtonPanel.setActiveButton(A)}});Ext.ux.TaskBarContainer=Ext.extend(Ext.Container,{initComponent:function(){Ext.ux.TaskBarContainer.superclass.initComponent.call(this);this.el=Ext.get(this.el)||Ext.getBody();this.el.setHeight=Ext.emptyFn;this.el.setWidth=Ext.emptyFn;this.el.setSize=Ext.emptyFn;this.el.setStyle({overflow:"hidden",margin:"0",border:"0 none"});this.el.dom.scroll="no";this.allowDomMove=false;this.autoWidth=true;this.autoHeight=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(A,B){this.fireEvent("resize",this,A,B,A,B)}});Ext.ux.TaskButtonsPanel=Ext.extend(Ext.BoxComponent,{activeButton:null,enableScroll:true,scrollIncrement:0,scrollRepeatInterval:400,scrollDuration:0.35,animScroll:true,resizeButtons:true,buttonWidth:168,minButtonWidth:118,buttonMargin:2,buttonWidthSet:false,initComponent:function(){Ext.ux.TaskButtonsPanel.superclass.initComponent.call(this);this.on("resize",this.delegateUpdates);this.items=[];this.stripWrap=Ext.get(this.el).createChild({cls:"ux-taskbuttons-strip-wrap",cn:{tag:"ul",cls:"ux-taskbuttons-strip"}});this.stripSpacer=Ext.get(this.el).createChild({cls:"ux-taskbuttons-strip-spacer"});this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.edge=this.strip.createChild({tag:"li",cls:"ux-taskbuttons-edge"});this.strip.createChild({cls:"x-clear"})},add:function(C){var A=this.strip.createChild({tag:"li"},this.edge);var B=new Ext.ux.TaskBar.TaskButton(C,A);this.items.push(B);if(!this.buttonWidthSet){this.lastButtonWidth=B.container.getWidth()}this.setActiveButton(B);return B},remove:function(E){var B=document.getElementById(E.container.id);E.destroy();B.parentNode.removeChild(B);var F=[];for(var C=0,A=this.items.length;C<A;C++){if(this.items[C]!=E){F.push(this.items[C])}}this.items=F;this.delegateUpdates()},setActiveButton:function(A){this.activeButton=A;this.delegateUpdates()},delegateUpdates:function(){if(this.resizeButtons&&this.rendered){this.autoSize()}if(this.enableScroll&&this.rendered){this.autoScroll()}},autoSize:function(){var I=this.items.length;var C=this.el.dom.offsetWidth;var A=this.el.dom.clientWidth;if(!this.resizeButtons||I<1||!A){return }var K=Math.max(Math.min(Math.floor((A-4)/I)-this.buttonMargin,this.buttonWidth),this.minButtonWidth);var F=this.stripWrap.dom.getElementsByTagName("button");this.lastButtonWidth=Ext.get(F[0].id).findParent("li").offsetWidth;for(var G=0,J=F.length;G<J;G++){var B=F[G];var H=Ext.get(F[G].id).findParent("li").offsetWidth;var E=B.offsetWidth;B.style.width=(K-(H-E))+"px"}},autoScroll:function(){var G=this.items.length;var E=this.el.dom.offsetWidth;var C=this.el.dom.clientWidth;var F=this.stripWrap;var B=F.dom.offsetWidth;var H=this.getScrollPos();var A=this.edge.getOffsetsTo(this.stripWrap)[0]+H;if(!this.enableScroll||G<1||B<20){return }F.setWidth(C);if(A<=C){F.dom.scrollLeft=0;if(this.scrolling){this.scrolling=false;this.el.removeClass("x-taskbuttons-scrolling");this.scrollLeft.hide();this.scrollRight.hide()}}else{if(!this.scrolling){this.el.addClass("x-taskbuttons-scrolling")}C-=F.getMargins("lr");F.setWidth(C>20?C:20);if(!this.scrolling){if(!this.scrollLeft){this.createScrollers()}else{this.scrollLeft.show();this.scrollRight.show()}}this.scrolling=true;if(H>(A-C)){F.dom.scrollLeft=A-C}else{this.scrollToButton(this.activeButton,true)}this.updateScrollButtons()}},createScrollers:function(){var C=this.el.dom.offsetHeight;var A=this.el.insertFirst({cls:"ux-taskbuttons-scroller-left"});A.setHeight(C);A.addClassOnOver("ux-taskbuttons-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(A,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=A;var B=this.el.insertFirst({cls:"ux-taskbuttons-scroller-right"});B.setHeight(C);B.addClassOnOver("ux-taskbuttons-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(B,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=B},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return(this.scrollIncrement||this.lastButtonWidth+2)},scrollToButton:function(F,A){F=F.el.dom.parentNode;if(!F){return }var C=F;var H=this.getScrollPos(),E=this.getScrollArea();var G=Ext.fly(C).getOffsetsTo(this.stripWrap)[0]+H;var B=G+C.offsetWidth;if(G<H){this.scrollTo(G,A)}else{if(B>(H+E)){this.scrollTo(B-E,A)}}},scrollTo:function(B,A){this.stripWrap.scrollTo("left",B,A?this.getScrollAnim():false);if(!A){this.updateScrollButtons()}},onScrollRight:function(){var A=this.getScrollWidth()-this.getScrollArea();var C=this.getScrollPos();var B=Math.min(A,C+this.getScrollIncrement());if(B!=C){this.scrollTo(B,this.animScroll)}},onScrollLeft:function(){var B=this.getScrollPos();var A=Math.max(0,B-this.getScrollIncrement());if(A!=B){this.scrollTo(A,this.animScroll)}},updateScrollButtons:function(){var A=this.getScrollPos();this.scrollLeft[A==0?"addClass":"removeClass"]("ux-taskbuttons-scroller-left-disabled");this.scrollRight[A>=(this.getScrollWidth()-this.getScrollArea())?"addClass":"removeClass"]("ux-taskbuttons-scroller-right-disabled")}});Ext.ux.TaskBar.TaskButton=function(B,A){this.win=B;Ext.ux.TaskBar.TaskButton.superclass.constructor.call(this,{iconCls:B.iconCls,text:Ext.util.Format.ellipsis(B.title,12),tooltip:B.taskbuttonTooltip||B.title,renderTo:A,handler:function(){if(B.minimized||B.hidden){B.show()}else{if(B==B.manager.getActive()){B.minimize()}else{B.toFront()}}},clickEvent:"mousedown"})};Ext.extend(Ext.ux.TaskBar.TaskButton,Ext.Button,{onRender:function(){Ext.ux.TaskBar.TaskButton.superclass.onRender.apply(this,arguments);this.cmenu=new Ext.menu.Menu({items:[{id:"restore",text:"Restore",handler:function(){if(!this.win.isVisible()){this.win.show()}else{this.win.restore()}},scope:this},{id:"minimize",text:"Minimize",handler:this.win.minimize,scope:this.win},{id:"maximize",text:"Maximize",handler:this.win.maximize,scope:this.win},"-",{id:"close",text:"Close",handler:this.closeWin.createDelegate(this,this.win,true),scope:this.win}]});this.cmenu.on("beforeshow",function(){var B=this.cmenu.items.items;var A=this.win;B[0].setDisabled(A.maximized!==true&&A.hidden!==true);B[1].setDisabled(A.minimized===true);B[2].setDisabled(A.maximized===true||A.hidden===true);B[2].setDisabled(A.maximizable===false);B[3].setDisabled(A.closable===false)},this);this.el.on("contextmenu",function(B){B.stopEvent();if(!this.cmenu.el){this.cmenu.render()}var A=B.getXY();A[1]-=this.cmenu.el.getHeight();this.cmenu.showAt(A)},this)},closeWin:function(A,C,B){if(!B.isVisible()){B.show()}else{B.restore()}B.close()},setText:function(A){if(A){this.text=A;if(this.el){this.el.child("td.x-btn-center "+this.buttonSelector).update(Ext.util.Format.ellipsis(A,12))}}},setTooltip:function(B){if(B){this.tooltip=B;var A=this.el.child(this.buttonSelector);Ext.QuickTips.unregister(A.id);if(typeof this.tooltip=="object"){Ext.QuickTips.register(Ext.apply({target:A.id},this.tooltip))}else{A.dom[this.tooltipType]=this.tooltip}}}});Ext.ux.QuickStartPanel=Ext.extend(Ext.BoxComponent,{enableMenu:true,initComponent:function(){Ext.ux.QuickStartPanel.superclass.initComponent.call(this);this.on("resize",this.delegateUpdates);this.menu=new Ext.menu.Menu();this.items=[];this.stripWrap=Ext.get(this.el).createChild({cls:"ux-quickstart-strip-wrap",cn:{tag:"ul",cls:"ux-quickstart-strip"}});this.stripSpacer=Ext.get(this.el).createChild({cls:"ux-quickstart-strip-spacer"});this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.edge=this.strip.createChild({tag:"li",cls:"ux-quickstart-edge"});this.strip.createChild({cls:"x-clear"})},add:function(B){var A=this.strip.createChild({tag:"li"},this.edge);var C=new Ext.Button(Ext.apply(B,{cls:"x-btn-icon",menuText:B.text,renderTo:A,text:""}));this.items.push(C);this.delegateUpdates();return C},remove:function(E){var B=document.getElementById(E.container.id);E.destroy();B.parentNode.removeChild(B);var F=[];for(var C=0,A=this.items.length;C<A;C++){if(this.items[C]!=E){F.push(this.items[C])}}this.items=F;this.delegateUpdates()},menuAdd:function(A){this.menu.add(A)},delegateUpdates:function(){if(this.enableMenu&&this.rendered){this.showButtons();this.clearMenu();this.autoMenu()}},showButtons:function(){var B=this.items.length;for(var A=0;A<B;A++){this.items[A].show()}},clearMenu:function(){this.menu.removeAll()},autoMenu:function(){var K=this.items.length;var F=this.el.dom.offsetWidth;var J=this.el.dom.clientWidth;var B=this.stripWrap;var H=B.dom.offsetWidth;var G=this.edge.getOffsetsTo(this.stripWrap)[0];if(!this.enableMenu||K<1||H<20){return }B.setWidth(J);if(G<=J){if(this.showingMenu){this.showingMenu=false;this.menuButton.hide()}}else{J-=B.getMargins("lr");B.setWidth(J>20?J:20);if(!this.showingMenu){if(!this.menuButton){this.createMenuButton()}else{this.menuButton.show()}}mo=this.getMenuButtonPos();for(var I=K-1;I>=0;I--){var A=this.items[I].el.dom.offsetLeft+this.items[I].el.dom.offsetWidth;if(A>mo){this.items[I].hide();var C=this.items[I].initialConfig,E={iconCls:C.iconCls,handler:C.handler,scope:C.scope,text:C.menuText};this.menuAdd(E)}else{this.items[I].show()}}this.showingMenu=true}},createMenuButton:function(){var B=this.el.dom.offsetHeight;var C=this.el.insertFirst({cls:"ux-quickstart-menubutton-wrap"});C.setHeight(B);var A=new Ext.Button({cls:"x-btn-icon",id:"ux-quickstart-menubutton",menu:this.menu,renderTo:C});C.setWidth(Ext.get("ux-quickstart-menubutton").getWidth());this.menuButton=C},getMenuButtonPos:function(){return this.menuButton.dom.offsetLeft}});Ext.namespace("Ext.ux");Ext.ux.TemplateRenderer=function(A){Ext.apply(this,A);if(typeof this.template=="string"){this.template=new Ext.XTemplate(this.template)}Ext.ux.TemplateRenderer.superclass.constructor.call(this)};Ext.extend(Ext.ux.TemplateRenderer,Ext.Updater.BasicRenderer);Bsi={version:"1.0"};Bsi.USR_ANON=(D.u.r[1])?1:0;Bsi.USR_AUTH=(D.u.r[2])?1:0;Bsi.USR_BTQOWNR=(D.u.r[3])?1:0;Bsi.USR_ADMIN=(D.u.r[4])?1:0;Bsi.USR_GUEST=(D.u.r[5])?1:0;Bsi.USR_NAME=D.u.n;Bsi.USR_STORES=D.u.s;Bsi.BSI_REFERER=D.r;Bsi.DBG_GA=D.d;Bsi.URL_VERSION="";Bsi.BLANK_STRIPES="---";Bsi.URL_SCHEME="http://";Bsi.URL_S_SCHEME="https://";Bsi.URL_HOSTNAME="www.boutiquestreet.com";Bsi.URL_BASE=Bsi.URL_SCHEME+Bsi.URL_HOSTNAME+Bsi.URL_VERSION;Bsi.URL_S_BASE=Bsi.URL_S_SCHEME+Bsi.URL_HOSTNAME+Bsi.URL_VERSION;Bsi.URL_SRVCS="/services/json";Bsi.URL_S_SRVCS="/services/secure";Bsi.URL_CHKOUT="/cart/checkout";Bsi.URL_REVIEW="/cart/checkout/review";Bsi.URL_CVV="/cart/cvv";Bsi.URL_SECURITY="/cart/security";Bsi.dbg=function(A){if(Ext.isGecko&&window.console){if(window.console.firebug){if(A){console.log(A)}else{console.log("AQUI!")}}}};Ext.BLANK_IMAGE_URL=Bsi.URL_BASE+"/inc/s.gif";Ext.onReady(function(){Ext.ux.onServerFailure=function(A,B){if(B.status==503){Ext.Msg.alert("Site Off-Line",'<span style="color:#fff"><br>Boutique Street is currently under maintenance and will be back shortly.<br><br>For best results please logout then login again.<br><br>Thank you for your patience.<br><br> --Boutique Street Team</span>')}else{Ext.Msg.alert("SERVER ERROR",B.status+" : "+B.statusText)}};Ext.ux.clone=function(C){if(!C||"object"!==typeof C){return C}var E="function"===typeof C.pop?[]:{};var B,A;for(B in C){if(C.hasOwnProperty(B)){A=C[B];if(A&&"object"===typeof A){E[B]=Ext.ux.clone(A)}else{E[B]=A}}}return E};String.prototype.ellipse=function(A){if(this.length>A){return this.substr(0,A-3)+"..."}return this};Bsi.validatePassword=function(J,N){var C={lower:0,upper:0,alpha:0,numeric:0,special:0,length:[0,Infinity],custom:[],badWords:[],badSequenceLength:0,noQwertySequences:false,noSequential:false};for(var I in N){C[I]=N[I]}var M={lower:/[a-z]/g,upper:/[A-Z]/g,alpha:/[A-Z]/gi,numeric:/[0-9]/g,special:/[\W_]/g},G,E;if(J.length<C.length[0]||J.length>C.length[1]){return false}for(G in M){if((J.match(M[G])||[]).length<C[G]){return false}}for(E=0;E<C.badWords.length;E++){if(J.toLowerCase().indexOf(C.badWords[E].toLowerCase())>-1){return false}}if(C.noSequential&&/([\S\s])\1/.test(J)){return false}if(C.badSequenceLength){var F="abcdefghijklmnopqrstuvwxyz",H=F.toUpperCase(),L="0123456789",B="qwertyuiopasdfghjklzxcvbnm",A=C.badSequenceLength-1,K="_"+J.slice(0,A);for(E=A;E<J.length;E++){K=K.slice(1)+J.charAt(E);if(F.indexOf(K)>-1||H.indexOf(K)>-1||L.indexOf(K)>-1||(C.noQwertySequences&&B.indexOf(K)>-1)){return false}}}for(E=0;E<C.custom.length;E++){G=C.custom[E];if(G instanceof RegExp){if(!G.test(J)){return false}}else{if(G instanceof Function){if(!G(J)){return false}}}}return true};Ext.apply(Ext.form.VTypes,{twitterText:"Maximum of 140 characters allowed.",twitter:function(A){var B=1;B=(A.length<=140);return B},emailListMask:/[a-z0-9_\.\-@\,]/i,emailListRe:/^([\w\-]+)(\.[\w\-]+)*@([\w\-]+\.){1,5}([A-Za-z]){2,4}$/,emailList:function(B){var E=0;var A=B.split(",");for(var C=0;C<A.length;C++){if(A[C]!=""){if(++E>5){this.emailListText="Only upto 5 emails separated with commas allowed";return 0}if(!this.emailListRe.test(A[C])){this.emailListText='Only emails in the format "user@domain.com"';return 0}}}return 1},userNameText:"Only 0-9,a-z,A-Z,.,_,- allowed",userNameMask:/[0-9,a-z,A-Z,\.,_,-]/,userNameRe:/[0-9,a-z,A-Z,\.,_,-]/,userName:function(A){return this.userNameRe.test(A)},phoneText:"Not a valid phone number.  Must be in the format 123-456-7890 or 1234567890.",phoneMask:/[\d-]/,phoneRe:/^(\d{3}[-]?){2}(\d{4})$/,phone:function(A){return this.phoneRe.test(A)},numericText:"Only numbers are allowed.",numericMask:/[0-9]/,numericRe:/(^-?\d\d*.\d*$)|(^-?\d\d*$)|(^-?.\d\d*$)/,numeric:function(A){return this.numericRe.test(A)},decNumText:"Only decimal numbers are allowed.",decNumMask:/(\d|\.)/,decNumRe:/\d+.\d+|\d+/,decNum:function(A){return this.decNumRe.test(A)},priceNumText:"Only valid prices are allowed.<br>(ie .12 , 12 , 12.34 , 1234.56 )",priceNumMask:/(\d|\.)/,priceNumRe:/^[0-9]*\.[0-9]{2}$|^[0-9]+$/,priceNum:function(A){return this.priceNumRe.test(A)},spaceNumText:"Only numbers are allowed.",spaceNumMask:/[0-9]/,spaceNumRe:/(^-?\d\d*.\d*$)|(^-?\d\d*$)|(^-?.\d\d*$)/,spaceNum:function(A){return this.spaceNumRe.test(A)},postalText:"Only numbers are allowed.",postalMask:/[0-9]/,postalRe:/(^-?\d\d*.\d*$)|(^-?\d\d*$)|(^-?.\d\d*$)/,postal:function(A){return this.postalRe.test(A)},addrNameText:"Only 0-9,a-z,A-Z, and space allowed",addrNameMask:/[\s,0-9,a-z,A-Z]/,addrNameRe:/[\s,0-9,a-z,A-Z]/,addrName:function(A){return this.addrNameRe.test(A)},imgNameText:"Only 0-9,a-z,A-Z,.,_,-, and space allowed",imgNameMask:/[\s,0-9,a-z,A-Z,\.,_,-]/,imgNameRe:/[\s,0-9,a-z,A-Z,\.,_,-]/,imgName:function(A){return this.imgNameRe.test(A)},attrNameText:"Only 0-9,a-z,A-Z,.,_,- allowed",attrNameMask:/[\s,0-9,a-z,A-Z,\.,_,-]/,attrNameRe:/[\s,0-9,a-z,A-Z,\.,_,-]/,attrName:function(A){return this.attrNameRe.test(A)},optNameText:"Only 0-9,a-z,A-Z,.,',\",(,),/,_,- allowed",optNameMask:/[\s,0-9,a-z,A-Z,\.,\',\",\(,\),\/,_,-]/,optNameRe:/[\s,0-9,a-z,A-Z,\.,\',\",\(,\),\/,_,-]/,optName:function(A){return this.optNameRe.test(A)},optAdjText:"Only valid positive or negative dollar values are allowed.<br>(ie .12, -12, 12.34, -1234.56)",optAdjMask:/[\d|\-|\.]/,optAdjRe:/^-?[0-9]*\.[0-9]{2}$|^-?[0-9]+$/,optAdj:function(A){return this.optAdjRe.test(A)},discCodeText:"Only 0-9,a-z,A-Z,_,- allowed",discCodeMask:/[\s,0-9,a-z,A-Z,_,-]/,discCodeRe:/[\s,0-9,a-z,A-Z,_,-]/,discCode:function(A){return this.optNameRe.test(A)},passwordText:"Please conform to requirements below",passwordMask:/.*/,fn:Bsi.validatePassword,password:function(A){return this.fn(A,{length:[8,Infinity],numeric:1,badWords:["password","Password"],badSequenceLength:4})}});Ext.util.Format.CurrencyFactory=function(E,C,A,B){return function(H){var G=(E=Math.abs(E)+1?E:2,C=C||",",A=A||".",/(\d+)(?:(\.\d+)|)/.exec(H+"")),F=G[1].length>3?G[1].length%3:0;return((F?G[1].substr(0,F)+A:"")+G[1].substr(F).replace(/(\d{3})(?=\d)/g,"$1"+A)+(E?C+(+G[2]||0).toFixed(E).substr(2):""))+" "+B}};Ext.ux.dlrFrmtr=Ext.util.Format.CurrencyFactory(2,".",",","$");Ext.get("webtop-loading").fadeOut({duration:0,remove:true,callback:function(A){Ext.get("webtop-loading-mask").fadeOut({duration:0.05,remove:true})}})});Bsi.analytics={};Bsi.analytics.trackPageview=function(B){if(Bsi.DBG_GA){var A=0;switch(B.type){case"btq":A=B.data.nid;break;case"btqs":A=B.data.id;break;case"twtr":if(!B.data){A=1}else{A=B.data.id}break;case"fb":A=1;break}if(A==1){pageTracker._trackPageview("/"+B.type)}else{if(A){pageTracker._trackPageview("/"+B.type+"/"+A)}}}};Ext.ns("Ext.ux.plugin");Ext.ux.plugin.TabCloseMenu=function(){var A,C,B;this.init=function(F){A=F;A.on("contextmenu",E)};function E(H,G,I){if(!C){C=new Ext.menu.Menu([{id:A.id+"-close",text:"Close Tab",handler:function(){A.remove(B)}},{id:A.id+"-close-others",text:"Close Other Tabs",handler:function(){A.items.each(function(K){if(K.closable&&K!=B){A.remove(K)}})}}])}B=G;var F=C.items;F.get(A.id+"-close").setDisabled(!G.closable);var J=true;A.items.each(function(){if(this!=G&&this.closable){J=false;return false}});F.get(A.id+"-close-others").setDisabled(J);C.showAt(I.getPoint())}};Ext.ux.plugin.triggerfieldTooltip=function(A){Ext.apply(this,A)};Ext.extend(Ext.ux.plugin.triggerfieldTooltip,Ext.util.Observable,{init:function(A){this.component=A;this.component.on("render",this.onRender,this)},onRender:function(){if(this.component.tooltip){if(typeof this.component.tooltip=="object"){Ext.QuickTips.register(Ext.apply({target:this.component.trigger},this.component.tooltip))}else{this.component.trigger.dom[this.component.tooltipType]=this.component.tooltip}}}});Ext.ux.plugin.CascadeWindows=function(A){Ext.apply(this,A)};Ext.extend(Ext.ux.plugin.CascadeWindows,Ext.util.Observable,{init:function(A){Ext.apply(A,{onRender:A.onRender.createSequence(function(H,F){var J=(this.manager)?this.manager:Ext.WindowMgr;var B=this.container;var K={width:this.width,height:this.height};var I=this.getEl().getAlignToXY(B.id,"tl-br");var G=(this.offsetX)?this.offsetX:15;var C=(this.offsetY)?this.offsetY:-15;if(J.cascaded){J.cascaded+=1}else{J.cascaded=1}if(J.cascaded==1){J.lastXY=this.getEl().getAlignToXY(B.id,"tl-tl?",[G,C])}else{J.lastXY[0]+=40;J.lastXY[1]+=25;var E={bottom:(K.height+J.lastXY[1]),right:(K.width+J.lastXY[0])};if(E.bottom>I[1]){J.lastXY[1]=0}if(E.right>I[0]){J.lastXY[0]=15}}this.cascaded=true;this.origPos=[];this.origPos[0]=J.lastXY[0];this.origPos[1]=J.lastXY[1];this.setPosition(J.lastXY[0],J.lastXY[1])})})}});Ext.ux.plugin.SortableDataView=function(A){Ext.apply(this,A||{},{dragCls:"x-view-sortable-drag",viewDragCls:"x-view-sortable-dragging"});Ext.ux.plugin.SortableDataView.superclass.constructor.call(this)};Ext.extend(Ext.ux.plugin.SortableDataView,Ext.util.Observable,{events:{drop:true},init:function(A){window.sdv=this;this.view=A;A.on("render",this.onRender,this)},onRender:function(){var I=this,G=this.view,C=G.store,H=new Ext.dd.DragDrop(G.el),F=this.dragCls,B=this.viewDragCls,J=this.scope||this,E=this.newPosFn||0,A=this.endDragFn||0;H.onMouseDown=function(O){var N,K,L;this.dragData=null;try{N=O.getTarget(G.itemSelector);K=G.indexOf(N);L=C.getAt(K);if(N&&L){this.dragData={origIdx:K,lastIdx:K,record:L};return true}}catch(M){this.dragData=null}return false};H.startDrag=function(K,L){if(!this.dragData){return false}Ext.fly(G.getNode(this.dragData.origIdx)).addClass(F);G.el.addClass(B)};H.endDrag=function(K){if(!this.dragData){return true}Ext.fly(G.getNode(this.dragData.lastIdx)).removeClass(F);G.el.removeClass(B);if(A){A(this.dragData,J)}I.fireEvent("drop",this.dragData.origIdx,this.dragData.lastIdx,this.dragData.record);return true};H.onDrag=function(P){var N,K,L,O=this.dragData;if(!O){return false}try{N=P.getTarget(G.itemSelector);K=G.indexOf(N);L=C.getAt(K);if(K===O.lastIdx){return true}if(N&&L){O.lastIdx=K;C.remove(O.record);C.insert(K,[O.record]);Ext.fly(G.getNode(K)).addClass(F);if(E){E(O,J)}return true}}catch(M){return false}return false};this.dd=H}});Ext.ux.plugin.LabelEditor=function(A,B){Ext.apply(A,{labelSelector:A.labelSelector||"span.x-editable"});Ext.ux.plugin.LabelEditor.superclass.constructor.call(this,B||new Ext.form.TextField({allowblank:false,selectOnFocus:true}),A)};Ext.extend(Ext.ux.plugin.LabelEditor,Ext.Editor,{alignment:"tl-tl",hideEl:false,cls:"x-small-editor",shim:false,completeOnEnter:true,cancelOnEsc:true,init:function(A){this.origData={};this.view=A;A.on("render",this.initEditor,this);this.on("complete",this.onSave,this)},initEditor:function(){this.view.getEl().on("mousedown",this.onMouseDown,this,{delegate:this.labelSelector})},onMouseDown:function(E,C){if(!E.ctrlKey&&!E.shiftKey){var B=this.view.findItemFromChild(C);E.stopEvent();var A=this.view.store.getAt(this.view.indexOf(B));this.startEdit(C,A.data[this.dataIndex]);this.activeRecord=A;this.origData=Ext.ux.clone(A.data)}else{E.preventDefault()}},onSave:function(A,B){this.activeRecord.set(this.dataIndex,B);if(this.onSaveFn){this.onSaveFn(this.dataIndex,this.origData,B,this.scope)}}});Ext.namespace("Ext.generaldata");Ext.generaldata.states=[[1,"AL","Alabama","The Heart of Dixie"],[2,"AK","Alaska","The Land of the Midnight Sun"],[4,"AZ","Arizona","The Grand Canyon State"],[5,"AR","Arkansas","The Natural State"],[12,"CA","California","The Golden State"],[13,"CO","Colorado","The Mountain State"],[14,"CT","Connecticut","The Constitution State"],[15,"DE","Delaware","The First State"],[16,"DC","District of Columbia","The Nation's Capital"],[18,"FL","Florida","The Sunshine State"],[19,"GA","Georgia","The Peach State"],[21,"HI","Hawaii","The Aloha State"],[22,"ID","Idaho","Famous Potatoes"],[23,"IL","Illinois","The Prairie State"],[24,"IN","Indiana","The Hospitality State"],[25,"IA","Iowa","The Corn State"],[26,"KS","Kansas","The Sunflower State"],[27,"KY","Kentucky","The Bluegrass State"],[28,"LA","Louisiana","The Bayou State"],[29,"ME","Maine","The Pine Tree State"],[31,"MD","Maryland","Chesapeake State"],[32,"MA","Massachusetts","The Spirit of America"],[33,"MI","Michigan","Great Lakes State"],[34,"MN","Minnesota","North Star State"],[35,"MS","Mississippi","Magnolia State"],[36,"MO","Missouri","Show Me State"],[37,"MT","Montana","Big Sky Country"],[38,"NE","Nebraska","Beef State"],[39,"NV","Nevada","Silver State"],[40,"NH","New Hampshire","Granite State"],[41,"NJ","New Jersey","Garden State"],[42,"NM","New Mexico","Land of Enchantment"],[43,"NY","New York","Empire State"],[44,"NC","North Carolina","First in Freedom"],[45,"ND","North Dakota","Peace Garden State"],[47,"OH","Ohio","The Heart of it All"],[48,"OK","Oklahoma","Oklahoma is OK"],[49,"OR","Oregon","Pacific Wonderland"],[51,"PA","Pennsylvania","Keystone State"],[53,"RI","Rhode Island","Ocean State"],[54,"SC","South Carolina","Nothing Could be Finer"],[55,"SD","South Dakota","Great Faces, Great Places"],[56,"TN","Tennessee","Volunteer State"],[57,"TX","Texas","Lone Star State"],[58,"UT","Utah","Salt Lake State"],[59,"VT","Vermont","Green Mountain State"],[61,"VA","Virginia","Mother of States"],[62,"WA","Washington","Green Tree State"],[63,"WV","West Virginia","Mountain State"],[64,"WI","Wisconsin","America's Dairyland"],[65,"WY","Wyoming","Like No Place on Earth"]];Ext.generaldata.countries=[["840","USA","United States","The United States of America"]];Ext.generaldata.creditcards=[["Visa","Visa",""],["Mastercard","Mastercard",""],["Discover","Discover",""],["AMEX","American Express",""]];Ext.generaldata.months=[["01","01 - Jan","01 - January","January"],["02","02 - Feb","02 - February","February"],["03","03 - Mar","03 - March","March"],["04","04 - Apr","04 - April","April"],["05","05 - May","05 - May","May"],["06","06 - Jun","06 - June","June"],["07","07 - Jul","07 - July","July"],["08","08 - Aug","08 - August","August"],["09","09 - Sep","09 - September","September"],["10","10 - Oct","10 - October","October"],["11","11 - Nov","11 - November","November"],["12","12 - Dec","12 - December","December"]];Ext.generaldata.years=[["09","2009",""],["10","2010",""],["11","2011",""],["12","2012",""],["13","2013",""],["14","2014",""],["15","2015",""],["16","2016",""],["17","2017",""],["18","2018",""],["19","2019",""],["20","2020",""],["21","2021",""],["22","2022",""],["23","2023",""],["24","2024",""]];Ext.generaldata.publish={0:"Private",1:"Public"};Ext.generaldata.neighborhoods=[{id:"hood-Shop_4_Cause",tid:57,text:"Shop 4 Cause",qtip:"View boutiques to Shop 4 Cause",leaf:true},{id:"area-SF_Bay_Area",tid:7,text:"SF Bay Area",qtip:"View boutiques in San Francisco Bay Area",noSelect:true,children:[{id:"rgn-San_Francisco",tid:10,text:"San Francisco",qtip:"View boutiques in San Francisco",noSelect:true,children:[{id:"hood-Polk",tid:54,text:"Polk",leaf:true},{id:"hood-Fillmore",tid:55,text:"Fillmore",leaf:true},{id:"hood-Marina",tid:65,text:"Marina",leaf:true}]},{id:"rgn-Marin",tid:14,text:"Marin",qtip:"View boutiques in Marin",noSelect:true,children:[{id:"hood-Mill_Valley",tid:5,text:"Mill Valley",leaf:true}]},{id:"rgn-Peninsula",tid:12,text:"Peninsula",qtip:"View boutiques in Peninsula",noSelect:true,children:[{id:"hood-Burlingame",tid:4,text:"Burlingame",leaf:true},{id:"hood-Menlo_Park",tid:15,text:"Menlo Park",leaf:true},{id:"hood-Palo_Alto",tid:35,text:"Palo Alto",leaf:true}]},{id:"rgn-Wine_Country",tid:36,text:"Wine Country",qtip:"View boutiques in Wine Country",noSelect:true,children:[{id:"hood-St_Helena",tid:13,text:"St Helena",leaf:true}]}]},{id:"area-LA_Metro_Area",tid:8,text:"LA Metro Area",qtip:"View boutiques in Los Angeles Metro Area",noSelect:true,children:[{id:"rgn-Westside",tid:52,text:"Westside",qtip:"View boutiques in Westside",noSelect:true,children:[{id:"hood-Venice",tid:53,text:"Venice",leaf:true},{id:"hood-Brentwood",tid:63,text:"Brentwood",leaf:true},{id:"hood-Beverly_Hills",tid:59,text:"Beverly Hills",leaf:true},{id:"hood-West_Hollywood",tid:64,text:"West Hollywood",leaf:true}]},{id:"rgn-Mid-City",tid:58,text:"Mid-City",qtip:"View boutiques in Mid-City",noSelect:true,comingSoon:true,children:[{id:"hood-Larchmont",tid:60,text:"Larchmont",comingSoon:true,leaf:true}]},{id:"rgn-Orange_County",tid:61,text:"Orange County",qtip:"View boutiques in Orange County",noSelect:true,children:[{id:"hood-Laguna_Beach",tid:62,text:"Laguna Beach",leaf:true}]}]},{id:"area-NY_Metro_Area",tid:9,text:"NY Metro Area",qtip:"View boutiques in New York Metro Area",leaf:true,comingSoon:true}];(function(){var EV=Ext.lib.Event;Ext.ux.ManagedIFrame=function(){var args=Array.prototype.slice.call(arguments,0),el=Ext.get(args[0]),config=args[0];if(el&&el.dom&&el.dom.tagName=="IFRAME"){config=args[1]||{}}else{config=args[0]||args[1]||{};el=config.autoCreate?Ext.get(Ext.DomHelper.append(config.autoCreate.parent||document.body,Ext.apply({tag:"iframe",src:(Ext.isIE&&Ext.isSecure)?Ext.SSL_SECURE_URL:""},config.autoCreate))):null}if(!el||el.dom.tagName!="IFRAME"){return el}el.dom.name||(el.dom.name=el.dom.id);this.addEvents({focus:true,blur:true,unload:true,domready:true,documentloaded:true,exception:true,message:true});if(config.listeners){this.listeners=config.listeners;Ext.ux.ManagedIFrame.superclass.constructor.call(this)}Ext.apply(el,this);el.addClass("x-managed-iframe");if(config.style){el.applyStyles(config.style)}el._maskEl=el.parent(".x-managed-iframe-mask")||el.parent().addClass("x-managed-iframe-mask");Ext.apply(el,{disableMessaging:config.disableMessaging===true,loadMask:Ext.apply({msg:"Loading..",msgCls:"x-mask-loading",maskEl:el._maskEl,hideOnReady:true,disabled:!config.loadMask},config.loadMask),_eventName:Ext.isIE?"onreadystatechange":"onload",_windowContext:null,eventsFollowFrameLinks:typeof config.eventsFollowFrameLinks=="undefined"?true:config.eventsFollowFrameLinks});el.dom[el._eventName]=el.loadHandler.createDelegate(el);if(document.addEventListener){Ext.EventManager.on(window,"DOMFrameContentLoaded",el.dom[el._eventName])}var um=el.updateManager=new Ext.UpdateManager(el,true);um.showLoadIndicator=config.showLoadIndicator||false;if(config.src){el.setSrc(config.src)}else{var content=config.html||config.content||false;if(content){el.update.defer(10,el,[content])}}return Ext.ux.ManagedIFrame.Manager.register(el)};var MIM=Ext.ux.ManagedIFrame.Manager=function(){var frames={};return{shimCls:"x-frame-shim",register:function(frame){frame.manager=this;frames[frame.id]=frames[frame.dom.name]={ref:frame,elCache:{}};return frame},deRegister:function(frame){frame._unHook();delete frames[frame.id];delete frames[frame.dom.name]},hideShims:function(){if(!this.shimApplied){return }Ext.select("."+this.shimCls,true).removeClass(this.shimCls+"-on");this.shimApplied=false},showShims:function(){if(!this.shimApplied){this.shimApplied=true;Ext.select("."+this.shimCls,true).addClass(this.shimCls+"-on")}},getFrameById:function(id){return typeof id=="string"?(frames[id]?frames[id].ref||null:null):null},getFrameByName:function(name){return this.getFrameById(name)},getFrameHash:function(frame){return frame.id?frames[frame.id]:null},eventProxy:function(e){e=Ext.lib.Event.getEvent(e);if(!e){return }var be=e.browserEvent||e;if(e.type=="unload"){this._unHook()}if(!be.eventPhase||(be.eventPhase==(be.AT_TARGET||2))){return this.fireEvent(e.type,e)}},_flyweights:{},removeNode:Ext.isIE?function(frame,n){frame=MIM.getFrameHash(frame);if(frame&&n&&n.tagName!="BODY"){d=frame.scratchDiv||(frame.scratchDiv=frame.getDocument().createElement("div"));d.appendChild(n);d.innerHTML=""}}:function(frame,n){if(n&&n.parentNode&&n.tagName!="BODY"){n.parentNode.removeChild(n)}}}}();MIM.showDragMask=MIM.showShims;MIM.hideDragMask=MIM.hideShims;MIM.El=function(frame,el,forceNew){var frameObj;frame=(frameObj=MIM.getFrameHash(frame))?frameObj.ref:null;if(!frame){return null}var elCache=frameObj.elCache||(frameObj.elCache={});var dom=frame.getDom(el);if(!dom){return null}var id=dom.id;if(forceNew!==true&&id&&elCache[id]){return elCache[id]}this.dom=dom;this.id=id||Ext.id(dom)};MIM.El.get=function(frame,el){var ex,elm,id,doc;if(!frame||!el){return null}var frameObj;frame=(frameObj=MIM.getFrameHash(frame))?frameObj.ref:null;if(!frame){return null}var elCache=frameObj.elCache||(frameObj.elCache={});if(!(doc=frame.getDocument())){return null}if(typeof el=="string"){if(!(elm=frame.getDom(el))){return null}if(ex=elCache[el]){ex.dom=elm}else{ex=elCache[el]=new MIM.El(frame,elm)}return ex}else{if(el.tagName){if(!(id=el.id)){id=Ext.id(el)}if(ex=elCache[id]){ex.dom=el}else{ex=elCache[id]=new MIM.El(frame,el)}return ex}else{if(el instanceof MIM.El){if(el!=frameObj.docEl){el.dom=frame.getDom(el.id)||el.dom;elCache[el.id]=el}return el}else{if(el.isComposite){return el}else{if(Ext.isArray(el)){return frame.select(el)}else{if(el==doc){if(!frameObj.docEl){var f=function(){};f.prototype=MIM.El.prototype;frameObj.docEl=new f();frameObj.docEl.dom=doc}return frameObj.docEl}}}}}}return null};Ext.apply(MIM.El.prototype,Ext.Element.prototype);Ext.extend(Ext.ux.ManagedIFrame,Ext.util.Observable,{src:null,setSrc:function(url,discardUrl,callback){var reset=Ext.isIE&&Ext.isSecure?Ext.SSL_SECURE_URL:"";var src=url||this.src||reset;if(Ext.isOpera){this.dom.src=reset}this._windowContext=null;this._unHook();this._callBack=callback||false;this.showMask();(function(){var s=typeof src=="function"?src()||"":src;try{this._frameAction=true;this.dom.src=s;this.frameInit=true;this.checkDOM()}catch(ex){this.fireEvent("exception",this,ex)}}).defer(10,this);if(discardUrl!==true){this.src=src}return this},reset:function(src,callback){this.setSrc(src||(Ext.isIE&&Ext.isSecure?Ext.SSL_SECURE_URL:""),true,callback)},scriptRE:/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/gi,update:function(content,loadScripts,callback){loadScripts=loadScripts||this.getUpdateManager().loadScripts||false;content=Ext.DomHelper.markup(content||"");content=loadScripts===true?content:content.replace(this.scriptRE,"");var doc;if(doc=this.getDocument()){this._frameAction=!!content.length;this._windowContext=this.src=null;this._callBack=callback||false;this._unHook();this.showMask();doc.open();doc.write(content);doc.close();this.frameInit=true;if(this._frameAction){this.checkDOM()}else{this.hideMask(true);if(this._callBack){this._callBack()}}}else{this.hideMask(true);if(this._callBack){this._callBack()}}return this},disableMessaging:true,_XFrameMessaging:function(){var tagStack={"$":[]};var isEmpty=function(v,allowBlank){return v===null||v===undefined||(!allowBlank?v==="":false)};window.sendMessage=function(message,tag,origin){var MIF;if(MIF=arguments.callee.manager){if(message._fromHost){var fn,result;var compTag=message.tag||tag||null;var mstack=!isEmpty(compTag)?tagStack[compTag.toLowerCase()]||[]:tagStack["$"];for(var i=0,l=mstack.length;i<l;i++){if(fn=mstack[i]){result=fn.apply(fn.__scope,arguments)===false?false:result;if(fn.__single){mstack[i]=null}if(result===false){break}}}return result}else{message={type:isEmpty(tag)?"message":"message:"+tag.toLowerCase().replace(/^\s+|\s+$/g,""),data:message,domain:origin||document.domain,uri:document.documentURI,source:window,tag:isEmpty(tag)?null:tag.toLowerCase()};try{return MIF.disableMessaging!==true?MIF.fireEvent.call(MIF,message.type,MIF,message):null}catch(ex){}return null}}};window.onhostmessage=function(fn,scope,single,tag){if(typeof fn=="function"){if(!isEmpty(fn.__index)){throw"onhostmessage: duplicate handler definition"+(tag?" for tag:"+tag:"")}var k=isEmpty(tag)?"$":tag.toLowerCase();tagStack[k]||(tagStack[k]=[]);Ext.apply(fn,{__tag:k,__single:single||false,__scope:scope||window,__index:tagStack[k].length});tagStack[k].push(fn)}else{throw"onhostmessage: function required"}};window.unhostmessage=function(fn){if(typeof fn=="function"&&typeof fn.__index!="undefined"){var k=fn.__tag||"$";tagStack[k][fn.__index]=null}}},get:function(el){return MIM.El.get(this,el)},fly:function(el,named){named=named||"_global";el=this.getDom(el);if(!el){return null}if(!MIM._flyweights[named]){MIM._flyweights[named]=new Ext.Element.Flyweight()}MIM._flyweights[named].dom=el;return MIM._flyweights[named]},getDom:function(el){var d;if(!el||!(d=this.getDocument())){return null}return el.dom?el.dom:(typeof el=="string"?d.getElementById(el):el)},select:function(selector,unique){var d;return(d=this.getDocument())?Ext.Element.select(selector,unique,d):null},query:function(selector){var d;return(d=this.getDocument())?Ext.DomQuery.select(selector,d):null},getDoc:function(){return this.get(this.getDocument())},removeNode:function(node){MIM.removeNode(this,this.getDom(node))},_unHook:function(){var elcache,h=MIM.getFrameHash(this)||{};if(this._hooked&&h&&(elcache=h.elCache)){for(var id in elcache){var el=elcache[id];delete elcache[id];if(el.removeAllListeners){el.removeAllListeners()}}if(h.docEl){h.docEl.removeAllListeners();h.docEl=null;delete h.docEl}}this._hooked=this._domReady=this._domFired=false},_renderHook:function(){this._windowContext=null;this._hooked=false;try{if(this.writeScript('(function(){(window.hostMIF = parent.Ext.get("'+this.dom.id+'"))._windowContext='+(Ext.isIE?"window":"{eval:function(s){return eval(s);}}")+";})();")){this._frameProxy||(this._frameProxy=MIM.eventProxy.createDelegate(this));EV.doAdd(this.getWindow(),"focus",this._frameProxy);EV.doAdd(this.getWindow(),"blur",this._frameProxy);EV.doAdd(this.getWindow(),"unload",this._frameProxy);if(this.disableMessaging!==true){this.loadFunction({name:"XMessage",fn:this._XFrameMessaging},false,true);var sm;if(sm=this.getWindow().sendMessage){sm.manager=this}}this.CSS=new CSSInterface(this.getDocument())}return this.domWritable()}catch(ex){}return false},sendMessage:function(message,tag,origin){var win;if(this.disableMessaging!==true&&(win=this.getWindow())){tag||(tag=message.tag||"");tag=tag.toLowerCase();message=Ext.applyIf(message.data?message:{data:message},{type:Ext.isEmpty(tag)?"message":"message:"+tag,domain:origin||document.domain,uri:document.documentURI,source:window,tag:tag||null,_fromHost:this});return win.sendMessage?win.sendMessage.call(null,message,tag,origin):null}return null},_windowContext:null,getDocument:function(){var win;return(win=this.getWindow())?win.document:null},getBody:function(){var d;return(d=this.getDocument())?d.body:null},getDocumentURI:function(){var URI;try{URI=this.src?this.getDocument().location.href:null}catch(ex){}return URI||this.src},getWindow:function(){var dom=this.dom;return dom?dom.contentWindow||window.frames[dom.name]:null},print:function(){try{var win=this.getWindow();if(Ext.isIE){win.focus()}win.print()}catch(ex){throw"print exception: "+(ex.description||ex.message||ex)}},destroy:function(){this.removeAllListeners();if(this.dom){if(document.addEventListener){Ext.EventManager.un(window,"DOMFrameContentLoaded",this.dom[this._eventName])}this.dom[this._eventName]=null;Ext.ux.ManagedIFrame.Manager.deRegister(this);this._windowContext=null;if(Ext.isIE&&this.dom.src){this.dom.src="javascript:false"}this._maskEl=null;Ext.removeNode(this.dom)}Ext.apply(this.loadMask,{masker:null,maskEl:null})},domWritable:function(){return !!this._windowContext},execScript:function(block,useDOM){try{if(this.domWritable()){if(useDOM){this.writeScript(block)}else{return this._windowContext.eval(block)}}else{throw"execScript:non-secure context"}}catch(ex){this.fireEvent("exception",this,ex);return false}return true},writeScript:function(block,attributes){attributes=Ext.apply({},attributes||{},{type:"text/javascript",text:block});try{var head,script,doc=this.getDocument();if(doc&&doc.getElementsByTagName){if(!(head=doc.getElementsByTagName("head")[0])){head=doc.createElement("head");doc.getElementsByTagName("html")[0].appendChild(head)}if(head&&(script=doc.createElement("script"))){for(var attrib in attributes){if(attributes.hasOwnProperty(attrib)&&attrib in script){script[attrib]=attributes[attrib]}}return !!head.appendChild(script)}}}catch(ex){this.fireEvent("exception",this,ex)}return false},loadFunction:function(fn,useDOM,invokeIt){var name=fn.name||fn;var fn=fn.fn||window[fn];this.execScript(name+"="+fn,useDOM);if(invokeIt){this.execScript(name+"()")}},showMask:function(msg,msgCls,forced){var lmask;if((lmask=this.loadMask)&&(!lmask.disabled||forced)){if(lmask._vis){return }lmask.masker||(lmask.masker=Ext.get(lmask.maskEl||this.dom.parentNode||this.wrap({tag:"div",style:{position:"relative"}})));lmask._vis=true;lmask.masker.mask.defer(lmask.delay||5,lmask.masker,[msg||lmask.msg,msgCls||lmask.msgCls])}},hideMask:function(forced){var tlm;if((tlm=this.loadMask)&&!tlm.disabled&&tlm.masker){if(!forced&&(tlm.hideOnReady!==true&&this._domReady)){return }tlm._vis=false;tlm.masker.unmask.defer(tlm.delay||5,tlm.masker)}},loadHandler:function(e){if(!this.frameInit||(!this._frameAction&&!this.eventsFollowFrameLinks)){return }var rstatus=(e&&typeof e.type!=="undefined"?e.type:this.dom.readyState);switch(rstatus){case"loading":case"interactive":break;case"DOMFrameContentLoaded":if(this._domFired||(e&&e.target!==this.dom)){return }case"domready":if(this._domFired){return }if(this._domFired=this._hooked=this._renderHook()){this._frameAction=(this.fireEvent("domready",this)===false?false:this._frameAction)}case"domfail":this._domReady=true;this.hideMask();break;case"load":case"complete":if(!this._domFired){this.loadHandler({type:"domready"})}this.hideMask(true);if(this._frameAction||this.eventsFollowFrameLinks){this.fireEvent.defer(50,this,["documentloaded",this])}this._frameAction=false;if(this.eventsFollowFrameLinks){this._domFired=this._domReady=false}if(this._callBack){this._callBack(this)}break;default:}},checkDOM:function(win){if(Ext.isOpera){return }var n=0,win=win||this.getWindow(),manager=this,domReady=false,max=100;var poll=function(){try{domReady=false;var doc=win.document,body;if(!manager._domReady){domReady=(doc&&doc.getElementsByTagName);domReady=domReady&&(body=doc.getElementsByTagName("body")[0])&&!!body.innerHTML.length}}catch(ex){n=max}if(!manager._frameAction||manager._domReady){return }if(n++<max&&!domReady){setTimeout(arguments.callee,10);return }manager.loadHandler({type:domReady?"domready":"domfail"})};setTimeout(poll,50)}});var styleCamelRe=/(-[a-z])/gi;var styleCamelFn=function(m,a){return a.charAt(1).toUpperCase()};var CSSInterface=function(hostDocument){var doc;if(hostDocument){doc=hostDocument;return{rules:null,createStyleSheet:function(cssText,id){var ss;if(!doc){return }var head=doc.getElementsByTagName("head")[0];var rules=doc.createElement("style");rules.setAttribute("type","text/css");if(id){rules.setAttribute("id",id)}if(Ext.isIE){head.appendChild(rules);ss=rules.styleSheet;ss.cssText=cssText}else{try{rules.appendChild(doc.createTextNode(cssText))}catch(e){rules.cssText=cssText}head.appendChild(rules);ss=rules.styleSheet?rules.styleSheet:(rules.sheet||doc.styleSheets[doc.styleSheets.length-1])}this.cacheStyleSheet(ss);return ss},removeStyleSheet:function(id){if(!doc){return }var existing=doc.getElementById(id);if(existing){existing.parentNode.removeChild(existing)}},swapStyleSheet:function(id,url){this.removeStyleSheet(id);if(!doc){return }var ss=doc.createElement("link");ss.setAttribute("rel","stylesheet");ss.setAttribute("type","text/css");ss.setAttribute("id",id);ss.setAttribute("href",url);doc.getElementsByTagName("head")[0].appendChild(ss)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(ss){if(this.rules){this.rules={}}try{var ssRules=ss.cssRules||ss.rules;for(var j=ssRules.length-1;j>=0;--j){this.rules[ssRules[j].selectorText]=ssRules[j]}}catch(e){}},getRules:function(refreshCache){if(this.rules==null||refreshCache){this.rules={};if(doc){var ds=doc.styleSheets;for(var i=0,len=ds.length;i<len;i++){try{this.cacheStyleSheet(ds[i])}catch(e){}}}}return this.rules},getRule:function(selector,refreshCache){var rs=this.getRules(refreshCache);if(!Ext.isArray(selector)){return rs[selector]}for(var i=0;i<selector.length;i++){if(rs[selector[i]]){return rs[selector[i]]}}return null},updateRule:function(selector,property,value){if(!Ext.isArray(selector)){var rule=this.getRule(selector);if(rule){rule.style[property.replace(styleCamelRe,styleCamelFn)]=value;return true}}else{for(var i=0;i<selector.length;i++){if(this.updateRule(selector[i],property,value)){return true}}}return false}}}};Ext.ux.ManagedIframePanel=Ext.extend(Ext.Panel,{defaultSrc:null,bodyStyle:{height:"100%",width:"100%",position:"relative"},frameStyle:{overflow:"auto"},frameConfig:null,hideMode:!Ext.isIE?"nosize":"display",shimCls:Ext.ux.ManagedIFrame.Manager.shimCls,shimUrl:null,loadMask:false,animCollapse:Ext.isIE,autoScroll:false,closable:true,ctype:"Ext.ux.ManagedIframePanel",showLoadIndicator:false,unsupportedText:"Inline frames are NOT enabled/supported by your browser.",initComponent:function(){var unsup=this.unsupportedText?{html:this.unsupportedText}:false;this.bodyCfg||(this.bodyCfg={tag:"div",cls:"x-panel-body",children:[{cls:"x-managed-iframe-mask",children:[Ext.apply(Ext.apply({tag:"iframe",frameborder:0,cls:"x-managed-iframe",style:this.frameStyle||null},this.frameConfig),unsup,Ext.isIE&&Ext.isSecure?{src:Ext.SSL_SECURE_URL}:false),{tag:"img",src:this.shimUrl||Ext.BLANK_IMAGE_URL,cls:this.shimCls}]}]});this.autoScroll=false;this.items=null;if(this.stateful!==false){this.stateEvents||(this.stateEvents=["documentloaded"])}Ext.ux.ManagedIframePanel.superclass.initComponent.call(this);this.monitorResize||(this.monitorResize=this.fitToParent);this.addEvents({documentloaded:true,domready:true,message:true,exception:true});this.addListener=this.on},doLayout:function(){if(this.fitToParent&&!this.ownerCt){var pos=this.getPosition(),size=(Ext.get(this.fitToParent)||this.getEl().parent()).getViewSize();this.setSize(size.width-pos[0],size.height-pos[1])}Ext.ux.ManagedIframePanel.superclass.doLayout.apply(this,arguments)},beforeDestroy:function(){if(this.rendered){if(this.tools){for(var k in this.tools){Ext.destroy(this.tools[k])}}if(this.header&&this.headerAsText){var s;if(s=this.header.child("span")){s.remove()}this.header.update("")}Ext.each(["iframe","shim","header","topToolbar","bottomToolbar","footer","loadMask","body","bwrap"],function(elName){if(this[elName]){if(typeof this[elName].destroy=="function"){this[elName].destroy()}else{Ext.destroy(this[elName])}this[elName]=null;delete this[elName]}},this)}Ext.ux.ManagedIframePanel.superclass.beforeDestroy.call(this)},onDestroy:function(){Ext.Panel.superclass.onDestroy.call(this)},onRender:function(ct,position){Ext.ux.ManagedIframePanel.superclass.onRender.call(this,ct,position);if(this.iframe=this.body.child("iframe.x-managed-iframe")){var El=Ext.Element;var mode=El[this.hideMode.toUpperCase()]||"x-hide-nosize";Ext.each([this[this.collapseEl],this.floating?null:this.getActionEl(),this.iframe],function(el){if(el){el.setVisibilityMode(mode)}},this);if(this.loadMask){this.loadMask=Ext.apply({disabled:false,maskEl:this.body,hideOnReady:true},this.loadMask)}if(this.iframe=new Ext.ux.ManagedIFrame(this.iframe,{loadMask:this.loadMask,showLoadIndicator:this.showLoadIndicator,disableMessaging:this.disableMessaging,style:this.frameStyle})){this.loadMask=this.iframe.loadMask;this.iframe.ownerCt=this;this.relayEvents(this.iframe,["blur","focus","unload","documentloaded","domready","exception","message"].concat(this._msgTagHandlers||[]));delete this._msgTagHandlers}this.getUpdater().showLoadIndicator=this.showLoadIndicator||false;var ownerCt=this.ownerCt;while(ownerCt){ownerCt.on("afterlayout",function(container,layout){var MIM=Ext.ux.ManagedIFrame.Manager,st=false;Ext.each(["north","south","east","west"],function(region){var reg;if((reg=layout[region])&&reg.splitEl){st=true;if(!reg.split._splitTrapped){reg.split.on("beforeresize",MIM.showShims,MIM);reg.split._splitTrapped=true}}},this);if(st&&!this._splitTrapped){this.on("resize",MIM.hideShims,MIM);this._splitTrapped=true}},this,{single:true});ownerCt=ownerCt.ownerCt}}this.shim=Ext.get(this.body.child("."+this.shimCls))},toggleShim:function(){if(this.shim&&this.shimCls){this.shim.toggleClass(this.shimCls+"-on")}},afterRender:function(container){var html=this.html;delete this.html;Ext.ux.ManagedIframePanel.superclass.afterRender.call(this);if(this.iframe){if(this.defaultSrc){this.setSrc()}else{if(html){this.iframe.update(typeof html=="object"?Ext.DomHelper.markup(html):html)}}}},sendMessage:function(){if(this.iframe){this.iframe.sendMessage.apply(this.iframe,arguments)}},on:function(name){var tagRE=/^message\:/i,n=null;if(typeof name=="object"){for(var na in name){if(!this.filterOptRe.test(na)&&tagRE.test(na)){n||(n=[]);n.push(na.toLowerCase())}}}else{if(tagRE.test(name)){n=[name.toLowerCase()]}}if(this.getFrame()&&n){this.relayEvents(this.iframe,n)}else{this._msgTagHandlers||(this._msgTagHandlers=[]);if(n){this._msgTagHandlers=this._msgTagHandlers.concat(n)}}Ext.ux.ManagedIframePanel.superclass.on.apply(this,arguments)},setSrc:function(url,discardUrl,callback){url=url||this.defaultSrc||false;if(!url){return this}if(url.url){callback=url.callback||false;discardUrl=url.discardUrl||false;url=url.url||false}var src=url||(Ext.isIE&&Ext.isSecure?Ext.SSL_SECURE_URL:"");if(this.rendered&&this.iframe){this.iframe.setSrc(src,discardUrl,callback)}return this},getState:function(){var URI=this.iframe?this.iframe.getDocumentURI()||null:null;return Ext.apply(Ext.ux.ManagedIframePanel.superclass.getState.call(this)||{},URI?{defaultSrc:typeof URI=="function"?URI():URI}:null)},getUpdater:function(){return this.rendered?(this.iframe||this.body).getUpdater():null},getFrame:function(){return this.rendered?this.iframe:null},getFrameWindow:function(){return this.rendered&&this.iframe?this.iframe.getWindow():null},getFrameDocument:function(){return this.rendered&&this.iframe?this.iframe.getDocument():null},getFrameDoc:function(){return this.rendered&&this.iframe?this.iframe.getDoc():null},getFrameBody:function(){return this.rendered&&this.iframe?this.iframe.getBody():null},load:function(loadCfg){var um;if(um=this.getUpdater()){if(loadCfg&&loadCfg.renderer){um.setRenderer(loadCfg.renderer);delete loadCfg.renderer}um.update.apply(um,arguments)}return this},doAutoLoad:function(){this.load(typeof this.autoLoad=="object"?this.autoLoad:{url:this.autoLoad})}});Ext.reg("iframepanel",Ext.ux.ManagedIframePanel);Ext.ux.ManagedIframePortlet=Ext.extend(Ext.ux.ManagedIframePanel,{anchor:"100%",frame:true,collapseEl:"bwrap",collapsible:true,draggable:true,cls:"x-portlet"});Ext.reg("iframeportlet",Ext.ux.ManagedIframePortlet);Ext.apply(Ext.Element.prototype,{setVisible:function(visible,animate){if(!animate||!Ext.lib.Anim){if(this.visibilityMode==Ext.Element.DISPLAY){this.setDisplayed(visible)}else{if(this.visibilityMode==Ext.Element.VISIBILITY){this.fixDisplay();this.dom.style.visibility=visible?"visible":"hidden"}else{this[visible?"removeClass":"addClass"](String(this.visibilityMode))}}}else{var dom=this.dom;var visMode=this.visibilityMode;if(visible){this.setOpacity(0.01);this.setVisible(true)}this.anim({opacity:{to:(visible?1:0)}},this.preanim(arguments,1),null,0.35,"easeIn",function(){if(!visible){if(visMode==Ext.Element.DISPLAY){dom.style.display="none"}else{if(visMode==Ext.Element.VISIBILITY){dom.style.visibility="hidden"}else{Ext.get(dom).addClass(String(visMode))}}Ext.get(dom).setOpacity(1)}})}return this},isVisible:function(deep){var vis=!(this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none"||this.hasClass(this.visibilityMode));if(deep!==true||!vis){return vis}var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Ext.fly(p,"_isVisible").isVisible()){return false}p=p.parentNode}return true}});Ext.onReady(function(){var CSS=Ext.util.CSS,rules=[];CSS.getRule(".x-managed-iframe")||(rules.push(".x-managed-iframe {height:100%;width:100%;overflow:auto;}"));CSS.getRule(".x-managed-iframe-mask")||(rules.push(".x-managed-iframe-mask{width:100%;height:100%;position:relative;}"));if(!CSS.getRule(".x-frame-shim")){rules.push(".x-frame-shim {z-index:9000;position:absolute;top:0px;left:0px;background:transparent!important;overflow:hidden;display:none;}");rules.push(".x-frame-shim-on{width:100%;height:100%;display:block;zoom:1;}");rules.push(".ext-ie6 .x-frame-shim{margin-left:5px;margin-top:3px;}")}CSS.getRule(".x-hide-nosize")||(rules.push(".x-hide-nosize,.x-hide-nosize object,.x-hide-nosize iframe{height:0px!important;width:0px!important;border:none;}"));if(!!rules.length){CSS.createStyleSheet(rules.join(" "))}})})();Ext.override(Ext.form.TextField,{filterKeys:function(B){var A=B.getKey();if(!Ext.isIE&&(B.isNavKeyPress()||A==B.BACKSPACE||(A==B.DELETE&&B.button==-1))){return }var E=B.getCharCode(),C=String.fromCharCode(E);if(Ext.isIE&&!C){return }if(!this.maskRe.test(C)){B.stopEvent()}}});Ext.override(Ext.ToolTip,{show:function(){this.activeTarget.text=this.activeTarget.text.replace(/"/g,"&quot;");this.activeTarget.text=this.activeTarget.text.replace(/'/g,"&#039;");this.showAt(this.getTargetXY())}});var RecaptchaTemplates={VertHtml:'<table id="recaptcha_table" class="recaptchatable" >\n<tr>\n<td colspan="6" class=\'recaptcha_r1_c1\'></td>\n</tr>\n<tr>\n<td class=\'recaptcha_r2_c1\'></td>\n<td colspan="4" class=\'recaptcha_image_cell\'><div id="recaptcha_image"></div></td>\n<td class=\'recaptcha_r2_c2\'></td>\n</tr>\n<tr>\n<td rowspan="6" class=\'recaptcha_r3_c1\'></td>\n<td colspan="4" class=\'recaptcha_r3_c2\'></td>\n<td rowspan="6" class=\'recaptcha_r3_c3\'></td>\n</tr>\n<tr>\n<td rowspan="3" class=\'recaptcha_r4_c1\' height="49">\n<div class="recaptcha_input_area">\n<label for="recaptcha_response_field" class="recaptcha_input_area_text"><span id="recaptcha_instructions_image" class="recaptcha_only_if_image recaptcha_only_if_no_incorrect_sol"></span><span id="recaptcha_instructions_audio" class="recaptcha_only_if_no_incorrect_sol recaptcha_only_if_audio"></span><span id="recaptcha_instructions_error" class="recaptcha_only_if_incorrect_sol"></span></label><br/>\n<input name="recaptcha_response_field" id="recaptcha_response_field" type="text" />\n</div>\n</td>\n<td rowspan="4" class=\'recaptcha_r4_c2\'></td>\n<td><a id=\'recaptcha_reload_btn\'><img id=\'recaptcha_reload\' width="25" height="17" /></a></td>\n<td rowspan="4" class=\'recaptcha_r4_c4\'></td>\n</tr>\n<tr>\n<td><a id=\'recaptcha_switch_audio_btn\' class="recaptcha_only_if_image"><img id=\'recaptcha_switch_audio\' width="25" height="16" alt="" /></a><a id=\'recaptcha_switch_img_btn\' class="recaptcha_only_if_audio"><img id=\'recaptcha_switch_img\' width="25" height="16" alt=""/></a></td>\n</tr>\n<tr>\n<td><a id=\'recaptcha_whatsthis_btn\'><img id=\'recaptcha_whatsthis\' width="25" height="16" /></a></td>\n</tr>\n<tr>\n<td class=\'recaptcha_r7_c1\'></td>\n<td class=\'recaptcha_r8_c1\'></td>\n</tr>\n</table>\n',VertCss:".recaptchatable td img {\n/* see http://developer.mozilla.org/en/docs/Images%2C_Tables%2C_and_Mysterious_Gaps */\ndisplay: block;\n}\n.recaptchatable .recaptcha_r1_c1 { background: url(IMGROOT/sprite.png) -0px -63px no-repeat; width: 318px; height: 9px; }\n.recaptchatable .recaptcha_r2_c1 { background: url(IMGROOT/sprite.png) -18px -0px no-repeat; width: 9px; height: 57px; }\n.recaptchatable .recaptcha_r2_c2 { background: url(IMGROOT/sprite.png) -27px -0px no-repeat; width: 9px; height: 57px; }\n.recaptchatable .recaptcha_r3_c1 { background: url(IMGROOT/sprite.png) -0px -0px no-repeat; width: 9px; height: 63px; }\n.recaptchatable .recaptcha_r3_c2 { background: url(IMGROOT/sprite.png) -18px -57px no-repeat; width: 300px; height: 6px; }\n.recaptchatable .recaptcha_r3_c3 { background: url(IMGROOT/sprite.png) -9px -0px no-repeat; width: 9px; height: 63px; }\n.recaptchatable .recaptcha_r4_c1 { background: url(IMGROOT/sprite.png) -43px -0px no-repeat; width: 171px; height: 49px; }\n.recaptchatable .recaptcha_r4_c2 { background: url(IMGROOT/sprite.png) -36px -0px no-repeat; width: 7px; height: 57px; }\n.recaptchatable .recaptcha_r4_c4 { background: url(IMGROOT/sprite.png) -214px -0px no-repeat; width: 97px; height: 57px; }\n.recaptchatable .recaptcha_r7_c1 { background: url(IMGROOT/sprite.png) -43px -49px no-repeat; width: 171px; height: 8px; }\n.recaptchatable .recaptcha_r8_c1 { background: url(IMGROOT/sprite.png) -43px -49px no-repeat; width: 25px; height: 8px; }\n.recaptchatable .recaptcha_image_cell center img { height:57px;}\n.recaptchatable .recaptcha_image_cell center { height:57px;}\n.recaptchatable .recaptcha_image_cell {\nbackground-color:white; height:57px;\n}\n/* some people break their style sheet, we need to clean up after them */\n#recaptcha_area, #recaptcha_table {\nwidth: 318px !important;\n}\n.recaptchatable, #recaptcha_area tr, #recaptcha_area td, #recaptcha_area th {\nmargin:0px !important;\nborder:0px !important;\npadding:0px !important;\nborder-collapse: collapse !important;\nvertical-align: middle !important;\n}\n.recaptchatable * {\nmargin:0px;\npadding:0px;\nborder:0px;\nfont-family:helvetica,sans-serif;\nfont-size:8pt;\ncolor:black;\nposition:static;\ntop:auto;\nleft:auto;\nright:auto;\nbottom:auto;\ntext-align:left !important;\n}\n.recaptchatable #recaptcha_image {\nmargin:auto;\n}\n.recaptchatable img {\nborder:0px !important;\nmargin:0px !important;\npadding:0px !important;\n}\n.recaptchatable a, .recaptchatable a:hover {\n-moz-outline:none;\nborder:0px !important;\npadding:0px !important;\ntext-decoration:none;\ncolor:blue;\nbackground:none !important;\nfont-weight: normal;\n}\n.recaptcha_input_area {\nposition:relative !important;\nwidth:146px !important;\nheight:45px !important;\nmargin-left:20px !important;\nmargin-right:5px !important;\nmargin-top:4px !important;\nbackground:none !important;\n}\n.recaptchatable label.recaptcha_input_area_text {\nmargin:0px !important;  \npadding:0px !important;\nposition:static !important;\ntop:auto !important;\nleft:auto !important;\nright:auto !important;\nbottom:auto !important;\nbackground:none !important;\nheight:auto !important;\nwidth:auto !important;\n}\n.recaptcha_theme_red label.recaptcha_input_area_text,\n.recaptcha_theme_white label.recaptcha_input_area_text {\ncolor:black !important;\n}\n.recaptcha_theme_blackglass label.recaptcha_input_area_text {\ncolor:white !important;\n}\n.recaptchatable #recaptcha_response_field  {\nwidth:145px !important;\nposition:absolute !important;\nbottom:7px !important;\npadding:0px !important;\nmargin:0px !important;\nfont-size:10pt;\n}\n.recaptcha_theme_blackglass #recaptcha_response_field,\n.recaptcha_theme_white #recaptcha_response_field {\nborder: 1px solid gray;\n}\n.recaptcha_theme_red #recaptcha_response_field {\nborder:1px solid #cca940;\n}\n.recaptcha_audio_cant_hear_link {\nfont-size:7pt;\ncolor:black;\n}\n.recaptchatable {\nline-height:1em;\n}\n#recaptcha_instructions_error {\ncolor:red !important;\n}\n",CleanHtml:'<table id="recaptcha_table" class="recaptchatable">\n<tr height="73">\n<td class=\'recaptcha_image_cell\' width="302"><center><div id="recaptcha_image"></div></center></td>\n<td style="padding: 10px 7px 7px 7px;">\n<a id=\'recaptcha_reload_btn\'><img id=\'recaptcha_reload\' width="25" height="18" alt="" /></a>\n<a id=\'recaptcha_switch_audio_btn\' class="recaptcha_only_if_image"><img id=\'recaptcha_switch_audio\' width="25" height="15" alt="" /></a><a id=\'recaptcha_switch_img_btn\' class="recaptcha_only_if_audio"><img id=\'recaptcha_switch_img\' width="25" height="15" alt=""/></a>\n<a id=\'recaptcha_whatsthis_btn\'><img id=\'recaptcha_whatsthis\' width="25" height="16" /></a>\n</td>\n<td style="padding: 18px 7px 18px 7px;">\n<img id=\'recaptcha_logo\' alt="" width="71" height="36" />\n</td>\n</tr>\n<tr>\n<td style="padding-left: 7px;">\n<div class="recaptcha_input_area" style="padding-top: 2px; padding-bottom: 7px;">\n<input style="border: 1px solid #3c3c3c; width: 302px;" name="recaptcha_response_field" id="recaptcha_response_field" type="text" />\n</div>\n</td>\n<td></td>\n<td style="padding: 4px 7px 12px 7px;">\n<img id="recaptcha_tagline" width="71" height="17" />\n</td>\n</tr>\n</table>\n',CleanCss:".recaptchatable td img {\ndisplay: block;\n}\n.recaptchatable .recaptcha_image_cell center img { height:57px;}\n.recaptchatable .recaptcha_image_cell center { height:57px;}\n.recaptchatable .recaptcha_image_cell {\nbackground-color:white; height:57px; \npadding: 7px !important;\n}\n.recaptchatable, #recaptcha_area tr, #recaptcha_area td, #recaptcha_area th {\nmargin:0px !important;\nborder:0px !important;\nborder-collapse: collapse !important;\nvertical-align: middle !important;\n}\n.recaptchatable * {\nmargin:0px;\npadding:0px;\nborder:0px;\ncolor:black;\nposition:static;\ntop:auto;\nleft:auto;\nright:auto;\nbottom:auto;\ntext-align:left !important;\n}\n.recaptchatable #recaptcha_image {\nmargin:auto;\nborder: 1px solid #dfdfdf !important;\n}\n.recaptchatable a img {\nborder:0px;\n}\n.recaptchatable a, .recaptchatable a:hover {\n-moz-outline:none;\nborder:0px !important;\npadding:0px !important;\ntext-decoration:none;\ncolor:blue;\nbackground:none !important;\nfont-weight: normal;\n}\n.recaptcha_input_area {\nposition:relative !important;\nbackground:none !important;\n}\n.recaptchatable label.recaptcha_input_area_text {\nborder:1px solid #dfdfdf !important;\nmargin:0px !important;  \npadding:0px !important;\nposition:static !important;\ntop:auto !important;\nleft:auto !important;\nright:auto !important;\nbottom:auto !important;\n}\n.recaptcha_theme_red label.recaptcha_input_area_text,\n.recaptcha_theme_white label.recaptcha_input_area_text {\ncolor:black !important;\n}\n.recaptcha_theme_blackglass label.recaptcha_input_area_text {\ncolor:white !important;\n}\n.recaptchatable #recaptcha_response_field  {\nfont-size:11pt;\n}\n.recaptcha_theme_blackglass #recaptcha_response_field,\n.recaptcha_theme_white #recaptcha_response_field {\nborder: 1px solid gray;\n}\n.recaptcha_theme_red #recaptcha_response_field {\nborder:1px solid #cca940;\n}\n.recaptcha_audio_cant_hear_link {\nfont-size:7pt;\ncolor:black;\n}\n.recaptchatable {\nline-height:1em;\nborder: 1px solid #dfdfdf !important;\n}\n.recaptcha_error_text {\ncolor:red;\n}\n"};var RecaptchaStr_en={visual_challenge:"Get a visual challenge",audio_challenge:"Get an audio challenge",refresh_btn:"Get a new challenge",instructions_visual:"Type the two words:",instructions_audio:"Type what you hear:",help_btn:"Help",play_again:"Play sound again",cant_hear_this:"Download sound as MP3",incorrect_try_again:"Incorrect. Try again."};var RecaptchaStr_de={visual_challenge:"Visuelle Aufgabe generieren",audio_challenge:"Audio-Aufgabe generieren",refresh_btn:"Neue Aufgabe generieren",instructions_visual:"Gib die 2 W\u00f6rter ein:",instructions_audio:"Gib die 8 Ziffern ein:",help_btn:"Hilfe",incorrect_try_again:"Falsch. Nochmals versuchen!"};var RecaptchaStr_es={visual_challenge:"Obt\u00e9n un reto visual",audio_challenge:"Obt\u00e9n un reto audible",refresh_btn:"Obt\u00e9n un nuevo reto",instructions_visual:"Escribe las 2 palabras:",instructions_audio:"Escribe los 8 n\u00fameros:",help_btn:"Ayuda",incorrect_try_again:"Incorrecto. Otro intento."};var RecaptchaStr_fr={visual_challenge:"D\u00e9fi visuel",audio_challenge:"D\u00e9fi audio",refresh_btn:"Nouveau d\u00e9fi",instructions_visual:"Entrez les deux mots:",instructions_audio:"Entrez les huit chiffres:",help_btn:"Aide",incorrect_try_again:"Incorrect."};var RecaptchaStr_nl={visual_challenge:"Test me via een afbeelding",audio_challenge:"Test me via een geluidsfragment",refresh_btn:"Nieuwe uitdaging",instructions_visual:"Type de twee woorden:",instructions_audio:"Type de acht cijfers:",help_btn:"Help",incorrect_try_again:"Foute invoer."};var RecaptchaStr_pt={visual_challenge:"Obter um desafio visual",audio_challenge:"Obter um desafio sonoro",refresh_btn:"Obter um novo desafio",instructions_visual:"Escreva as 2 palavras:",instructions_audio:"Escreva os 8 numeros:",help_btn:"Ajuda",incorrect_try_again:"Incorrecto. Tenta outra vez."};var RecaptchaStr_ru={visual_challenge:"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443",audio_challenge:"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0437\u0432\u0443\u043a\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443",refresh_btn:"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443",instructions_visual:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0432\u0430 \u0441\u043b\u043e\u0432\u0430:",instructions_audio:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0432\u043e\u0441\u0435\u043c\u044c \u0447\u0438\u0441\u0435\u043b:",help_btn:"\u041f\u043e\u043c\u043e\u0449\u044c",incorrect_try_again:"\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e."};var RecaptchaStr_tr={visual_challenge:"G\u00f6rsel deneme",audio_challenge:"\u0130\u015Fitsel deneme",refresh_btn:"Yeni deneme",instructions_visual:"\u0130ki kelimeyi yaz\u0131n:",instructions_audio:"Sekiz numaray\u0131 yaz\u0131n:",help_btn:"Yard\u0131m (\u0130ngilizce)",incorrect_try_again:"Yanl\u0131\u015f. Bir daha deneyin."};var RecaptchaLangMap={en:RecaptchaStr_en,de:RecaptchaStr_de,es:RecaptchaStr_es,fr:RecaptchaStr_fr,nl:RecaptchaStr_nl,pt:RecaptchaStr_pt,ru:RecaptchaStr_ru,tr:RecaptchaStr_tr};var RecaptchaStr=RecaptchaStr_en;var RecaptchaOptions;var RecaptchaDefaultOptions={tabindex:0,theme:"red",callback:null,lang:"en",custom_theme_widget:null,custom_translations:null};var Recaptcha={widget:null,timer_id:-1,style_set:false,theme:null,type:"image",ajax_verify_cb:null,$:function(A){if(typeof (A)=="string"){return document.getElementById(A)}else{return A}},create:function(C,B,A){Recaptcha.destroy();if(B){Recaptcha.widget=Recaptcha.$(B)}Recaptcha._init_options(A);Recaptcha._call_challenge(C)},destroy:function(){var C=Recaptcha.$("_recaptcha_state");if(C){C.parentNode.removeChild(C)}var E=Recaptcha.$("_recaptcha_reload");if(E){E.parentNode.removeChild(E)}var B=Recaptcha.$("recaptcha_challenge_field");if(B){B.parentNode.removeChild(B)}if(Recaptcha.timer_id!=-1){clearInterval(Recaptcha.timer_id)}Recaptcha.timer_id=-1;var A=Recaptcha.$("recaptcha_image");if(A){A.innerHTML=""}if(Recaptcha.widget){if(Recaptcha.theme!="custom"){Recaptcha.widget.innerHTML=""}else{Recaptcha.widget.style.display="none"}Recaptcha.widget=null}},focus_response_field:function(){var A=Recaptcha.$;var B=A("recaptcha_response_field");B.focus()},get_challenge:function(){if(typeof (RecaptchaState)=="undefined"){return null}return RecaptchaState.challenge},get_response:function(){var A=Recaptcha.$;var B=A("recaptcha_response_field");if(!B){return null}return B.value},ajax_verify:function(B){Recaptcha.ajax_verify_cb=B;var A=Recaptcha._get_api_server()+"/ajaxverify?c="+encodeURIComponent(Recaptcha.get_challenge())+"&response="+encodeURIComponent(Recaptcha.get_response());Recaptcha._add_script(A)},_ajax_verify_callback:function(A){Recaptcha.ajax_verify_cb(A)},_get_api_server:function(){var B=window.location.protocol;var A;if(typeof (_RecaptchaOverrideApiServer)!="undefined"){A=_RecaptchaOverrideApiServer}else{if(B=="https:"){A="api-secure.recaptcha.net"}else{A="api.recaptcha.net"}}return B+"//"+A},_call_challenge:function(A){var B=Recaptcha._get_api_server()+"/challenge?k="+A+"&ajax=1&cachestop="+Math.random();if(typeof (RecaptchaOptions.extra_challenge_params)!="undefined"){B+="&"+RecaptchaOptions.extra_challenge_params}Recaptcha._add_script(B,"_recaptcha_state")},_add_script:function(C,B){var A=document.createElement("script");if(B){A.setAttribute("id",B)}A.type="text/javascript";A.src=C;Recaptcha._get_script_area().appendChild(A)},_get_script_area:function(){var A=document.getElementsByTagName("head");if(!A||A.length<1){A=document.body}else{A=A[0]}return A},_hash_merge:function(B){var E={};for(var C in B){for(var A in B[C]){E[A]=B[C][A]}}return E},_init_options:function(A){RecaptchaOptions=Recaptcha._hash_merge([RecaptchaDefaultOptions,A||{}])},challenge_callback:function(){var A=Recaptcha.widget;Recaptcha._reset_timer();RecaptchaStr=Recaptcha._hash_merge([RecaptchaStr_en,RecaptchaLangMap[RecaptchaOptions.lang]||{},RecaptchaOptions.custom_translations||{}]);if(window.addEventListener){window.addEventListener("unload",function(E){Recaptcha.destroy()},false)}if(Recaptcha._is_ie()&&window.attachEvent){window.attachEvent("onbeforeunload",function(){})}if(navigator.userAgent.indexOf("KHTML")>0){var B=document.createElement("iframe");B.src="about:blank";B.style.height="0px";B.style.width="0px";B.style.visibility="hidden";B.style.border="none";var C=document.createTextNode("This frame prevents back/forward cache problems in Safari.");B.appendChild(C);document.body.appendChild(B)}Recaptcha._finish_widget()},_add_css:function(B){var A=document.createElement("style");A.type="text/css";if(A.styleSheet){if(navigator.appVersion.indexOf("MSIE 5")!=-1){document.write("<style type='text/css'>"+B+"</style>")}else{A.styleSheet.cssText=B}}else{if(navigator.appVersion.indexOf("MSIE 5")!=-1){document.write("<style type='text/css'>"+B+"</style>")}else{var C=document.createTextNode(B);A.appendChild(C)}}Recaptcha._get_script_area().appendChild(A)},_set_style:function(A){if(Recaptcha.style_set){return }Recaptcha.style_set=true;Recaptcha._add_css(A+"\n\n.recaptcha_is_showing_audio .recaptcha_only_if_image,.recaptcha_isnot_showing_audio .recaptcha_only_if_audio,.recaptcha_had_incorrect_sol .recaptcha_only_if_no_incorrect_sol,.recaptcha_nothad_incorrect_sol .recaptcha_only_if_incorrect_sol{display:none !important}")},_init_builtin_theme:function(){var G=Recaptcha.$;var I=RecaptchaStr;var C=RecaptchaState;var F,E,A;var H=C.server;if(H[H.length-1]=="/"){H=H.substring(0,H.length-1)}var B=H+"/img/"+Recaptcha.theme;if(Recaptcha.theme=="clean"){F=RecaptchaTemplates.CleanCss;E=RecaptchaTemplates.CleanHtml;A="png"}else{F=RecaptchaTemplates.VertCss;E=RecaptchaTemplates.VertHtml;A="gif"}F=F.replace(/IMGROOT/g,B);Recaptcha._set_style(F);Recaptcha.widget.innerHTML="<div id='recaptcha_area'>"+E+"</div>";G("recaptcha_reload").src=B+"/refresh."+A;G("recaptcha_switch_audio").src=B+"/audio."+A;G("recaptcha_switch_img").src=B+"/text."+A;G("recaptcha_whatsthis").src=B+"/help."+A;if(Recaptcha.theme=="clean"){G("recaptcha_logo").src=B+"/logo."+A;G("recaptcha_tagline").src=B+"/tagline."+A}G("recaptcha_reload").alt=I.refresh_btn;G("recaptcha_switch_audio").alt=I.audio_challenge;G("recaptcha_switch_img").alt=I.visual_challenge;G("recaptcha_whatsthis").alt=I.help_btn;G("recaptcha_reload_btn").href="javascript:Recaptcha.reload ();";G("recaptcha_reload_btn").title=I.refresh_btn;G("recaptcha_switch_audio_btn").href="javascript:Recaptcha.switch_type('audio');";G("recaptcha_switch_audio_btn").title=I.audio_challenge;G("recaptcha_switch_img_btn").href="javascript:Recaptcha.switch_type('image');";G("recaptcha_switch_img_btn").title=I.visual_challenge;G("recaptcha_whatsthis_btn").href=Recaptcha._get_help_link();G("recaptcha_whatsthis_btn").target="_blank";G("recaptcha_whatsthis_btn").title=I.help_btn;G("recaptcha_whatsthis_btn").onclick=function(){Recaptcha.showhelp();return false};G("recaptcha_table").className="recaptchatable recaptcha_theme_"+Recaptcha.theme;if(G("recaptcha_instructions_image")){G("recaptcha_instructions_image").appendChild(document.createTextNode(I.instructions_visual))}if(G("recaptcha_instructions_audio")){G("recaptcha_instructions_audio").appendChild(document.createTextNode(I.instructions_audio))}if(G("recaptcha_instructions_error")){G("recaptcha_instructions_error").appendChild(document.createTextNode(I.incorrect_try_again))}},_finish_widget:function(){var E=Recaptcha.$;var G=RecaptchaStr;var B=RecaptchaState;var A=RecaptchaOptions;var F=A.theme;switch(F){case"red":case"white":case"blackglass":case"clean":case"custom":break;default:F="red";break}if(!Recaptcha.theme){Recaptcha.theme=F}if(Recaptcha.theme!="custom"){Recaptcha._init_builtin_theme()}else{Recaptcha._set_style("")}var C=document.createElement("span");C.id="recaptcha_challenge_field_holder";C.style.display="none";E("recaptcha_response_field").parentNode.insertBefore(C,E("recaptcha_response_field"));E("recaptcha_response_field").setAttribute("autocomplete","off");E("recaptcha_image").style.width="300px";E("recaptcha_image").style.height="57px";Recaptcha.should_focus=false;Recaptcha._set_challenge(B.challenge,"image");if(A.tabindex){E("recaptcha_response_field").tabIndex=A.tabindex;if(Recaptcha.theme!="custom"){E("recaptcha_whatsthis_btn").tabIndex=A.tabindex;E("recaptcha_switch_img_btn").tabIndex=A.tabindex;E("recaptcha_switch_audio_btn").tabIndex=A.tabindex;E("recaptcha_reload_btn").tabIndex=A.tabindex}}if(Recaptcha.widget){Recaptcha.widget.style.display=""}if(A.callback){A.callback()}},switch_type:function(B){var A=Recaptcha;A.type=B;A.reload(A.type=="audio"?"a":"v")},reload:function(F){var B=Recaptcha;var C=B.$;var A=RecaptchaState;if(typeof (F)=="undefined"){F="r"}var G=A.server+"reload?c="+A.challenge+"&k="+A.site+"&reason="+F+"&type="+B.type+"&lang="+RecaptchaOptions.lang;if(typeof (RecaptchaOptions.extra_challenge_params)!="undefined"){G+="&"+RecaptchaOptions.extra_challenge_params}if(B.type=="audio"){if(RecaptchaOptions.audio_beta_12_08){G+="&audio_beta_12_08=1"}else{G+="&new_audio_default=1"}}B.should_focus=F!="t";var E=C("_recaptcha_reload");if(E){E.parentNode.removeChild(E)}B._add_script(G,"_recaptcha_reload")},finish_reload:function(B,A){RecaptchaState.is_incorrect=false;Recaptcha._set_challenge(B,A)},_set_challenge:function(E,C){var B=Recaptcha;var A=RecaptchaState;var G=B.$;A.challenge=E;B.type=C;G("recaptcha_challenge_field_holder").innerHTML="<input type='hidden' name='recaptcha_challenge_field' id='recaptcha_challenge_field' value='"+A.challenge+"'/>";if(C=="audio"){G("recaptcha_image").innerHTML=Recaptcha.getAudioCaptchaHtml()}else{if(C=="image"){var F=A.server+"image?c="+A.challenge;G("recaptcha_image").innerHTML="<img style='display:block;' height='57' width='300' src='"+F+"'/>"}}Recaptcha._css_toggle("recaptcha_had_incorrect_sol","recaptcha_nothad_incorrect_sol",A.is_incorrect);Recaptcha._css_toggle("recaptcha_is_showing_audio","recaptcha_isnot_showing_audio",C=="audio");B._clear_input();if(B.should_focus){B.focus_response_field()}B._reset_timer()},_reset_timer:function(){var A=RecaptchaState;clearInterval(Recaptcha.timer_id);Recaptcha.timer_id=setInterval("Recaptcha.reload('t');",(A.timeout-60*5)*1000)},showhelp:function(){window.open(Recaptcha._get_help_link(),"recaptcha_popup","width=460,height=570,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes")},_clear_input:function(){var A=Recaptcha.$("recaptcha_response_field");A.value=""},_displayerror:function(B){var A=Recaptcha.$;A("recaptcha_image").innerHTML="";A("recaptcha_image").appendChild(document.createTextNode(B))},reloaderror:function(A){Recaptcha._displayerror(A)},_is_ie:function(){return(navigator.userAgent.indexOf("MSIE")>0)&&!window.opera},_css_toggle:function(A,B,F){var C=Recaptcha.widget;if(!C){C=document.body}var E=C.className;E=E.replace(new RegExp("(^|\\s+)"+A+"(\\s+|$)")," ");E=E.replace(new RegExp("(^|\\s+)"+B+"(\\s+|$)")," ");E+=" "+(F?A:B);C.className=E},_get_help_link:function(){var A=RecaptchaOptions.lang;return"http://recaptcha.net/popuphelp/"+(A=="en"?"":(A+".html"))},playAgain:function(){var A=Recaptcha.$;A("recaptcha_image").innerHTML=Recaptcha.getAudioCaptchaHtml()},getAudioCaptchaHtml:function(){var C=Recaptcha;var B=RecaptchaState;var G=Recaptcha.$;var F=B.server+"image?c="+B.challenge;if(F.indexOf("https://")==0){F="http://"+F.substring(8)}var H=B.server+"/img/audiocaptcha.swf?v2";var A;if(C._is_ie()){A='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="audiocaptcha" width="0" height="0" codebase="https://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param name="movie" value="'+H+'" /><param name="quality" value="high" /><param name="bgcolor" value="#869ca7" /><param name="allowScriptAccess" value="always" /></object><br/>'}else{A='<embed src="'+H+'" quality="high" bgcolor="#869ca7" width="0" height="0" name="audiocaptcha" align="middle" play="true" loop="false" quality="high" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed> '}var E=(Recaptcha.checkFlashVer()?'<br/><a class="recaptcha_audio_cant_hear_link" href="#" onclick="Recaptcha.playAgain(); return false;">'+RecaptchaStr.play_again+"</a>":"")+'<br/><a class="recaptcha_audio_cant_hear_link" target="_blank" href="'+F+'">'+RecaptchaStr.cant_hear_this+"</a>";return A+E},gethttpwavurl:function(){var A=RecaptchaState;if(Recaptcha.type=="audio"){var B=A.server+"image?c="+A.challenge;if(B.indexOf("https://")==0){B="http://"+B.substring(8)}return B}return""},checkFlashVer:function(){var B=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var G=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var A=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;var E=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var J=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var K=navigator.plugins["Shockwave Flash"+J].description;var C=K.split(" ");var F=C[2].split(".");E=F[0]}}else{if(B&&G&&!A){try{var H=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");var L=H.GetVariable("$version");E=L.split(" ")[1].split(",")[0]}catch(I){}}}return E>=9},getlang:function(){return RecaptchaOptions.lang}};Ext.ns("Ext.ux");Ext.ux.Recaptcha=Ext.extend(Ext.BoxComponent,{publickey:"6LcYEwYAAAAAALR5ld3mUrpPn7bTk2JSOBoFnO3L",theme:"white",onRender:function(B,A){if(!this.el){this.el=document.createElement("div");this.el.id=this.getId();Recaptcha.create(this.publickey,this.el,{theme:this.theme})}Ext.ux.Recaptcha.superclass.onRender.call(this,B,A)}});Ext.reg("recaptcha",Ext.ux.Recaptcha);Ext.ns("Ext.ux");Ext.ux.Button=Ext.extend(Ext.Button,{initComponent:function(){Ext.Button.superclass.initComponent.call(this);this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout");if(this.menu){var A=this.menu;delete this.menu;this.setMenu(A)}if(typeof this.toggleGroup==="string"){this.enableToggle=true}},setMenu:function(B){var A=(this.menu!=null);this.menu=Ext.menu.MenuMgr.get(B);if(this.rendered&&!A){this.el.child(this.menuClassTarget).addClass("x-btn-with-menu");this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this)}},clearMenu:function(A){if(this.rendered){this.el.child(this.menuClassTarget).removeClass("x-btn-with-menu");this.menu.un("show",this.onMenuShow,this);this.menu.un("hide",this.onMenuHide,this)}if(A){Ext.destroy(this.menu)}this.menu=null},setTooltip:function(B){var A=this.el.child(this.buttonSelector);if(B){if(typeof B=="object"){Ext.QuickTips.register(Ext.apply({target:A.id},B))}else{A.dom[this.tooltipType]=B}}this.tooltip=B},onDisable:function(){Ext.ux.Button.superclass.onDisable.apply(this,arguments);var A=this.el.child(this.buttonSelector);if(this.toolTip){if(typeof this.toolTip=="object"){Ext.QuickTips.unregister(A.id)}else{A.dom[this.tooltipType]=null}}},onEnable:function(){Ext.ux.Button.superclass.onEnable.apply(this,arguments);if(this.tooltip){this.setToolTip(this.tooltip)}}});Ext.reg("uxbutton",Ext.ux.Button);Ext.namespace("Ext.ux.dd");Ext.ux.dd.PrevDragSource=function(C,B,A){this.data=C;this.el=B;Ext.ux.dd.PrevDragSource.superclass.constructor.call(this,B,A)};Ext.extend(Ext.ux.dd.PrevDragSource,Ext.dd.DragSource,{getDragData:function(C){var B=C.getTarget(".thumb-wrap");var A={};A.ddel=B;A.data=Ext.ux.clone(this.data);return A},afterRepair:function(){Ext.fly(this.el).frame("#8db2e3",1);this.dragging=false},getRepairXY:function(B){var A=Ext.Element.fly(this.dragData.ddel).getXY();A[0]+=10;A[1]+=10;return A}});Ext.ux.dd.ProdDragZone=function(A,B){this.view=A;Ext.ux.dd.ProdDragZone.superclass.constructor.call(this,A.getEl(),B)};Ext.extend(Ext.ux.dd.ProdDragZone,Ext.dd.DragZone,{getDragData:function(H){var G=H.getTarget(".product-thumbs");if(G){var C=this.view;if(!C.isSelected(G)){C.onClick(H)}var B=C.getSelectedNodes();var F={nodes:B};if(B.length==1){F.ddel=G;F.data=Ext.ux.clone(this.view.getSelectedRecords()[0].data)}else{var I=document.createElement("div");I.className="multi-proxy";for(var E=0,A=B.length;E<A;E++){I.appendChild(B[E].firstChild.firstChild.cloneNode(true));if((E+1)%3==0){I.appendChild(document.createElement("br"))}}F.ddel=I;F.multi=true}return F}return false},afterRepair:function(){for(var B=0,A=this.dragData.nodes.length;B<A;B++){Ext.fly(this.dragData.nodes[B]).frame("#8db2e3",1)}this.dragging=false},getRepairXY:function(B){if(!this.dragData.multi){var A=Ext.Element.fly(this.dragData.ddel).getXY();A[0]+=3;A[1]+=3;return A}return false}});Ext.ux.UploadPanel=Ext.extend(Ext.Panel,{addIconCls:"icon-plus",addText:"Add",bodyStyle:"padding:2px",buttonsAt:"tbar",clickRemoveText:"Click to remove",clickStopText:"Click to stop",emptyText:"No files",enableProgress:true,errorText:"Error",fileCls:"file",fileQueuedText:"File <b>{0}</b> is queued for upload",fileDoneText:"File <b>{0}</b> has been successfully uploaded",fileFailedText:"File <b>{0}</b> failed to upload",fileStoppedText:"File <b>{0}</b> stopped by user",fileUploadingText:"Uploading file <b>{0}</b>",maxFileSize:524288,maxLength:18,removeAllIconCls:"icon-cross",removeAllText:"Remove All",removeIconCls:"icon-minus",removeText:"Remove",selectedClass:"ux-up-item-selected",singleUpload:false,stopAllText:"Stop All",stopIconCls:"icon-stop",uploadText:"Upload",uploadIconCls:"icon-upload",workingIconCls:"icon-working",initComponent:function(){var E={xtype:"browsebutton",text:this.addText,iconCls:this.addIconCls,scope:this,handler:this.onAddFile};var B={xtype:"button",iconCls:this.uploadIconCls,text:this.uploadText,scope:this,handler:this.onUpload,disabled:true};var F={xtype:"button",iconCls:this.removeAllIconCls,tooltip:this.removeAllText,scope:this,handler:this.onRemoveAllClick,disabled:true};if("body"!==this.buttonsAt){this[this.buttonsAt]=[E,B,"->",F]}var A=[{name:"id",type:"text",system:true},{name:"shortName",type:"text",system:true},{name:"fileName",type:"text",system:true},{name:"filePath",type:"text",system:true},{name:"fileCls",type:"text",system:true},{name:"input",system:true},{name:"form",system:true},{name:"state",type:"text",system:true},{name:"error",type:"text",system:true},{name:"progressId",type:"int",system:true},{name:"bytesTotal",type:"int",system:true},{name:"bytesUploaded",type:"int",system:true},{name:"estSec",type:"int",system:true},{name:"filesUploaded",type:"int",system:true},{name:"speedAverage",type:"int",system:true},{name:"speedLast",type:"int",system:true},{name:"timeLast",type:"int",system:true},{name:"timeStart",type:"int",system:true},{name:"pctComplete",type:"int",system:true}];if(Ext.isArray(this.customFields)){A.push(this.customFields)}this.store=new Ext.data.SimpleStore({id:0,fields:A,data:[]});Ext.apply(this,{items:[{xtype:"dataview",itemSelector:"div.ux-up-item",store:this.store,selectedClass:this.selectedClass,singleSelect:true,emptyText:this.emptyText,tpl:this.tpl||new Ext.XTemplate('<tpl for="."><div class="ux-up-item"><div class="ux-up-icon-file {fileCls}">&#160;</div><div class="ux-up-text x-unselectable" qtip="{fileName}">{shortName}</div><div id="remove-{[values.input.id]}" class="ux-up-icon-state ux-up-icon-{state}"qtip="{[this.scope.getQtip(values)]}">&#160;</div></div></tpl>',{scope:this}),listeners:{click:{scope:this,fn:this.onViewClick}}}]});Ext.ux.UploadPanel.superclass.initComponent.apply(this,arguments);this.view=this.items.itemAt(0);this.addEvents("beforefileadd","fileadd","beforefileremove","fileremove","beforequeueclear","queueclear","beforeupload");this.relayEvents(this.view,["beforeclick","beforeselect","click","containerclick","contextmenu","dblclick","selectionchange"]);var C={store:this.store,singleUpload:this.singleUpload,maxFileSize:this.maxFileSize,enableProgress:this.enableProgress,url:this.url,path:this.path};if(this.baseParams){C.baseParams=this.baseParams}this.uploader=new Ext.ux.FileUploader(C);this.relayEvents(this.uploader,["beforeallstart","allfinished","progress"]);this.on({beforeallstart:{scope:this,fn:function(){this.uploading=true;this.updateButtons()}},allfinished:{scope:this,fn:function(){this.uploading=false;this.updateButtons();if(this.allFinishedFn){this.allFinishedFn(this.scope)}}},progress:{fn:this.onProgress.createDelegate(this)}})},onRender:function(){Ext.ux.UploadPanel.superclass.onRender.apply(this,arguments);var A="tbar"===this.buttonsAt?this.getTopToolbar():this.getBottomToolbar();this.addBtn=Ext.getCmp(A.items.first().id);this.uploadBtn=Ext.getCmp(A.items.itemAt(1).id);this.removeAllBtn=Ext.getCmp(A.items.last().id)},getQtip:function(A){var B="";switch(A.state){case"queued":B=String.format(this.fileQueuedText,A.fileName);B+="<br>"+this.clickRemoveText;break;case"uploading":B=String.format(this.fileUploadingText,A.fileName);B+="<br>"+A.pctComplete+"% done";B+="<br>"+this.clickStopText;break;case"done":B=String.format(this.fileDoneText,A.fileName);B+="<br>"+this.clickRemoveText;break;case"failed":B=String.format(this.fileFailedText,A.fileName);B+="<br>"+this.errorText+":"+A.error;B+="<br>"+this.clickRemoveText;break;case"stopped":B=String.format(this.fileStoppedText,A.fileName);B+="<br>"+this.clickRemoveText;break}return B},getFileName:function(A){return A.getValue().split(/[\/\\]/).pop()},getFilePath:function(A){return A.getValue().replace(/[^\/\\]+$/,"")},getFileCls:function(A){var B=A.split(".");if(1===B.length){return this.fileCls}else{return this.fileCls+"-"+B.pop().toLowerCase()}},onAddFile:function(C){if(true!==this.eventsSuspended&&false===this.fireEvent("beforefileadd",this,C.getInputFile())){return }var A=C.detachInputFile();A.addClass("x-hidden");var E=this.getFileName(A);var B=new this.store.recordType({input:A,fileName:E,filePath:this.getFilePath(A),shortName:Ext.util.Format.ellipsis(E,this.maxLength),fileCls:this.getFileCls(E),state:"queued"},A.id);B.commit();this.store.add(B);this.syncShadow();this.uploadBtn.enable();this.removeAllBtn.enable();if(true!==this.eventsSuspended){this.fireEvent("fileadd",this,this.store,B)}},onDestroy:function(){if(this.uploader){this.uploader.stopAll();this.uploader.purgeListeners();this.uploader=null}if(this.view){this.view.purgeListeners();this.view.destroy();this.view=null}if(this.store){this.store.purgeListeners();this.store.destroy();this.store=null}},onProgress:function(I,G,H){var F,E,J,A,K,L,B,C;if(H){A=H.get("state");F=H.get("bytesTotal")||1;E=H.get("bytesUploaded")||0;if("uploading"===A){J=Math.round(1000*E/F)/10}else{if("done"===A){J=100}else{J=0}}H.set("pctComplete",J);K=this.store.indexOf(H);L=Ext.get(this.view.getNode(K));if(L){B=L.getWidth();L.applyStyles({"background-position":B*J/100+"px"})}}},onRemoveFile:function(A){if(true!==this.eventsSuspended&&false===this.fireEvent("beforefileremove",this,this.store,A)){return }var E=A.get("input");var B=E.up("em");E.remove();if(B){B.remove()}this.store.remove(A);var C=this.store.getCount();this.uploadBtn.setDisabled(!C);this.removeAllBtn.setDisabled(!C);if(true!==this.eventsSuspended){this.fireEvent("fileremove",this,this.store);this.syncShadow()}},onRemoveAllClick:function(A){if(true===this.uploading){this.stopAll()}else{this.removeAll()}},stopAll:function(){this.uploader.stopAll()},onViewClick:function(A,B,E,F){var C=F.getTarget("div:any(.ux-up-icon-queued|.ux-up-icon-failed|.ux-up-icon-done|.ux-up-icon-stopped)");if(C){this.onRemoveFile(this.store.getAt(B))}C=F.getTarget("div.ux-up-icon-uploading");if(C){this.uploader.stopUpload(this.store.getAt(B))}},onUpload:function(){if(true!==this.eventsSuspended&&false===this.fireEvent("beforeupload",this)){return false}this.uploader.upload()},setUrl:function(A){this.url=A;this.uploader.setUrl(A)},setPath:function(A){this.uploader.setPath(A)},updateButtons:function(){if(true===this.uploading){this.addBtn.disable();this.uploadBtn.disable();this.removeAllBtn.setIconClass(this.stopIconCls);this.removeAllBtn.getEl().child(this.removeAllBtn.buttonSelector).dom[this.removeAllBtn.tooltipType]=this.stopAllText}else{this.addBtn.enable();this.uploadBtn.enable();this.removeAllBtn.setIconClass(this.removeAllIconCls);this.removeAllBtn.getEl().child(this.removeAllBtn.buttonSelector).dom[this.removeAllBtn.tooltipType]=this.removeAllText}},removeAll:function(){var A=this.eventsSuspended;if(false!==this.eventsSuspended&&false===this.fireEvent("beforequeueclear",this,this.store)){return false}this.suspendEvents();this.store.each(this.onRemoveFile,this);this.eventsSuspended=A;if(true!==this.eventsSuspended){this.fireEvent("queueclear",this,this.store)}this.syncShadow()},syncShadow:function(){if(this.contextmenu&&this.contextmenu.shadow){this.contextmenu.getEl().shadow.show(this.contextmenu.getEl())}}});Ext.reg("uploadpanel",Ext.ux.UploadPanel);Ext.ux.FileUploader=function(A){Ext.apply(this,A);Ext.ux.FileUploader.superclass.constructor.apply(this,arguments);this.addEvents("beforeallstart","allfinished","beforefilestart","filefinished","progress")};Ext.extend(Ext.ux.FileUploader,Ext.util.Observable,{baseParams:{cmd:"upload",dir:"."},concurrent:true,enableProgress:true,jsonErrorText:"Cannot decode JSON object",maxFileSize:524288,progressIdName:"UPLOAD_IDENTIFIER",progressInterval:2000,progressUrl:"progress.php",progressMap:{bytes_total:"bytesTotal",bytes_uploaded:"bytesUploaded",est_sec:"estSec",files_uploaded:"filesUploaded",speed_average:"speedAverage",speed_last:"speedLast",time_last:"timeLast",time_start:"timeStart"},singleUpload:false,unknownErrorText:"Unknown error",upCount:0,createForm:function(A){var C=parseInt(Math.random()*10000000000,10);var B=Ext.getBody().createChild({tag:"form",action:this.url,method:"post",cls:"x-hidden",id:Ext.id(),cn:[{tag:"input",type:"hidden",name:"APC_UPLOAD_PROGRESS",value:C},{tag:"input",type:"hidden",name:this.progressIdName,value:C},{tag:"input",type:"hidden",name:"MAX_FILE_SIZE",value:this.maxFileSize}]});if(A){A.set("form",B);A.set("progressId",C)}else{this.progressId=C}return B},deleteForm:function(B,A){B.remove();if(A){A.set("form",null)}},fireFinishEvents:function(A){if(true!==this.eventsSuspended&&!this.singleUpload){this.fireEvent("filefinished",this,A&&A.record)}if(true!==this.eventsSuspended&&0===this.upCount){this.stopProgress();this.fireEvent("allfinished",this)}},getIframe:function(A){var B=null;var C=A.get("form");if(C&&C.dom&&C.dom.target){B=Ext.get(C.dom.target)}return B},getOptions:function(A,C){var B={url:this.url,method:"post",isUpload:true,scope:this,callback:this.uploadCallback,record:A,params:this.getParams(A,C)};return B},getParams:function(A,C){return this.baseParams;var B={path:this.path};Ext.apply(B,this.baseParams||{},C||{});return B},processSuccess:function(C,B,E){var A=false;if(this.singleUpload){this.store.each(function(F){F.set("state","done");F.set("error","");F.commit()})}else{A=C.record;A.set("state","done");A.set("error","");A.commit()}this.deleteForm(C.form,A)},processFailure:function(F,C,E){var A=F.record;var B;if(this.singleUpload){B=this.store.queryBy(function(G){var H=G.get("state");return"done"!==H&&"uploading"!==H});B.each(function(G){var H=E.errors?E.errors[G.id]:this.unknownErrorText;if(H){G.set("state","failed");G.set("error",H);Ext.getBody().appendChild(G.get("input"))}else{G.set("state","done");G.set("error","")}G.commit()},this);this.deleteForm(F.form)}else{if(E&&"object"===Ext.type(E)){A.set("error",E.errors&&E.errors[A.id]?E.errors[A.id]:this.unknownErrorText)}else{if(E){A.set("error",E)}else{if(C&&C.responseText){A.set("error",C.responseText)}else{A.set("error",this.unknownErrorText)}}}A.set("state","failed");A.commit()}},requestProgress:function(){var A,B;var C={url:this.progressUrl,method:"post",params:{},scope:this,callback:function(F,I,E){var H;if(true!==I){return }try{H=Ext.decode(E.responseText)}catch(G){return }if("object"!==Ext.type(H)||true!==H.data.success){return }if(this.singleUpload){this.progress={};for(B in H){if(this.progressMap[B]){this.progress[this.progressMap[B]]=parseInt(H[B],10)}}if(true!==this.eventsSuspended){this.fireEvent("progress",this,this.progress)}}else{for(B in H){if(this.progressMap[B]&&F.record){F.record.set(this.progressMap[B],parseInt(H[B],10))}}if(F.record){F.record.commit();if(true!==this.eventsSuspended){this.fireEvent("progress",this,F.record.data,F.record)}}}this.progressTask.delay(this.progressInterval)}};if(this.singleUpload){C.params[this.progressIdName]=this.progressId;C.params.APC_UPLOAD_PROGRESS=this.progressId;Ext.Ajax.request(C)}else{A=this.store.query("state","uploading");A.each(function(E){C.params[this.progressIdName]=E.get("progressId");C.params.APC_UPLOAD_PROGRESS=C.params[this.progressIdName];C.record=E;(function(){Ext.Ajax.request(C)}).defer(250)},this)}},setPath:function(A){this.path=A},setUrl:function(A){this.url=A},startProgress:function(){if(!this.progressTask){this.progressTask=new Ext.util.DelayedTask(this.requestProgress,this)}this.progressTask.delay.defer(this.progressInterval/2,this.progressTask,[this.progressInterval])},stopProgress:function(){if(this.progressTask){this.progressTask.cancel()}},stopAll:function(){var A=this.store.query("state","uploading");A.each(this.stopUpload,this)},stopUpload:function(A){var B=false;if(A){B=this.getIframe(A);this.stopIframe(B);this.upCount--;this.upCount=0>this.upCount?0:this.upCount;A.set("state","stopped");this.fireFinishEvents({record:A})}else{if(this.form){B=Ext.fly(this.form.dom.target);this.stopIframe(B);this.upCount=0;this.fireFinishEvents()}}},stopIframe:function(A){if(A){try{A.dom.contentWindow.stop();A.remove.defer(250,A)}catch(B){}}},upload:function(){var A=this.store.queryBy(function(B){return"done"!==B.get("state")});if(!A.getCount()){return }if(true!==this.eventsSuspended&&false===this.fireEvent("beforeallstart",this)){return }if(this.singleUpload){this.uploadSingle()}else{A.each(this.uploadFile,this)}if(true===this.enableProgress){this.startProgress()}},uploadCallback:function(B,F,A){var E;this.upCount--;this.form=false;if(true===F){try{E=Ext.decode(A.responseText)}catch(C){this.processFailure(B,A,this.jsonErrorText);this.fireFinishEvents(B);return }if(true===E.data.success){this.processSuccess(B,A,E)}else{this.processFailure(B,A,E)}}else{this.processFailure(B,A)}this.fireFinishEvents(B)},uploadFile:function(A,F){if(true!==this.eventsSuspended&&false===this.fireEvent("beforefilestart",this,A)){return }var C=this.createForm(A);var B=A.get("input");B.set({name:B.id});C.appendChild(B);var E=this.getOptions(A,F);E.form=C;A.set("state","uploading");A.set("pctComplete",0);this.upCount++;Ext.Ajax.request(E);this.getIframe.defer(100,this,[A])},uploadSingle:function(){var A=this.store.queryBy(function(E){return"done"!==E.get("state")});if(!A.getCount()){return }var B=this.createForm();A.each(function(E){var F=E.get("input");F.set({name:F.id});B.appendChild(F);E.set("state","uploading")},this);var C=this.getOptions();C.form=B;this.form=B;this.upCount++;Ext.Ajax.request(C)}});Ext.reg("fileuploader",Ext.ux.FileUploader);Ext.namespace("Ext.ux.form");Ext.ux.form.BrowseButton=Ext.extend(Ext.Button,{inputFileName:"file",debug:false,FLOAT_EL_WIDTH:60,FLOAT_EL_HEIGHT:18,buttonCt:null,clipEl:null,floatEl:null,inputFileEl:null,originalHandler:null,originalScope:null,initComponent:function(){Ext.ux.form.BrowseButton.superclass.initComponent.call(this);this.originalHandler=this.handler;this.originalScope=this.scope;this.handler=null;this.scope=null},onRender:function(E,B){Ext.ux.form.BrowseButton.superclass.onRender.call(this,E,B);this.buttonCt=this.el.child(".x-btn-center em");this.buttonCt.position("relative");var C={position:"absolute",overflow:"hidden",top:"0px",left:"0px"};if(Ext.isIE){Ext.apply(C,{left:"-3px",top:"-3px"})}else{if(Ext.isGecko){Ext.apply(C,{left:"-3px",top:"-3px"})}else{if(Ext.isSafari){Ext.apply(C,{left:"-4px",top:"-2px"})}}}this.clipEl=this.buttonCt.createChild({tag:"div",style:C});this.setClipSize();this.clipEl.on({mousemove:this.onButtonMouseMove,mouseover:this.onButtonMouseMove,scope:this});this.floatEl=this.clipEl.createChild({tag:"div",style:{position:"absolute",width:this.FLOAT_EL_WIDTH+"px",height:this.FLOAT_EL_HEIGHT+"px",overflow:"hidden"}});if(this.debug){this.clipEl.applyStyles({"background-color":"green"});this.floatEl.applyStyles({"background-color":"red"})}else{this.clipEl.setOpacity(0)}var A=this.el.child(this.buttonSelector);A.on("focus",this.onButtonFocus,this);if(Ext.isIE){this.el.on("keydown",this.onButtonKeyDown,this)}this.createInputFile()},setClipSize:function(){if(this.clipEl){var B=this.buttonCt.getWidth();var A=this.buttonCt.getHeight();if(B===0||A===0){this.setClipSize.defer(100,this)}else{if(Ext.isIE){B=B+5;A=A+5}else{if(Ext.isGecko){B=B+6;A=A+6}else{if(Ext.isSafari){B=B+6;A=A+6}}}this.clipEl.setSize(B,A)}}},createInputFile:function(){this.floatEl.select("em").each(function(A){A.remove()});this.inputFileEl=this.floatEl.createChild({tag:"input",type:"file",size:1,name:this.inputFileName||Ext.id(this.el),tabindex:this.tabIndex,style:{position:"absolute",cursor:"pointer",right:"0px",top:"0px"}});this.inputFileEl=this.inputFileEl.child("input")||this.inputFileEl;this.inputFileEl.on({click:this.onInputFileClick,change:this.onInputFileChange,focus:this.onInputFileFocus,select:this.onInputFileFocus,blur:this.onInputFileBlur,scope:this});if(this.tooltip){if(typeof this.tooltip=="object"){Ext.QuickTips.register(Ext.apply({target:this.inputFileEl},this.tooltip))}else{this.inputFileEl.dom[this.tooltipType]=this.tooltip}}},onButtonFocus:function(A){if(this.inputFileEl){this.inputFileEl.focus();A.stopEvent()}},onButtonKeyDown:function(A){if(this.inputFileEl&&A.getKey()==Ext.EventObject.SPACE){this.inputFileEl.dom.click();A.stopEvent()}},onButtonMouseMove:function(B){var A=B.getXY();A[0]-=this.FLOAT_EL_WIDTH/2;A[1]-=this.FLOAT_EL_HEIGHT/2;this.floatEl.setXY(A)},onInputFileFocus:function(A){if(!this.isDisabled){this.el.addClass("x-btn-over")}},onInputFileBlur:function(A){this.el.removeClass("x-btn-over")},onInputFileClick:function(A){A.stopPropagation()},onInputFileChange:function(){if(this.originalHandler){this.originalHandler.call(this.originalScope,this)}},detachInputFile:function(B){var A=this.inputFileEl;if(typeof this.tooltip=="object"){Ext.QuickTips.unregister(this.inputFileEl)}else{this.inputFileEl.dom[this.tooltipType]=null}this.inputFileEl.removeAllListeners();this.inputFileEl=null;if(!B){this.createInputFile()}return A},getInputFile:function(){return this.inputFileEl},disable:function(){Ext.ux.form.BrowseButton.superclass.disable.call(this);this.inputFileEl.dom.disabled=true},enable:function(){Ext.ux.form.BrowseButton.superclass.enable.call(this);this.inputFileEl.dom.disabled=false}});Ext.reg("browsebutton",Ext.ux.form.BrowseButton);Ext.namespace("Ext.ux");Ext.ux.GMapPanel=Ext.extend(Ext.Panel,{respErrors:[{code:400,msg:"A directions request could not be successfully parsed. For example, the request may have been rejected if it contained more than the maximum number of waypoints allowed."},{code:G_GEO_SERVER_ERROR,msg:"A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known."},{code:601,msg:"The HTTP q parameter was either missing or had no value. For geocoding requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input."},{code:G_GEO_MISSING_ADDRESS,msg:"Synonym for G_GEO_MISSING_QUERY."},{code:G_GEO_UNKNOWN_ADDRESS,msg:"No corresponding geographic location could be found for the specified address. This may be due to the fact that the address is relatively new, or it may be incorrect."},{code:G_GEO_UNAVAILABLE_ADDRESS,msg:"The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons."},{code:604,msg:"The GDirections object could not compute directions between the points mentioned in the query. This is usually because there is no route available between the two points, or because we do not have data for routing in that region."},{code:G_GEO_BAD_KEY,msg:"The given key is either invalid or does not match the domain for which it was given."},{code:G_GEO_TOO_MANY_QUERIES,msg:"The given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time. If you're sending multiple requests in parallel or in a tight loop, use a timer or pause in your code to make sure you don't send the requests too quickly."}],respErrorTitle:"Error",geoErrorMsgUnable:"Unable to Locate the Address you provided",geoErrorTitle:"Address Location Error",geoErrorMsgAccuracy:"The address provided has a low accuracy.<br><br>Level {0} Accuracy (8 = Exact Match, 1 = Vague Match)",initComponent:function(){var A={plain:true,zoomLevel:0,yaw:180,pitch:0,gmapType:"map",border:false,displayGeoErrors:false,minGeoAccuracy:7,mapDefined:false,mapDefinedGMap:false,icon:new GIcon(G_DEFAULT_ICON)};Ext.applyIf(this,A);Ext.ux.GMapPanel.superclass.initComponent.call(this)},afterRender:function(){var B=this.ownerCt.getSize();Ext.applyIf(this,B);Ext.ux.GMapPanel.superclass.afterRender.call(this);if(this.gmapType==="map"){this.gmap=new GMap2(this.body.dom);this.mapDefined=true;this.mapDefinedGMap=true}if(this.gmapType==="panorama"){this.gmap=new GStreetviewPanorama(this.body.dom);this.mapDefined=true}if(!this.mapDefined&&this.gmapType){this.gmap=new GMap2(this.body.dom);this.gmap.setMapType(this.gmapType);this.mapDefined=true;this.mapDefinedGMap=true}GEvent.bind(this.getMap(),"load",this,this.onMapReady);if(typeof this.setCenter==="object"){if(typeof this.setCenter.geoCodeAddr==="string"){this.geoCodeLookup(this.setCenter.geoCodeAddr,this.setCenter.marker,false,true,this.setCenter.listeners)}else{if(this.gmapType==="map"){var A=this.fixLatLng(new GLatLng(this.setCenter.lat,this.setCenter.lng));this.getMap().setCenter(A,this.zoomLevel)}if(typeof this.setCenter.marker==="object"&&typeof A==="object"){this.addMarker(A,this.setCenter.marker,this.setCenter.marker.clear)}}if(this.gmapType==="panorama"){this.getMap().setLocationAndPOV(new GLatLng(this.setCenter.lat,this.setCenter.lng),{yaw:this.yaw,pitch:this.pitch,zoom:this.zoomLevel})}}},onMapReady:function(){this.addMapControls();this.addOptions();this.addMarkers(this.markers);this.addKMLOverlay(this.autoLoadKML)},onResize:function(A,B){if(typeof this.getMap()=="object"){this.getMap().checkResize()}Ext.ux.GMapPanel.superclass.onResize.call(this,A,B)},setSize:function(C,A,B){if(typeof this.getMap()=="object"){this.getMap().checkResize()}Ext.ux.GMapPanel.superclass.setSize.call(this,C,A,B)},getMap:function(){return this.gmap},getCenter:function(){return this.fixLatLng(this.getMap().getCenter())},getCenterLatLng:function(){var A=this.getCenter();return{lat:A.lat(),lng:A.lng()}},addMarkers:function(E){var C=[];if(Ext.isArray(E)){for(var B=0;B<E.length;B++){if(typeof E[B].geoCodeAddr=="string"){this.geoCodeLookup(E[B].geoCodeAddr,E[B].marker,false,E[B].setCenter,E[B].listeners)}else{var A=this.fixLatLng(new GLatLng(E[B].lat,E[B].lng));C[B]=this.addMarker(A,E[B].marker,false,E[B].setCenter,E[B].listeners)}}}return C},addMarker:function(C,E,B,A,F){if(B===true){this.getMap().clearOverlays()}if(A===true){this.getMap().setCenter(C,this.zoomLevel)}var G=new GMarker(C,{icon:this.icon,title:E.title});GEvent.addListener(G,"click",GEvent.callbackArgs(this.scope,this.scope.onClick,C,G,E));GEvent.addListener(G,"mouseover",GEvent.callbackArgs(this.scope,this.scope.onMouseover,G,E));GEvent.addListener(G,"mouseout",GEvent.callbackArgs(this.scope,this.scope.onMouseout,G,E));if(0&&E.street){GEvent.addListener(G,"click",function(){if(GBrowserIsCompatible()){var I=document.createElement("div");I.style.textAlign="left";I.style.width="400px";I.style.height="230px";I.innerHTML=E.html;var H=document.createElement("div");H.style.textAlign="center";H.style.width="400px";H.style.height="200px";H.innerHTML="Street View Not Available";panorama=new GStreetviewPanorama(H);panorama.setLocationAndPOV(C,null);I.appendChild(H);G.openInfoWindow(I)}})}this.getMap().addOverlay(G);return G},addMapControls:function(){if(this.gmapType==="map"){if(Ext.isArray(this.mapControls)){for(i=0;i<this.mapControls.length;i++){this.addMapControl(this.mapControls[i])}}else{if(typeof this.mapControls==="string"){this.addMapControl(this.mapControls)}else{if(typeof this.mapControls==="object"){this.getMap().addControl(this.mapControls)}}}}},addMapControl:function(B){var A=window[B];if(typeof A==="function"){this.getMap().addControl(new A())}},addOptions:function(){if(Ext.isArray(this.mapConfOpts)){var A;for(i=0;i<this.mapConfOpts.length;i++){this.addOption(this.mapConfOpts[i])}}else{if(typeof this.mapConfOpts==="string"){this.addOption(this.mapConfOpts)}}},addOption:function(B){var A=this.getMap()[B];if(typeof A==="function"){this.getMap()[B]()}},addKMLOverlay:function(A){if(typeof A==="string"&&A!==""){var B=new GGeoXml(A);this.getMap().addOverlay(B)}},geoCodeLookup:function(F,C,B,A,E){if(!this.geocoder){this.geocoder=new GClientGeocoder()}this.geocoder.getLocations(F,this.addAddressToMap.createDelegate(this,[F,C,B,A,E],true))},addAddressToMap:function(E,G,C,B,A,F){if(!E||E.Status.code!=200){this.respErrorMsg(E.Status.code)}else{place=E.Placemark[0];addressinfo=place.AddressDetails;accuracy=addressinfo.Accuracy;if(accuracy===0){this.geoErrorMsg(this.geoErrorTitle,this.geoErrorMsgUnable)}else{if(accuracy<this.minGeoAccuracy){this.geoErrorMsg(this.geoErrorTitle,String.format(this.geoErrorMsgAccuracy,accuracy))}else{point=this.fixLatLng(new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]));if(A){this.getMap().setCenter(point,this.zoomLevel)}if(typeof C==="object"){if(!C.title){C.title=place.address}this.addMarker(point,C,B,false,F)}}}}},geoErrorMsg:function(B,A){if(this.displayGeoErrors){Ext.MessageBox.alert(B,A)}},respErrorMsg:function(A){Ext.each(this.respErrors,function(B){if(A==B.code){Ext.MessageBox.alert(this.respErrorTitle,B.msg)}},this)},fixLatLng:function(A){if(this.getMap().getCurrentMapType()){if(this.getMap().getCurrentMapType().QO=="visible"){A.lat(180-A.lat());A.lng(180-A.lng())}}return A}});Ext.reg("gmappanel",Ext.ux.GMapPanel);var MapIconMaker={};MapIconMaker.createMarkerIcon=function(A){var E=A.width||32;var J=A.height||32;var F=A.primaryColor||"#ff0000";var K=A.strokeColor||"#000000";var C=A.cornerColor||"#ffffff";var H="http://chart.apis.google.com/chart?cht=mm";var B=H+"&chs="+E+"x"+J+"&chco="+C.replace("#","")+","+F.replace("#","")+","+K.replace("#","")+"&ext=.png";var I=new GIcon(G_DEFAULT_ICON);I.image=B;I.iconSize=new GSize(E,J);I.shadowSize=new GSize(Math.floor(E*1.6),J);I.iconAnchor=new GPoint(E/2,J);I.infoWindowAnchor=new GPoint(E/2,Math.floor(J/12));I.printImage=B+"&chof=gif";I.mozPrintImage=B+"&chf=bg,s,ECECD8&chof=gif";B=H+"&chs="+E+"x"+J+"&chco="+C.replace("#","")+","+F.replace("#","")+","+K.replace("#","");I.transparent=B+"&chf=a,s,ffffff11&ext=.png";I.imageMap=[E/2,J,(7/16)*E,(5/8)*J,(5/16)*E,(7/16)*J,(7/32)*E,(5/16)*J,(5/16)*E,(1/8)*J,(1/2)*E,0,(11/16)*E,(1/8)*J,(25/32)*E,(5/16)*J,(11/16)*E,(7/16)*J,(9/16)*E,(5/8)*J];for(var G=0;G<I.imageMap.length;G++){I.imageMap[G]=parseInt(I.imageMap[G])}return I};MapIconMaker.createFlatIcon=function(K){var N=K.width||32;var L=K.height||32;var R=K.primaryColor||"#ff0000";var M=K.shadowColor||"#000000";var I=MapIconMaker.escapeUserText_(K.label)||"";var T=K.labelColor||"#000000";var J=K.labelSize||0;var B=K.shape||"circle";var P=(B==="circle")?"it":"itr";var A="http://chart.apis.google.com/chart?cht="+P;var H=A+"&chs="+N+"x"+L+"&chco="+R.replace("#","")+","+M.replace("#","")+"ff,ffffff01&chl="+I+"&chx="+T.replace("#","")+","+J;var Q=new GIcon(G_DEFAULT_ICON);Q.image=H+"&chf=bg,s,00000000&ext=.png";Q.iconSize=new GSize(N,L);Q.shadowSize=new GSize(0,0);Q.iconAnchor=new GPoint(N/2,L/2);Q.infoWindowAnchor=new GPoint(N/2,L/2);Q.printImage=H+"&chof=gif";Q.mozPrintImage=H+"&chf=bg,s,ECECD8&chof=gif";Q.transparent=H+"&chf=a,s,ffffff01&ext=.png";Q.imageMap=[];if(P==="itr"){Q.imageMap=[0,0,N,0,N,L,0,L]}else{var G=8;var C=360/G;var U=Math.min(N,L)/2;for(var S=0;S<(G+1);S++){var O=C*S*(Math.PI/180);var F=U+U*Math.cos(O);var E=U+U*Math.sin(O);Q.imageMap.push(parseInt(F),parseInt(E))}}return Q};MapIconMaker.createLabeledMarkerIcon=function(B){var C=B.primaryColor||"#DA7187";var L=B.strokeColor||"#000000";var H=B.starPrimaryColor||"#FFFF00";var M=B.starStrokeColor||"#0000FF";var I=MapIconMaker.escapeUserText_(B.label)||"";var J=B.labelColor||"#000000";var E=B.addStar||false;var K=(E)?"pin_star":"pin";var F="http://chart.apis.google.com/chart?cht=d&chdp=mapsapi&chl=";var A=F+K+"'i\\'["+I+"'-2'f\\hv'a\\]h\\]o\\"+C.replace("#","")+"'fC\\"+J.replace("#","")+"'tC\\"+L.replace("#","")+"'eC\\";if(E){A+=H.replace("#","")+"'1C\\"+M.replace("#","")+"'0C\\"}A+="Lauto'f\\";var G=new GIcon(G_DEFAULT_ICON);G.image=A+"&ext=.png";G.iconSize=(E)?new GSize(23,39):new GSize(21,34);return G};MapIconMaker.escapeUserText_=function(A){if(A===undefined){return null}A=A.replace(/@/,"@@");A=A.replace(/\\/,"@\\");A=A.replace(/'/,"@'");A=A.replace(/\[/,"@[");A=A.replace(/\]/,"@]");return encodeURIComponent(A)};var o=Ext.Container.prototype.lookupComponent;Ext.override(Ext.Container,{lookupComponent:function(A){if(A instanceof Ext.Element){return A}else{if(A.nodeType&&(A.nodeType==1)){return Ext.get(A)}else{return o.call(this,A)}}}});Ext.namespace("Ext.ux.layout");Ext.ux.layout.Carousel=Ext.extend(Ext.layout.ContainerLayout,{constructor:function(A){A=A||{};if(!(A.chunkedScroll||A.pagedScroll)){Ext.applyIf(A,{scrollIncrement:10,scrollRepeatInterval:10,marginScrollButtons:12,animScroll:false})}Ext.ux.layout.Carousel.superclass.constructor.call(this,A);if(this.chunkedScroll||this.pagedScroll){this.scrollRepeatInterval=this.scrollDuration*1000;this.scrollAnimationConfig={duration:this.chunkedScroll?this.scrollDuration:this.scrollDuration*2,callback:this.updateScrollButtons,scope:this}}else{this.scrollAnimationConfig=this.animScroll?{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}:false}},marginScrollButtons:10,scrollIncrement:10,scrollRepeatInterval:10,scrollDuration:0.35,animScroll:true,chunkedScroll:false,pagedScroll:false,loopCount:0,loopPictureDelay:5,dataView:"",monitorResize:true,scrollButtonPosition:"right",loopImages:function(){if(this.loopCount<=0){return }var A=this.getScrollTo(1);if(A){A=Math.min(this.getMaxScrollPos(),A);if(A!=this.getScrollPos()){this.scrollTo(A)}else{return }}else{this.scrollTo(0);this.loopCount--;if(this.loopCount<=0){return }}this.loopImages.defer(this.loopPictureDelay*1000,this)},onLayout:function(C,F){var E=C.items.items,A=E.length,G,B;if(!this.scrollWrap){this.scrollWrap=F.createChild({cls:"x-carousel-layout",cn:[{tag:this.scrollElementTag||"div",cls:"x-carousel-scroller",cn:{cls:"x-carousel-body"}},{cls:"x-carousel-left-scrollbutton",style:{height:"100%"}},{cls:"x-carousel-right-scrollbutton",style:{height:"100%"}}]});this.scrollWrap.addClass("x-scroll-button-position-"+this.scrollButtonPosition);this.scrollLeft=this.scrollWrap.child(".x-carousel-left-scrollbutton");this.scrollRight=this.scrollWrap.child(".x-carousel-right-scrollbutton");this.scroller=this.scrollWrap.child(".x-carousel-scroller");this.strip=this.scroller.child(".x-carousel-body");if(this.pagedScroll){this.scrollLeft.on("click",this.onScrollLeftClick,this);this.scrollRight.on("click",this.onScrollRightClick,this)}else{this.leftRepeater=new Ext.util.ClickRepeater(this.scrollLeft,{interval:this.pagedScroll?10000:this.scrollRepeatInterval,delay:0,handler:this.onScrollLeftClick,scope:this});this.rightRepeater=new Ext.util.ClickRepeater(this.scrollRight,{interval:this.pagedScroll?10000:this.scrollRepeatInterval,delay:0,handler:this.onScrollRightClick,scope:this})}this.renderAll(C,this.strip)}this.scroller.setWidth(this.container.getLayoutTarget().getWidth()-(this.scrollLeft.getWidth()+this.scrollRight.getWidth()+this.marginScrollButtons));this.updateScrollButtons.defer(10,this);if(this.loopCount>0&&(this.chunkedScroll||this.pagedScroll)&&!this.startedLoop){this.startedLoop=true;this.loopImages.defer(this.loopPictureDelay*1000,this)}},renderItem:function(G,A,F){if(G){if(G.initialConfig){if(G.rendered){if(typeof A=="number"){A=F.dom.childNodes[A]}F.dom.insertBefore(G.getEl().dom,A||null);G.el.addClass("x-carousel-item")}else{G.render(F,A)}}else{if(G instanceof Ext.Element){G.el=G;if(typeof A=="number"){A=F.dom.childNodes[A]}F.dom.insertBefore(G.dom,A||null)}}}if(this.dataView){var E,C=this.dataView.el.dom.childNodes;for(var B=0;B<C.length;B++){E=C[B];E.setAttribute("class","x-carousel-item "+E.getAttribute("class"))}}else{G.el.addClass("x-carousel-item")}},onResize:function(E,A,C){Ext.ux.layout.Carousel.superclass.onResize.apply(this,arguments);if(Ext.isIE){this.scrollLeft.setHeight(this.scroller.getHeight());this.scrollRight.setHeight(this.scroller.getHeight())}this.setItemsEdges();var B=this.getMaxScrollPos();if(this.getScrollPos()>B){this.scrollTo(B)}},setItemsEdges:function(){var J=this.strip.getLeft();var L=this.container.items.items;if(this.dataView){var L=this.dataView.store.data.items}var F=L.length;for(var G=0;G<F;G++){var I=L[G];if(this.dataView){var H=Ext.get(this.dataView.el.dom.childNodes[G])}else{var H=I.el}var K=H.getBox();var E=K.x-J;var B=K.right-J;I.edges={left:E,leftAnchor:E,right:B,rightAnchor:B};if(G==0){H.setStyle({"margin-left":"0px"})}else{if(G==L.length-1){H.setStyle({"margin-right":"0px"})}var C=L[G-1];var A=((E-C.edges.right)/2);C.edges.rightAnchor+=A;I.edges.leftAnchor-=A}}this.itemWidth=L[F-1].edges.rightAnchor/F},getNextOnLeft:function(){var B=this.container.items.items;if(this.dataView){var B=this.dataView.store.data.items}if(B.length){for(var A=B.length-1;A>-1;A--){if(B[A].edges.left<this.getScrollPos()){return B[A]}}}},getNextOnRight:function(){var E=this.container.items.items;if(this.dataView){if(this.dataView.store){var E=this.dataView.store.data.items}else{var E=new Array()}}if(E.length){var B=this.scroller.dom.scrollLeft+this.getClientWidth();for(var C=0,A=E.length;C<A;C++){if(E[C].edges.right>B){return E[C]}}}},onScrollRightClick:function(){this.loopCount=0;var A=this.getScrollTo(1);if(A){A=Math.min(this.getMaxScrollPos(),A);if(A!=this.getScrollPos()){this.scrollTo(A)}}},onScrollLeftClick:function(){this.loopCount=0;var A=Math.max(0,this.getScrollTo(-1));if(A!=this.getScrollPos()){this.scrollTo(A)}},scrollTo:function(B){if(this.scrollAnimationConfig){var A=Math.abs(this.getScrollPos()-B);this.scrollAnimationConfig.duration=this.scrollDuration*(A/this.itemWidth)}this.scroller.scrollTo("left",B,this.scrollAnimationConfig);if(!this.scrollAnimationConfig){this.updateScrollButtons()}},updateScrollButtons:function(){var A=this.getScrollPos();this.scrollLeft[(A==0)?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[(A>=this.getMaxScrollPos())?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},getScrollWidth:function(){var A=this.container.items.items;if(this.dataView){if(this.dataView.store){var A=this.dataView.store.data.items}else{var A=new Array()}}if(A.length&&(!A[0].edges||(A[0].edges.left==A[0].edges.right))){this.setItemsEdges()}return A.length?A[A.length-1].edges.rightAnchor:0},getScrollPos:function(){return this.scroller.dom.scrollLeft||0},getMaxScrollPos:function(){return this.getScrollWidth()-this.getClientWidth()},getClientWidth:function(){return this.scroller.dom.clientWidth||0},getScrollTo:function(C){var E=this.getScrollPos();if(this.chunkedScroll||this.pagedScroll){if(C==-1){var B=this.getNextOnLeft();if(B){if(this.pagedScroll){return B.edges.rightAnchor-this.getClientWidth()}else{return B.edges.leftAnchor}}}else{var A=this.getNextOnRight();if(A){if(this.pagedScroll){return A.edges.leftAnchor}else{return(A.edges.rightAnchor-this.getClientWidth())}}}}else{return(C==-1)?E-this.scrollIncrement:E+this.scrollIncrement}},isValidParent:function(B,A){return true}});Ext.Container.LAYOUTS.carousel=Ext.ux.layout.Carousel;Ext.namespace("Ext.ux.menu");Ext.ux.menu.StoreMenu=function(A){Ext.ux.menu.StoreMenu.superclass.constructor.call(this,A);if(!this.store){this.store=new Ext.data.JsonStore({fields:["config"],url:this.url,baseParams:this.baseParams,root:this.root||"data"})}this.on("show",this.onMenuLoad,this);this.store.on("beforeload",this.onBeforeLoad,this);this.store.on("load",this.onLoad,this)};Ext.extend(Ext.ux.menu.StoreMenu,Ext.menu.Menu,{loadingText:Ext.LoadMask.prototype.msg||"Loading...",loaded:false,onMenuLoad:function(){if(!this.loaded){this.store.load()}},updateMenuItems:function(loadedState,records){this.removeAll();this.el.sync();if(loadedState){for(var i=0,len=records.length;i<len;i++){if(records[i].json.handler){eval("records[i].json.handler = "+records[i].json.handler)}if(records[i].json.menu){eval("records[i].json.menu = "+records[i].json.menu)}this.add(records[i].json)}}else{this.add('<span class="loading-indicator">'+this.loadingText+"</span>")}this.loaded=loadedState},onBeforeLoad:function(A){this.store.baseParams=this.baseParams;this.updateMenuItems(false)},onLoad:function(B,A){this.updateMenuItems(true,A)}});QoDesk.NavigationBarPanel=Ext.extend(Ext.Panel,{url:Bsi.URL_BASE+Bsi.URL_SRVCS,active:0,initComponent:function(){Ext.apply(this,{renderTo:"ux-navbar",border:false,layout:"column",cls:"blackbar",tbar:[{text:"Home",tooltip:"Bring Home window to the front",scope:this,handler:function(){this.app.getModule("home-win").createWindow()}},"-",{text:"Shop",menu:{items:[{text:"Neighborhood",iconCls:"icon-hood",scope:this,handler:function(){this.app.getModule("hood-win").createWindow()}},{text:"Map",iconCls:"icon-map",scope:this,handler:function(){this.app.getModule("map-win").createWindow()}},{text:"Category",iconCls:"icon-category",scope:this,handler:function(){this.app.getModule("cat-win").createWindow()}},{text:"Search",iconCls:"icon-search",scope:this,handler:function(){this.app.getModule("srch-win").createWindow()}}],listeners:{render:{fn:function(A){this.active=0},scope:this},hide:{fn:function(A){this.active=0},scope:this},mouseover:{fn:function(A,C,B){this.active=1},scope:this}}},listeners:{menutriggerover:{fn:function(B,A,C){this.active=0;if(!B.hasVisibleMenu()){B.showMenu()}},scope:this,buffer:50},menutriggerout:{fn:function(B,A,C){if(!this.active){B.hideMenu()}},scope:this,buffer:50}}},"-",{text:"Account",menu:{items:[{hidden:true,text:"Information",iconCls:"icon-acct",scope:this,handler:function(){this.app.getModule("acct-win").createWindow()},listeners:{render:{fn:function(A){if(Bsi.USR_AUTH){A.setVisible(true)}else{A.destroy()}},scope:this}}},{text:"Preferences",scope:this,iconCls:"icon-paper-cog",handler:function(){this.app.getModule("pref-win").createWindow()}}],listeners:{render:{fn:function(A){this.active=0},scope:this},hide:{fn:function(A){this.active=0},scope:this},mouseover:{fn:function(A,C,B){this.active=1},scope:this}}},listeners:{render:{fn:function(A){if(Bsi.USR_BTQOWNR){if(Bsi.USR_STORES.length>1){t=A.menu.add({text:"Boutique Management",iconCls:"icon-btq-mgt",menu:{}});for(var B=0;B<Bsi.USR_STORES.length;B++){t.menu.add({text:Bsi.USR_STORES[B].t,iconCls:"icon-btq-mgt",btq:Bsi.USR_STORES[B],scope:this,handler:function(C,E){this.app.getModule("mybtq-win").createWindow({merchantId:C.btq.s,name:C.btq.t})}})}}else{A.menu.add({text:"Boutique Management",iconCls:"icon-btq-mgt",btq:Bsi.USR_STORES[0],scope:this,handler:function(C,E){this.app.getModule("mybtq-win").createWindow({merchantId:C.btq.s,name:C.btq.t})}})}}else{if(Bsi.USR_ADMIN){t=A.menu.add({text:"Boutique Management",iconCls:"icon-btq-mgt",menu:{}});for(var B=0;B<Ext.generaldata.neighborhoods.length;B++){h=Ext.generaldata.neighborhoods[B];t.menu.add({text:h.text,iconCls:"icon-btq-mgt",menu:new Ext.ux.menu.StoreMenu({url:this.url,baseParams:{method:"btqmgt.getbtqs",tid:h.tid},listeners:{beforeshow:function(){this.loaded=false}},scope:this})})}}}},scope:this},menutriggerover:{fn:function(B,A,C){this.active=0;if(!B.hasVisibleMenu()){B.showMenu()}},scope:this,buffer:50},menutriggerout:{fn:function(B,A,C){if(!this.active){B.hideMenu()}},scope:this,buffer:50}}},"-",{text:"New",tooltip:"New Products from local boutiques",scope:this,handler:function(){this.app.getModule("newstuff-win").createWindow()}},"-",{xtype:"uxbutton",id:"ux-navbar-inout",hidden:true,scope:this,listeners:{render:{fn:function(A){if(Bsi.USR_AUTH){A.setText("Logout");A.setTooltip("Thank you for stopping by "+Bsi.USR_NAME+".<br>Come again!");A.setHandler(function(){window.location="logout"});A.setVisible(true)}else{A.setText("Sign In");A.setTooltip("Sign In to use all the great features!");A.setMenu(new Ext.menu.Menu({items:[{text:"Sign In",scope:this,handler:function(B,C){new Ext.Window({id:"signin-win",bodyStyle:"padding:20px;",resizable:false,title:"Sign In Form",width:600,height:270,border:false,bodyBorder:false,modal:true,layout:"fit",shim:false,animCollapse:false,constrainHeader:true,items:[{border:false,cls:"boxForm",defaults:{border:false},items:[{style:"text-align:center;padding:5px 0;height:65px",html:'<img src="inc/r/images/bsi/WelcomeTagLine.gif">'},{style:"font-size:18px;",html:"Sign In"},{xtype:"form",id:"signinForm",style:"padding-top:10px;",monitorValid:true,layout:"column",defaults:{columnWidth:0.5,border:false,hideLabels:true},items:[{items:[{xtype:"textfield",id:"signinEmail",allowBlank:false,blankText:"required for sign in",style:"font-size:18px;color:#888;",width:235,height:30,name:"email"},{xtype:"panel",border:false,style:"color:#888;",html:"email or username"}]},{style:"padding-left:10px;",items:[{xtype:"textfield",id:"signinPassword",allowBlank:false,blankText:"required for sign in",style:"font-size:18px;color:#888;",width:245,height:30,inputType:"password",name:"password"},{xtype:"panel",border:false,style:"color:#888;",html:"password"}]}],buttonAlign:"right",buttons:[{text:"Sign In",formBind:true,scope:this,handler:function(G,K){var I=Ext.getCmp("signinForm").getForm();var F=Ext.getCmp("signinEmail");var H=F.getValue();var E=Ext.getCmp("signinPassword");var J=E.getValue();I.reset();new Ext.Window({id:"signin-loading",resizable:false,closable:true,title:"Signing In",width:230,height:80,border:false,modal:true,bodyStyle:"padding:20px;font-size:14px;color:#DDAA26;background:#000;",html:"Please wait while signing in..."}).show();Ext.Ajax.request({url:this.url,params:"method=user.mylogin&input="+H+"&pass="+J,method:"POST",scope:this,callback:function(N,P,O){if(P==true){var M=Ext.decode(O.responseText);var L=Ext.getCmp("signin-loading");Ext.fly(L.el.dom.previousSibling).fadeOut({duration:0.5,remove:true,callback:function(Q){if(M.data.sessid){if(Bsi.BSI_REFERER){window.location=Bsi.URL_BASE+"/"+Bsi.BSI_REFERER.value}else{window.location=Bsi.URL_BASE}}else{L.el.fadeOut({duration:1,remove:true,callback:function(R){L.close();Ext.Msg.show({title:"Sign In Failed",width:300,msg:"Sign in failed. Please try again.",buttons:Ext.Msg.OK})}})}}})}else{Ext.ux.onServerFailure(N,O)}}})}}]}]}]}).show()}},{text:"Forgot Password",scope:this,handler:function(B,C){new Ext.Window({id:"forgot-win",bodyStyle:"padding:20px;",resizable:false,title:"Forgot Password Form",width:300,height:190,border:false,bodyBorder:false,modal:true,layout:"fit",shim:false,animCollapse:false,constrainHeader:true,items:[{border:false,cls:"boxForm",items:[{border:false,defaults:{border:false},items:[{style:"font-size:18px;",html:"Forgot Password"},{xtype:"form",id:"forgotForm",style:"padding-top:10px;",defaultType:"textfield",hideLabels:true,monitorValid:true,items:[{name:"email",id:"forgotEmail",style:"font-size:18px;color:#888;",width:215,height:30,allowBlank:false,blankText:"email required",vtype:"email"},{xtype:"panel",border:false,style:"color:#888;font-size:11px;",html:"email"}],buttonAlign:"right",buttons:[{text:"Email Me",formBind:true,scope:this,handler:function(E,I){var H=Ext.getCmp("forgotForm").getForm();var G=Ext.getCmp("forgotEmail");var F=G.getValue();H.reset();new Ext.Window({id:"forgot-loading",resizable:false,closable:true,title:"Forgot Password",width:335,height:80,border:false,modal:true,bodyStyle:"padding:20px;font-size:14px;color:#DDAA26;background:#000;",html:"Please wait for forgot password to complete..."}).show();Ext.Ajax.request({url:this.url,params:"method=user.forgot&email="+F,method:"POST",scope:this,callback:function(L,N,M){if(N==true){var K=Ext.decode(M.responseText);var J=Ext.getCmp("forgot-loading");Ext.fly(J.el.dom.previousSibling).fadeOut({duration:0.5,remove:true,callback:function(O){J.el.fadeOut({duration:1,remove:true,callback:function(P){if(K.data.success){Ext.getCmp("forgot-win").close();J.close();Ext.Msg.show({title:"Forgot Password Complete",width:350,msg:"Thank you for visiting.<br>Further information will be sent to<br>"+F+".",buttons:Ext.Msg.OK})}else{J.close();Ext.Msg.show({title:"Forgot Password Failed",width:350,msg:"Sorry, <i>"+F+"</i> is unrecognized.<br/>Please try again.  If error persists, contact us<br/>at CustomerService@BoutiqueStreet.com",buttons:Ext.Msg.OK})}}})}})}else{Ext.ux.onServerFailure(L,M)}}})}}]}]}]}]}).show()}},{text:"Sign Up",scope:this,handler:function(B,C){new Ext.Window({id:"signup-win",bodyStyle:"padding:20px;",resizable:false,title:"Sign Up Form",width:500,height:180,border:false,bodyBorder:false,modal:true,layout:"fit",shim:false,animCollapse:false,constrainHeader:true,items:[{border:false,cls:"boxForm",items:[{border:false,items:[{border:false,style:"font-size:18px;",html:"Sign Up"},{xtype:"form",id:"signupForm",layout:"column",style:"padding-top:10px;",border:false,monitorValid:true,defaults:{columnWidth:0.5,border:false,layout:"form",hideLabels:true},items:[{items:[{xtype:"textfield",id:"signupEmail",name:"email",style:"color:#888;",width:200,allowBlank:false,blankText:"required for sign up",vtype:"email"},{xtype:"panel",border:false,style:"color:#888;",html:"email"}]},{style:"padding-left:10px;",items:[{xtype:"combo",id:"signupHear",name:"hear",title:"How did you hear of us?",style:"color:#888;",width:195,hiddenName:"hear",valueField:"reason",displayField:"reason",editable:false,mode:"local",triggerAction:"all",allowBlank:false,blankText:"required for sign up",emptyText:"How did you hear of us?",store:new Ext.data.SimpleStore({fields:["code","reason"],data:[[1,"Referred by Boutique Street"],[2,"Referred by friend"],[3,"Online search"],[4,"Other"]]})},{xtype:"panel",border:false,html:"&nbsp;"}]}],buttonAlign:"right",buttons:[{text:"Sign Up",formBind:true,id:"signupFormEnter",style:"width:100px",scope:this,handler:function(E,J){var I=Ext.getCmp("signupForm").getForm();var F=Ext.getCmp("signupEmail");var G=F.getValue();var K=Ext.getCmp("signupHear");var H=K.getValue();I.reset();new Ext.Window({id:"signup-loading",resizable:false,closable:false,title:"Signing Up",width:280,height:80,border:false,modal:true,bodyStyle:"padding:20px;font-size:14px;color:#DDAA26;background:#000;",html:"Please wait for sign up to complete..."}).show();Ext.Ajax.request({url:this.url,params:"method=user.signup&email="+G+"&hear="+H,method:"POST",scope:this,callback:function(N,P,O){if(P==true){var M=Ext.decode(O.responseText);var L=Ext.getCmp("signup-loading");Ext.fly(L.el.dom.previousSibling).fadeOut({duration:0.5,remove:true,callback:function(Q){L.el.fadeOut({duration:1,remove:true,callback:function(R){if(M.data.success){Ext.getCmp("signup-win").close();L.close();Ext.Msg.show({title:"Sign Up Complete",width:350,msg:"Thank you for signing up.<br/>Further information has been sent to<br/>"+G+".",buttons:Ext.Msg.OK})}else{L.close();Ext.Msg.show({title:"Sign Up Failed",width:350,msg:"Sign up failed. Please try again.<br/>"+M.data.data+"<br/>If error persists, contact us at<br/>customerservice@boutiquestreet.com",buttons:Ext.Msg.OK})}}})}})}else{Ext.ux.onServerFailure(N,O)}}})}}]}]}]}]}).show()}}],listeners:{render:{fn:function(B){this.active=0},scope:this},hide:{fn:function(B){this.active=0},scope:this},mouseover:{fn:function(B,E,C){this.active=1},scope:this}}}));A.setVisible(true)}},scope:this},menutriggerover:{fn:function(B,A,C){this.active=0;if(!B.hasVisibleMenu()){B.showMenu()}},scope:this,buffer:50},menutriggerout:{fn:function(B,A,C){if(!this.active){B.hideMenu()}},scope:this,buffer:50}}},"->",{id:"welcomeTxt",text:"Welcome "+Bsi.USR_NAME,cls:"x-item-no-button",scope:this},{text:"Shopping Cart",iconCls:"icon-nav-cart",menu:{items:[{text:"Shopping Cart",iconCls:"icon-cart",scope:this,handler:function(){this.app.getModule("cart-win").createWindow({tabName:"ShoppingCart"})}},{text:"Order History",iconCls:"icon-history",scope:this,handler:function(){this.app.getModule("cart-win").createWindow({tabName:"OrderHistory"})}},{text:"Wish List",iconCls:"icon-wish",scope:this,handler:function(){this.app.getModule("cart-win").createWindow({tabName:"WishList"})}}],listeners:{render:{fn:function(A){this.active=0},scope:this},hide:{fn:function(A){this.active=0},scope:this},mouseover:{fn:function(A,C,B){this.active=1},scope:this}}},listeners:{render:{fn:function(A){if(Bsi.USR_AUTH){A.menu.insert(1,new Ext.menu.Item({text:"Address Book",iconCls:"icon-addr-book",scope:this,handler:function(){this.app.getModule("cart-win").createWindow({tabName:"AddressBook"})}}))}},scope:this},menutriggerover:{fn:function(B,A,C){this.active=0;if(!B.hasVisibleMenu()){B.showMenu()}},scope:this,buffer:50},menutriggerout:{fn:function(B,A,C){if(!this.active){B.hideMenu()}},scope:this,buffer:50}}}]});QoDesk.NavigationBarPanel.superclass.initComponent.apply(this,arguments)},onRender:function(){QoDesk.NavigationBarPanel.superclass.onRender.apply(this,arguments)}});QoDesk.LandingWindow=Ext.extend(Ext.app.Module,{moduleId:"land-win",url:Bsi.URL_BASE+Bsi.URL_SRVCS,id:"land-win",init:function(){this.launcher={text:"Landing Window",handler:this.createWindow,scope:this}},createWindow:function(A){if(Bsi.BSI_REFERER){switch(Bsi.BSI_REFERER.type){case"store":this.app.getModule("btq-win").createWindow({hood:Bsi.BSI_REFERER.hood,name:Bsi.BSI_REFERER.name,merchantId:Bsi.BSI_REFERER.nid,scope:this});break}}}});QoDesk.ShareWindow=Ext.extend(Ext.app.Module,{moduleId:"share-win",url:Bsi.URL_BASE+Bsi.URL_SRVCS,id:"share-win",init:function(){this.launcher={text:"Share",handler:this.createWindow,scope:this}},createWindow:function(A){this.nid=A.merchantId;this.storeName=A.name.replace(/_/," ");this.hoodNames=A.hood;var C=this.app.getDesktop();var B=C.getWindow("share-win-"+this.nid);if(!B){B=C.createWindow({id:"share-win-"+this.nid,title:"Share with friends",width:400,height:500,minWidth:400,border:false,modal:true,defaults:{border:false},autoScroll:true,bodyStyle:"padding:0 20px;position:relative;",items:[{style:"color:#365F91;font-size:125%;padding:10px 0;",html:"Share with friends in the following ways."},{xtype:"form",title:"Twitter",cls:"x-panel-hdr-clean",style:"padding-bottom:20px;",titleCollapse:true,collapsible:true,defaultType:"textfield",bodyStyle:"padding:0 5px 5px;",defaults:{border:false,labelSeparator:"",hideLabel:true},monitorValid:true,items:[{xtype:"panel",layout:"column",style:"margin-bottom:5px;",defaults:{border:false},items:[{width:200,style:"padding-top:5px;",html:"What would you like to tweet?"},{id:"shareTweetCnt",columnWidth:0.95,cls:"posTweetCnt",style:"padding-right:15px;text-align:right;font-size:14px;font-weight:bold;font-family:georgia,serif;",html:""}]},{id:"shareTweetMsg",name:"msg",width:"95%",maskRe:Ext.form.VTypes.twitterMask,vtype:"twitter",enableKeyEvents:true,value:"I found a great new shopping website. Check it out at http://www.boutiquestreet.com",listeners:{render:{fn:function(F){var E=(140-F.value.length);var G=Ext.getCmp("shareTweetCnt");G.html=E},scope:this},keyup:{fn:function(F,G){var E=(140-F.getValue().length);var H=Ext.getCmp("shareTweetCnt");if(E<0&&H.el.hasClass("posTweetCnt")){H.removeClass("posTweetCnt");H.addClass("negTweetCnt")}else{if(E>=0&&H.el.hasClass("negTweetCnt")){H.removeClass("negTweetCnt");H.addClass("posTweetCnt")}}H.el.update(E)},scope:this}}},{xtype:"panel",style:"padding-top:3px;",layout:"column",defaults:{border:false},items:[{width:58,items:[{xtype:"button",text:"Reset",scope:this,handler:function(F,H){var E=Ext.getCmp("shareTweetMsg");E.setValue(E.originalValue);var G=(140-E.originalValue.length);var I=Ext.getCmp("shareTweetCnt");I.el.update(G);if(I.el.hasClass("negTweetCnt")){I.removeClass("negTweetCnt");I.addClass("posTweetCnt")}}}]},{width:55,items:[{xtype:"button",text:"Clear",scope:this,handler:function(F,G){var E=Ext.getCmp("shareTweetMsg");E.setValue("");var H=Ext.getCmp("shareTweetCnt");H.el.dom.innerHTML=140;if(H.el.hasClass("negTweetCnt")){H.removeClass("negTweetCnt");H.addClass("posTweetCnt")}}}]},{width:120,items:[{id:"shareTweetSubmit",xtype:"button",text:"Send Tweet",disabled:true,scope:this,handler:function(F,I){var H=F.findParentByType("form");var E=H.getForm().getValues();window.open("http://twitter.com/home?status="+E.msg,"_blank");Bsi.analytics.trackPageview({type:"twtr",data:{id:"share"}});var G=Ext.encode({data:E});G=encodeURIComponent(G);Ext.Ajax.request({url:this.url,params:"method=share.tweet&data="+G,method:"POST"})}}]}]}],listeners:{clientvalidation:{fn:function(G,F){var H=G.getForm().getValues();var E=(H.msg=="");F=(F&&!E);Ext.getCmp("shareTweetSubmit").setDisabled(!F)},scope:this}}},{xtype:"form",title:"Email",cls:"x-panel-hdr-clean",titleCollapse:true,collapsible:true,defaultType:"textfield",bodyStyle:"padding:5px 5px 20px;",defaults:{border:false,labelSeparator:"",hideLabel:true},monitorValid:true,items:[{xtype:"panel",style:"margin-bottom:5px;",html:'Emails of upto 5 recipients <span style="color:#990000;">*</span> (separate with commas)'},{name:"to",width:"95%",maskRe:Ext.form.VTypes.emailListMask,vtype:"emailList"},{xtype:"panel",style:"margin-bottom:5px;",html:"Your personalized message"},{id:"shareEmailMsg",xtype:"textarea",name:"msg",height:100,width:"95%",value:"Hi,\n\nI found a great shopping website.\nCheck it out at http://www.boutiquestreet.com\n\nHope you enjoy it."},{xtype:"panel",style:"margin-bottom:5px;",html:'Your email address <span style="color:#990000;">*</span> '},{name:"from",width:"95%",vtype:"email"},{xtype:"recaptcha",id:"recaptcha",name:"recaptcha"},{xtype:"panel",style:"color:#990000;margin-bottom:10px;",html:"* We do not save or use recipient's or your email for any purpose other than sending your message."},{xtype:"panel",layout:"column",defaults:{border:false},items:[{width:58,items:[{xtype:"button",text:"Reset",scope:this,handler:function(E,G){var F=E.findParentByType("form");F.getForm().reset()}}]},{width:55,items:[{xtype:"button",text:"Clear",scope:this,handler:function(F,H){var G=F.findParentByType("form");G.getForm().reset();var E=Ext.getCmp("shareEmailMsg");E.setValue("")}}]},{width:120,items:[{id:"shareEmailSubmit",xtype:"button",text:"Send Email",disabled:true,scope:this,handler:function(F,J){var I=F.findParentByType("form");var E=I.getForm().getValues();var G=new Ext.LoadMask(I.bwrap,{msg:"Sending Email..."});G.show();var H=Ext.encode({data:E});H=encodeURIComponent(H);Ext.Ajax.request({url:this.url,params:"method=share.email&data="+H,method:"POST",formMask:G,scope:this,callback:function(K,R,M){if(R==true){var Q=Ext.decode(M.responseText);if(Q.data.success){var P=F.findParentByType("form");P.getForm().reset();var L=Ext.get("recaptcha_response_field");L.dom.value="";Recaptcha.reload();var N=3000;var O='<div style="background:#eeffee;color:#009900;text-align:center;">Email successfully sent</div>'}else{Recaptcha.reload();var N=3000;var O='<div style="background:#ffeeee;color:#990000;text-align:center;">'+Q.data.data+"<br>Please try again.</div>"}K.formMask.el._maskMsg.fadeOut({duration:1,scope:this,callback:function(T){T.removeClass("x-mask-loading");T.dom.innerHTML=O;T.fadeIn({duration:1})}});var S=new Ext.util.DelayedTask(function(){K.formMask.hide()},this);S.delay(N)}else{K.formMask.hide();Ext.ux.onServerFailure(K,M)}}})}}]}]}],listeners:{clientvalidation:{fn:function(G,F){var H=G.getForm().getValues();var E=(H.to==""||H.msg==""||H.from==""||H.recaptcha_response_field=="");F=(F&&!E);Ext.getCmp("shareEmailSubmit").setDisabled(!F)},scope:this}}}]});B.center()}B.show()}});QoDesk.ProductWindow=Ext.extend(Ext.app.Module,{moduleId:"prod-win",url:Bsi.URL_BASE+Bsi.URL_SRVCS,id:"prod-win",init:function(){this.launcher={text:"My Product",handler:this.createWindow,scope:this}},createWindow:function(A){var N=this.app.getDesktop();var I=N.getWindow("prod-win-"+A.selRec.nid);if(!I){var F=A.selRec;var K=F.title;var H=F.display_price;var L=F.description;var O=this.getOptions(F);var C=this.getQuantity(F);var G=this.getButton(F);var M=this.getViews(F);if(F.hoodNames.length>1){var B=new Array();for(var E=0;E<F.hoodNames.length;E++){B.push({text:'<span qtip="Click to explore more <b>'+F.hoodNames[E]+'</b> boutiques">'+F.hoodNames[E]+"</span>",hoodName:F.hoodNames[E],handler:function(P){this.hoodHandler(P.hoodName)},scope:this})}var J={text:"Neighborhoods",iconCls:"icon-arrow-nw",tooltip:"Click to explore more neighborhood boutiques",scope:this,menu:{items:B}}}else{var J={text:F.hoodNames[0],iconCls:"icon-arrow-nw",tooltip:"Click to explore more <b>"+F.hoodNames[0]+"</b> boutiques",handler:function(P,Q){this.hoodHandler(F.hoodNames[0])},scope:this}}I=N.createWindow({id:"prod-win-"+F.nid,cls:"x-window-tbar-clean",title:F.title+" : "+F.storeName,width:A.width||650,height:A.height||575,border:false,layout:"fit",shim:false,animCollapse:false,constrainHeader:true,autoScroll:true,tbar:[{text:F.storeName,iconCls:"icon-arrow-nw",tooltip:"Click to go to <b>"+F.storeName+"</b> boutique",handler:function(P,Q){this.app.getModule("btq-win").createWindow({hood:F.hoodNames,name:F.storeName,merchantId:F.store.nid,scope:this})},scope:this},J,"->"],items:[{border:false,layout:"table",bodyStyle:"padding:10px;",autoScroll:true,cls:"prodWin",defaults:{border:false},layoutConfig:{columns:2},items:[{defaults:{border:false},width:400,items:[M]},{style:"padding:10px;margin:0 0 10px 10px;background:#f4f4f4;border:1px solid #ddd;",defaults:{border:false,style:"padding-bottom:5px;"},autoScroll:true,items:[{style:"font-size:18px;padding-bottom:10px;font-weight:bold;",html:K},{style:"font-size:18px;padding-bottom:10px;font-weight:bold;color:#8CBD30;",html:H},{style:"padding-bottom:0px;",items:O},{items:C},{style:"background:#FEFEDD;padding:10px;border:1px solid #ccc;",items:G},{style:"font-size:12px;padding:10px 10px 15px 0;",html:L}]}]}]})}I.show()},hoodHandler:function(C){this.app.getModule("hood-win").createWindow();var A="hood-"+C.replace(/ /g,"_");var B=Ext.getCmp("neighborhoods").getNodeById(A);B.select();Ext.getCmp("boutiques").loadPanel(B)},getViews:function(F){var B=new Ext.Panel({border:false});if(F.imgs==Bsi.BLANK_STRIPES){F.imgTH=""}else{var H=F.imgs[0].title;if(H==""){H="view 1"}F.imgTH='<img src="files/imagecache/product400/'+F.imgs[0].filepath+'" qtip="<b>'+H+'</b>">'}B.add({id:"prod-win-viewArea-"+F.nid,border:false,cls:"viewArea",style:"width:400px;height:400px;padding-bottom:10px;",items:[{id:"prod-win-viewArea-img-"+F.nid,border:false,cls:"viewArea-img",style:"text-align:center",html:F.imgTH}]});if(F.imgs.length>1){var A=new Ext.Panel({border:false,cls:"prod-win-thumbImgs",layout:"table",layoutConfig:{columns:4},defaults:{border:false}});var G,E;for(var C=0;C<F.imgs.length;C++){G="files/imagecache/product75/"+F.imgs[C].filepath;E=F.imgs[C].title;if(E==""){E="view "+(C+1)}A.add({xtype:"button",text:'<div class="clearfix"><em><img qtip="'+E+'" src="'+G+'"/></em></div>',img:F.imgs[C].filepath,nid:F.nid,tooltip:E,handler:function(I,J){this.changeView(I)},scope:this})}B.add(A)}return B},changeView:function(A){var C=Ext.getCmp("prod-win-viewArea-"+A.nid);var E=Ext.getCmp("prod-win-viewArea-img-"+A.nid);var F='<img src="files/imagecache/product400/'+A.img+'" qtip="<b>'+A.tooltip+'</b>">';C.body.hide();E.body.hide();E.destroy();C.remove("prod-win-viewArea-img-"+A.nid,true);var B=new Ext.Panel({id:"prod-win-viewArea-img-"+A.nid,border:false,cls:"viewArea-img",style:"text-align:center",html:F});C.add(B);C.doLayout();C.body.fadeIn({duration:0.75})},getOptions:function(G){if(G.attributes.length==0){return new Ext.Panel({border:false,style:"display:none"})}else{var H=new Ext.Panel({border:false});var A;var E;var F=new Array();for(var B in G.attributes){if(G.attributes[B].options.length!=0){F=new Array();for(var C in G.attributes[B].options){A=G.attributes[B].options[C].name;display_price="";E=0;if(G.attributes[B].options[C].price!=0){display_price=" $"+G.attributes[B].options[C].price;E=G.attributes[B].options[C].price}F.push(new Array(C,A,display_price,E))}H.add({border:false,style:"padding-bottom:10px;",items:[{xtype:"combo",width:150,listWidth:150,allowBlank:false,labelSeparator:"",mode:"local",editable:false,triggerAction:"all",displayField:"name",valueField:"name",emptyText:G.attributes[B].name,title:G.attributes[B].name,plugins:new Ext.ux.plugin.triggerfieldTooltip(),tooltip:{text:G.attributes[B].name},data:G,index:B,tpl:new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item">{name}{display_price}</div></tpl>'),store:new Ext.data.SimpleStore({fields:["oid","name","display_price","price"],data:F}),listeners:{render:{fn:function(I){if(I.data.options[I.index].name){I.setValue(I.data.options[I.index].name)}},scope:this},select:{fn:function(K,J,I){K.data.options[K.index]=K.data.attributes[K.index].options[J.data.oid]},scope:this}}}]})}}return H}},getQuantity:function(C){var A=[["1"],["2"],["3"],["4"],["5"]];var B=new Ext.Panel({border:false,style:"padding-bottom:5px;",items:[{xtype:"combo",width:80,listWidth:80,allowBlank:false,labelSeparator:"",mode:"local",editable:false,triggerAction:"all",displayField:"n",emptyText:"QTY",title:"QTY",plugins:new Ext.ux.plugin.triggerfieldTooltip(),tooltip:{text:"QUANTITY"},data:C,store:new Ext.data.SimpleStore({fields:["n"],data:A}),listeners:{render:{fn:function(E){if(E.data.qty>0){E.setValue(E.data.qty)}},scope:this},select:{fn:function(G,F,E){G.data.qty=F.data.n},scope:this}}}]});return B},getButton:function(B){var A=new Ext.Button({cls:"addButton redBuyBtn",text:"Add to Shopping Cart",scope:this,handler:function(C,E){this.app.getModule("cart-win").createWindow({data:Ext.ux.clone(B)})}});return A}});QoDesk.CompanyWindow=Ext.extend(Ext.app.Module,{moduleId:"comp-win",url:Bsi.URL_BASE+Bsi.URL_SRVCS,init:function(){this.launcher={text:"Company",shortcutIconCls:"comp-shortcut-icon",handler:this.createWindow,scope:this}},createWindow:function(A){var F=this.app.getDesktop();var C=F.getWindow("comp-win");var B=0;if(A){if(A.tabName){switch(A.tabName){case"About":B=0;break;case"Buzz":B=1;break;case"Merchants":B=2;break;case"Help":B=3;break;case"Policies":B=4;break}}}if(!C){C=F.createWindow({id:"comp-win",title:"Company",width:500,height:525,border:true,layout:"fit",shim:false,animCollapse:false,constrainHeader:true,items:new Ext.TabPanel({id:"comp-tabs",activeTab:B,deferredRender:false,border:false,enableTabScroll:true,defaults:{hideMode:"offsets",cmargins:"3 3 3 3",border:false,layout:"border",header:false},items:[{title:"About",iconCls:"icon-about",tabTip:"Company, Technology, People & Career",items:[{xtype:"panel",id:"comp-about",region:"center",border:false,defaults:{border:false},autoScroll:true,items:[{xtype:"panel",style:"padding:10px;",html:'<p style="color:#365F91;font-size:12px;font-weight:bold;text-align:center;">What could be better than boutique shopping?</p><p style="color:#365F91;font-size:12px;font-weight:bold;text-align:center;">Maybe shopping boutique neighborhoods online!</p><p>Explore charming neighborhoods of colorful small stores, each stocked with unique and special items hand-picked by knowledgeable and artful owners. Discover that perfect treasure, made by a talented local artist or brought back from distant lands. Support local merchants who add so much to the quality of life.</p><p>Shop...pre-shop...fantasy shop when your checkbook is low.</p><p>We love to shop & hope you will too...</p>'},{layout:"table",layoutConfig:{columns:2},style:"padding:5px 10px 20px 20px;",defaults:{border:false},cls:"teamBio",items:[{width:140,cls:"teriPic",html:"&nbsp;"},{style:"padding-left:5px;",html:'<h1 style="color:#365F91">Teri Watts, Shopper in Chief</h1><p>After graduating from Stanford Business School, Teri joined the Gap, a 13 store start-up at the time. She helped the company grow to over 650 stores in a variety of positions before "retiring" to start a family. As children grew, Teri longed to re-start a career. With the dot.com brewing in Silicon Valley, she studied web design and began freelancing. When she landed a local boutique client, she knew she\'d found her calling and BoutiqueStreet was born.</p>'},{width:140,cls:"edwinPic",html:"&nbsp;"},{style:"padding-left:5px;",html:'<h1 style="color:#365F91">Edwin Salgado, Geek in Chief</h1><p>With a joint degree in Computer Science & Electrical Engineering plus 7 years as a developer in Silicon Valley, Edwin went back to school. He felt an MBA from Stanford would enable him to achieve his life\'s goal of becoming an entrepreneur. Through the Stanford network, Edwin and Teri connected. He is now the creative technology force behind the platform and features of the BoutiqueStreet marketplace.</p>'}]}]}]},{title:"Buzz",iconCls:"icon-buzz",tabTip:"Press, Headlines, Events & Blog",items:[{id:"comp-media",region:"center",border:false,html:'<p>Hello fellow boutiquer,</p><p>Thank you for visiting BoutiqueStreet. Each week we will be posting notes to advise you of our progress in building the marketplace.</p><p>Your feedback on all aspects of the site as it develops is greatly appreciated.  You can email us directly using email below:</p><p style="color:#6593CF;">feedback @ boutiquestreet .com</p><p>This week, we\'d like to let you know that we are working on the following:</p><div style="padding-left:20px;">- We got large views and multiple views for merchandise up and running. Hooray!</div><div style="padding-left:20px;">- We are working to get merchandise on line for Vian Hunter, Romi, and View from the Terrace.</div><div style="padding-left:20px;">- We\'re starting to work with a graphic designer to make the website continually prettier.</div><p>Have fun shopping & check in often to see us grow & improve!</p>'}]},{title:"Merchants",iconCls:"icon-merchants",tabTip:"Benefits, Enrollment & Programs",items:[{xtype:"panel",id:"comp-merchants",region:"center",border:false,autoScroll:true,items:[{xtype:"panel",border:false,style:"padding:10px;",html:'<h2 style="color:#365F91">Welcome!</h2><p>BoutiqueStreet.com is a whole new e-shopping concept that brings together motivated upscale shoppers and premium boutiques.</p><h2 style="color:#365F91">An Opportunity That Never Existed Before</h2><p>Even as the economy slows down, E-Commerce is booming. Unfortunately, over 90% of boutiques have not participated in this boom because of the expense and complexity of proprietary websites and because internet shoppers rarely find boutiques in online searches.</p><p>We have found a way to break through both of those obstacles.</p><p>What we offer is straightforward: <b>It is a very simple and low cost way for boutiques to have an online presence and sell products on a website that will attract customers that a boutique on the street or online cannot do to attract on its own.</b></p><p>If your boutique serves upscale shoppers, then you belong on BoutiqueStreet.com&trade;! We are currently adding boutiques in the San Francisco Bay Area. If you are located elsewhere we would still be interested in hearing from you as we have plans to expand.</p><h2 style="color:#365F91">This is nothing like the worry and complexity of putting up your own website with e-commerce!</h2><p>You\'ll find that we understand the retail business and strive to make every interaction pleasant and easy.</p><p style="border-bottom:1px solid #ccc;">Contact us to learn how easy and economical it will be for you to expand revenues and profits by reaching the vast online shopping audience 24 hours per day x 7 days per year.</p><h2 style="color:#365F91;padding-top:10px;">Please contact me regarding potentially joining BoutiqueStreet.com:</h2>'},{xtype:"form",id:"regForm",border:false,labelAlign:"right",labelWidth:85,bodyStyle:"padding:0 0 10px 20px;",defaults:{width:200,allowBlank:false,labelSeparator:""},defaultType:"textfield",monitorValid:true,items:[{fieldLabel:"Boutique Name",name:"boutique"},{fieldLabel:"Contact Name",name:"contact"},{fieldLabel:"Phone Number",name:"phone",maskRe:Ext.form.VTypes.phoneMask,vtype:"phone"},{fieldLabel:"Email Address",name:"email",vtype:"email"}],buttonAlign:"left",buttons:[{text:"Clear",style:"padding:0;",scope:this,handler:function(G,H){Ext.getCmp("regForm").getForm().reset()}},{text:"Inquire",style:"padding:0;",scope:this,formBind:true,handler:function(G,J){var I=Ext.getCmp("regForm").getForm().getValues();var H=Ext.encode({boutique:I.boutique,contact:I.contact,phone:I.phone,email:I.email});Ext.Ajax.request({url:this.url,params:"method=util.merchEmail&data="+H,method:"POST",scope:this,callback:function(L,N,M){if(N==true){var K=Ext.decode(M.responseText);if(K.data==1){Ext.getCmp("regForm").getForm().reset()}}else{Ext.ux.onServerFailure(L,M)}}})}}]}]}]},{title:"Help",iconCls:"icon-help",tabTip:"Tour & FAQ",items:[{id:"comp-help",region:"center",border:false,style:"color:#365F91;font-size:125%;padding:20px;",html:"FAQ, Tour, and general help information coming soon..."}]},{title:"Policies",iconCls:"icon-legal",tabTip:"Terms, Privacy, Copyright & Trademarks",items:[{id:"comp-legal",region:"center",border:false,style:"padding:10px;",html:'<h1 style="color:#365F91">Security of your transactions</h1><p>We are committed to protecting our customers\' information from hackers and to ensuring the security of credit card transactions.</p><p>We are doing so by purchasing <i><b>thawte\'s</b></i> SSL123 Certificate.  This provides customers:</p><div style="padding:5px 0 0 40px;">1. Validation that our domain is registered and that we have authorized the purchase of the certificate.</div><div style="padding:10px 0 0 40px;">2. Secure communications by encrypting all data to and from the site. By using industry standard for encryption, Secure Socket Layer (SSL), the certificate assures that information is kept private between our webserver and our clients\' web browsers.</div><p>Terms, Privacy, Copyright, Trademarks info coming soon</p>'}]}]})});C.center();var E=C.getPosition();if(E[1]<38){E[1]=38}C.setPosition(E[0],E[1])}else{Ext.getCmp("comp-tabs").activate(B)}C.show()},lookup:{},initTemplates:function(){this.thumbTemplate=new Ext.XTemplate('<tpl for=".">','<div class="thumb-wrap" id="comp-{name}">','<div class="thumb"><img src="{url}" title="{name}"></div>',"<span>{shortName}</span></div>","</tpl>");this.thumbTemplate.compile();this.detailsTemplate=new Ext.XTemplate('<div class="details">','<tpl for=".">','<div id="comp-details-img" class="thumb {name}"><img src="{url}"></div>','<div class="details-info">',"<b>Image Name:</b>","<span>{name}</span>","<b>Size:</b>","<span>{sizeString}</span>","<b>Last Modified:</b>","<span>{dateString}</span></div>","</tpl>","</div>");this.detailsTemplate.compile()},showDetails:function(){var E=this.view.getSelectedNodes();var F=Ext.getCmp("comp-product-preview").body;if(E&&E.length>0){E=E[0];var C=this.lookup[E.id.replace("comp-","")];var A=Ext.get("comp-details-img");var B=0;if(!A){B=1}else{if(!A.hasClass(C.name)){B=1}}if(B){F.hide();this.detailsTemplate.overwrite(F,C);A=Ext.get("comp-details-img");F.slideIn("l",{stopFx:true,duration:0.3})}}else{F.update("")}}});QoDesk.BoutiqueWindow=Ext.extend(Ext.app.Module,{moduleId:"btq-win",url:Bsi.URL_BASE+Bsi.URL_SRVCS,id:"btq-win",init:function(){this.launcher={text:"My Boutique",handler:this.createWindow,scope:this}},createWindow:function(B){this.nid=B.merchantId;this.storeName=B.name.replace(/_/," ");this.hoodNames=B.hood;var N=this.app.getDesktop();var J=N.getWindow("btq-win-"+this.nid);if(!J){Bsi.analytics.trackPageview({type:"btq",data:{nid:B.merchantId,name:B.name}});var M=new Ext.XTemplate('<div class="productThumbs clearfix">','<tpl for=".">','<div class="product-thumbs nid-{nid}<tpl if="publish == 0"> publish0</tpl> clearfix">','<div class="thumb-wrap">','<div class="thumb clearfix">',"{imgTH}","</div>",'<div class="info clearfix">',"<table><tbody>","<tr>",'<td colspan=2 class="title">{[values.title.ellipse(23)]}</td>',"</tr>","<tr>",'<td class="price">{[values.display_price.ellipse(15)]}</td>','<td class="details"><a href="#" class="details-link" qtip="Click to zoom and for more details">Zoom</a></td>',"</tr>","</tbody></table>","</div>","</div>","</div>","</tpl>","</div>");M.compile();var F=new Ext.data.Record.create([{name:"publish",mapping:"publish"},{name:"display_price",mapping:"display_price"},{name:"sell_price",mapping:"sell_price"},{name:"imgs",mapping:"imgs"},{name:"nid",mapping:"nid"},{name:"title",mapping:"title"},{name:"description",mapping:"description"},{name:"order",mapping:"order"},{name:"sku",mapping:"sku"},{name:"attributes",mapping:"attributes"},{name:"options",mapping:"options"},{name:"qty",mapping:"qty"},{name:"zone",mapping:"zone"},{name:"taxrate",mapping:"taxrate"},{name:"store",mapping:"store"},{name:"hood",mapping:"hood"}]);var G=new Ext.data.JsonReader({root:"data.products"},F);var I=new Ext.data.Store({reader:G,merchantId:B.merchantId,listeners:{load:{fn:function(R,T,S){var O=Ext.getCmp("products-"+R.merchantId);O.select(0);if(T[0].data.nid!=0){var P=new Ext.ux.dd.ProdDragZone(O,{containerScroll:true,ddGroup:"prodDD"})}var U;for(var Q=0;Q<T.length;Q++){U=T[Q].data;Ext.select(".nid-"+U.nid).on({click:{fn:function(V){this.prodHandler(V,R.merchantId)},scope:this}})}},scope:this,single:true}}});var C=function(O){O.title=O.title.replace(/"/g,"&quot;").replace(/'/g,"&#039;");if(O.imgs==Bsi.BLANK_STRIPES){O.imgTH="<em></em>"}else{O.imgTH='<em><img src="files/imagecache/product150/'+O.imgs[0].filepath+'" qtip="<b>'+O.title+"</b><br><b>"+O.display_price+'</b><br>Click to see preview on the right or<br>Drag &amp; Drop into open shopping cart"></em>'}return O};var A;A=new Ext.DataView({id:"products-"+B.merchantId,tpl:M,merchantId:B.merchantId,prevInit:-1,singleSelect:true,overClass:"x-view-over",itemSelector:"div.product-thumbs",loadingText:'<div class="loading-indicator">loading...</div>',emptyText:"",store:I,prepareData:C.createDelegate(this),listeners:{selectionchange:{fn:function(Q,O){this.showDetails(O,Q.merchantId,A);if((O.length>0)&&(Q.prevInit<1)){if(!Q.prevInit++){var P=Ext.getCmp("aboutPreview-"+Q.merchantId);P.activate(1)}}},scope:this,buffer:100},dblclick:{fn:function(R,O,S,P){var Q=R.getSelectedRecords()[0].data;Q.title=Q.title.replace(/"/g,"&quot;").replace(/'/g,"&#039;");this.showProduct(Q)},scope:this},render:{fn:function(Q){var P=Ext.getCmp("btq-win-"+this.nid);var O=new Ext.LoadMask(P.bwrap,{msg:"Loading Boutique..."});O.show();Ext.Ajax.request({url:this.url,params:"method=store.products&nid="+this.nid,method:"POST",c:Q,storeMask:O,scope:this,callback:function(U,X,W){if(X==true){var S=Ext.decode(W.responseText);Ext.util.CSS.removeStyleSheet("btq-"+this.nid);Ext.util.CSS.createStyleSheet(S.data.store.css,"btq-"+this.nid);if(S.data.store.template!=Bsi.BLANK_STRIPES){var T=S.data.store.template.replace(/\{products\}/,U.c.tpl.html);U.c.tpl=new Ext.XTemplate(T)}if(S.data.products.length==0){var V={data:{products:new Array({publish:1,display_price:"$888",sell_price:0,imgs:Bsi.BLANK_STRIPES,nid:0,title:"Coming Soon",description:"Coming Soon",order:0,sku:0,attributes:{},options:{},qty:0,zone:"",taxrate:0,store:{},hood:[]})}};U.c.store.loadData(V)}else{for(var R=0;R<S.data.products.length;R++){S.data.products[R].hood=this.hoodNames;S.data.products[R].zone=S.data.store.zone;S.data.products[R].taxrate=S.data.store.taxrate}U.c.store.loadData(S)}}else{Ext.ux.onServerFailure(U,W)}U.storeMask.hide()}})},scope:this}}});var L=function(Q,P){var O=Ext.getCmp("btq-win-"+P);O.layout.setActiveItem(Q)};if(this.hoodNames.length>1){var E=new Array();for(var H=0;H<this.hoodNames.length;H++){E.push({text:'<span qtip="Click to explore more <b>'+this.hoodNames[H]+'</b> boutiques">'+this.hoodNames[H]+"</span>",hoodName:this.hoodNames[H],handler:function(O,P){this.hoodHandler(O.hoodName)},scope:this})}var K={text:"Neighborhoods",iconCls:"icon-arrow-nw",tooltip:"Click to explore more neighborhood boutiques",scope:this,menu:{items:E}}}else{var K={text:this.hoodNames[0],iconCls:"icon-arrow-nw",tooltip:"Click to explore more <b>"+this.hoodNames[0]+"</b> boutiques",hoodName:this.hoodNames[0],handler:function(O,P){this.hoodHandler(O.hoodName)},scope:this}}J=N.createWindow({id:"btq-win-"+this.nid,cls:"x-window-tbar-clean",title:this.storeName,width:750,height:525,layout:"card",shim:false,animCollapse:false,constrainHeader:true,deferredRender:true,border:false,nid:this.nid,defaults:{hideMode:"offsets",border:false,layout:"border",header:false},activeItem:0,tbar:[K,{text:this.storeName,handler:L.createDelegate(this,[0,this.nid])},{text:"Reviews",handler:L.createDelegate(this,[1,this.nid])},"->"],items:[{items:[{region:"center",cls:"products",autoScroll:true,border:false,items:A},{xtype:"tabpanel",id:"aboutPreview-"+B.merchantId,cls:"aboutPreview",region:"east",split:true,collapseMode:"mini",hideMode:"offsets",collapsible:true,useSplitTips:true,collapsible:true,tabPosition:"bottom",deferredRender:false,border:false,width:175,minWidth:175,maxWidth:175,defaults:{border:false,autoScroll:true,header:false},activeTab:0,items:[{title:"About",items:[{id:"aboutUs-"+this.nid,cls:"aboutUs",border:false,region:"center",defaults:{border:false},listeners:{render:{fn:function(O){Ext.Ajax.request({url:this.url,params:"method=store.about&nid="+this.nid,method:"POST",c:O,scope:this,callback:function(Q,T,S){if(T==true){var P=Ext.decode(S.responseText);if(P.data.imgs!=Bsi.BLANK_STRIPES){var R=P.data.imgs[0].title;if(R==""){R=this.storeName}O.add({style:"text-align:center;padding-top:10px;;",html:'<img src="files/imagecache/boutique120x90/'+P.data.imgs[0].filepath+'" style="border:1px solid #ccc;padding:5px;" qtip="<b>'+R+'</b>">'})}O.add({style:"text-align:center;font-weight:bold;padding:10px 0 5px;",html:this.storeName});O.add({html:P.data.about});O.doLayout();O.body.hide();O.body.fadeIn({stopFx:true,duration:2})}else{Ext.ux.onServerFailure(Q,S)}}})},scope:this}}}]},{xtype:"form",id:"product-preview-"+B.merchantId+"-wrapper",title:"Preview",items:[{id:"product-preview-"+B.merchantId,cls:"product-preview",border:false}],buttons:[{id:"add2Cart-"+B.merchantId,text:"Add to Shopping Cart",cls:"redBuyBtn",scope:this,merchantId:B.merchantId,handler:function(O,P){this.app.getModule("cart-win").createWindow({data:Ext.ux.clone(Ext.getCmp("product-preview-"+O.merchantId).data)})}}]}]}]},{items:[{xtype:"panel",id:"reviews-"+this.nid,cls:"reviews",region:"center",border:false,autoScroll:true,style:"color:#365F91;font-size:125%;padding:20px;",html:"Customer reviews of <b>"+this.storeName+"</b> coming soon..."}]}],listeners:{beforeclose:{fn:function(P,O){Ext.util.CSS.removeStyleSheet("btq-"+this.nid)},scope:J}}})}J.show()},hoodHandler:function(C){this.app.getModule("hood-win").createWindow();var A="hood-"+C.replace(/ /g,"_");var B=Ext.getCmp("neighborhoods").getNodeById(A);B.select();Ext.getCmp("boutiques").loadPanel(B)},prodHandler:function(A,E){var C=A.getTarget(".details-link");var F=Ext.getCmp("products-"+E);if(C){var B=F.getRecord(A.getTarget(".product-thumbs")).data;this.showProduct(B)}},showProduct:function(A){if(A.nid!=0){A.storeName=this.storeName;A.hoodNames=this.hoodNames;this.app.getModule("prod-win").createWindow({selRec:A,title:A.title})}},showDetails:function(U,C,N){var G=Ext.getCmp("product-preview-"+C+"-wrapper");var L=Ext.getCmp("product-preview-"+C);var I=Ext.getCmp("products-"+C);if(U&&U.length>0){U=U[0];var E=/nid-(\d+)/;var O=E.exec(U.className);var R=true;var J=L.body.child("div.thumb");if(J){R=!(J.hasClass(O[0]))}if(R){G.body.hide();L.body.hide();var T=I.getSelectedRecords()[0].data;T.title=T.title.replace(/"/g,"&quot;").replace(/'/g,"&#039;");if(T.imgs==Bsi.BLANK_STRIPES){T.imgTH="<em></em>"}else{T.imgTH='<em><img src="files/imagecache/product100/'+T.imgs[0].filepath+'" qtip="<b>'+T.title+'</b><br>Drag &amp; Drop into open shopping cart"></em>'}L.destroy();G.remove("product-preview-"+C,true);var B=new Ext.Panel({id:"product-preview-"+C,data:T,cls:"product-preview",border:false,listeners:{render:{fn:function(W){Ext.getCmp("add2Cart-"+C).setDisabled((W.data.nid==0))},scope:this}}});var H='<div class="product-details clearfix"><div class="thumb-wrap"><div class="thumb nid-'+T.nid+'">'+T.imgTH+'</div><div class="info clearfix"><table><tbody><tr><td class="title">'+T.title+'</td></tr><tr><td class="price">'+T.display_price+"</td></tr></tbody></table></div></div></div>";var F=new Ext.Panel({border:false,html:H});B.add(F);var V;var P;var M=new Array();if(T.attributes&&(T.attributes.length!=0)){for(var Q in T.attributes){if(T.attributes[Q].options.length!=0){M=new Array();for(var A in T.attributes[Q].options){V=T.attributes[Q].options[A].name;display_price="";P=0;if(T.attributes[Q].options[A].price!=0){display_price=" $"+T.attributes[Q].options[A].price;P=T.attributes[Q].options[A].price}M.push(new Array(A,V,display_price,P))}B.add({border:false,style:"margin-bottom:10px;",items:[{xtype:"combo",border:false,width:110,listWidth:110,allowBlank:false,labelSeparator:"",mode:"local",editable:false,triggerAction:"all",displayField:"name",valueField:"name",emptyText:T.attributes[Q].name,title:T.attributes[Q].name,plugins:new Ext.ux.plugin.triggerfieldTooltip(),tooltip:{text:T.attributes[Q].name},data:T,index:Q,tpl:new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item">{name}{display_price}</div></tpl>'),store:new Ext.data.SimpleStore({fields:["oid","name","display_price","price"],data:M}),listeners:{render:{fn:function(W){if(W.data.options[W.index].name){W.setValue(W.data.options[W.index].name)}},scope:this},select:{fn:function(Y,X,W){Y.data.options[Y.index]=Y.data.attributes[Y.index].options[X.data.oid]},scope:this}}}]})}}}var S=[["1"],["2"],["3"],["4"],["5"]];B.add({border:false,style:"margin-bottom:6px;",items:[{xtype:"combo",border:false,width:50,listWidth:50,allowBlank:false,labelSeparator:"",mode:"local",editable:false,triggerAction:"all",displayField:"n",emptyText:"QTY",title:"QTY",plugins:new Ext.ux.plugin.triggerfieldTooltip(),tooltip:{text:"QUANTITY"},data:T,store:new Ext.data.SimpleStore({fields:["n"],data:S}),listeners:{render:{fn:function(W){if(W.data.qty>0){W.setValue(W.data.qty)}},scope:this},select:{fn:function(Y,X,W){Y.data.qty=X.data.n},scope:this}}}]});B.add({border:false,cls:"prev-details-button",items:[{xtype:"button",iconCls:"icon-details-link",text:"Zoom",tooltip:"Click to zoom and for more details",data:T,scope:this,handler:function(W,X){var Y=W.data;this.showProduct(Y)}}]});B.add({xtype:"panel",border:false,cls:"product-description",html:T.description});B.doLayout();G.add(B);G.doLayout();G.body.show();B.body.fadeIn({stopFx:true,duration:0.5});if(T.nid!=0){var K=new Ext.ux.dd.PrevDragSource(T,F.body.child("div.product-details"),{ddGroup:"prodDD"})}}}else{}}});QoDesk.MapWindow=Ext.extend(Ext.app.Module,{moduleId:"map-win",streetviewOverlay:0,url:Bsi.URL_BASE+Bsi.URL_SRVCS,init:function(){this.launcher={text:"Map",shortcutIconCls:"map-shortcut-icon",handler:this.createWindow,scope:this}},createWindow:function(B){var E=this.app;var F=this.app.getDesktop();var C=F.getWindow("map-win");if(!C){this.markerOn={nid:0,mark:0};var A={};A.width=20;A.height=20;this.icon=MapIconMaker.createMarkerIcon(A);A.primaryColor="#00FF00";this.iconOver=MapIconMaker.createMarkerIcon(A);C=F.createWindow({id:"map-win",cls:"x-window-tbar-clean",title:"Map View",width:700,height:450,border:false,defaults:{border:false},autoScroll:true,layout:"border",tbar:[{text:"SF Bay Area",handler:this.panTo.createDelegate(this,[37.77916,-122.420049,10]),menu:{items:[{text:"San Francisco",handler:this.panTo.createDelegate(this,[37.7640006,-122.4388612,12]),menu:{items:[{text:"Polk",handler:this.panTo.createDelegate(this,[37.791522,-122.420893,15])},{text:"Fillmore",handler:this.panTo.createDelegate(this,[37.78797,-122.433673,15])},{text:"Marina",handler:this.panTo.createDelegate(this,[37.661062,-122.429632,15])}]}},{text:"Marin",handler:this.panTo.createDelegate(this,[37.925965,-122.564485,11]),menu:{items:[{text:"Mill Valley",handler:this.panTo.createDelegate(this,[37.906918,-122.554992,15])}]}},{text:"Peninsula",handler:this.panTo.createDelegate(this,[37.51219,-122.294302,11]),menu:{items:[{text:"Burlingame",handler:this.panTo.createDelegate(this,[37.58178,-122.356245,15])},{text:"San Mateo",handler:this.panTo.createDelegate(this,[37.663063,-122.425923,15])},{text:"Menlo park",handler:this.panTo.createDelegate(this,[37.441404,-122.193032,15])},{text:"Palo Alto",handler:this.panTo.createDelegate(this,[37.455846,-122.150906,15])}]}},{text:"Wine Country",handler:this.panTo.createDelegate(this,[38.4533,-122.6757,9]),menu:{items:[{text:"Calistoga",handler:this.panTo.createDelegate(this,[38.579855,-122.578351,15])},{text:"St. Helena",handler:this.panTo.createDelegate(this,[38.503184,-122.46686,15])}]}}],listeners:{render:{fn:function(G){this.active=0},scope:this},hide:{fn:function(G){this.active=0},scope:this},mouseover:{fn:function(G,I,H){this.active=1},scope:this}}},listeners:{menutriggerover:{fn:function(H,G,I){this.active=0;if(!H.hasVisibleMenu()){H.showMenu()}},scope:this,buffer:50},menutriggerout:{fn:function(H,G,I){if(!this.active){H.hideMenu()}},scope:this,buffer:50}}},{text:"LA Metro Area",handler:this.panTo.createDelegate(this,[34.05329,-118.245009,9]),menu:{items:[{text:"Westside",handler:this.panTo.createDelegate(this,[34.0389057,-118.4533023,12]),menu:{items:[{text:"Venice",handler:this.panTo.createDelegate(this,[33.9909308,-118.4671446,15])},{text:"Brentwood",handler:this.panTo.createDelegate(this,[34.0507,-118.474019,15])},{text:"Beverly Hills",handler:this.panTo.createDelegate(this,[34.075162,-118.398632,15])},{text:"West Hollywood",handler:this.panTo.createDelegate(this,[34.09071,-118.36959,15])}]}},{text:"Mid-City",handler:this.panTo.createDelegate(this,[34.041569,-118.328989,13])},{text:"Orange County",handler:this.panTo.createDelegate(this,[33.571339,-117.820654,11]),menu:{items:[{text:"Laguna Beach",handler:this.panTo.createDelegate(this,[33.541411,-117.759655,14])}]}}],listeners:{render:{fn:function(G){this.active=0},scope:this},hide:{fn:function(G){this.active=0},scope:this},mouseover:{fn:function(G,I,H){this.active=1},scope:this}}},listeners:{menutriggerover:{fn:function(H,G,I){this.active=0;if(!H.hasVisibleMenu()){H.showMenu()}},scope:this,buffer:50},menutriggerout:{fn:function(H,G,I){if(!this.active){H.hideMenu()}},scope:this,buffer:50}}},{text:"NY Metro Area",tooltip:"coming soon",disabled:true},"->",{text:"Map Type",menu:{items:[{text:"Map",handler:this.changeView.createDelegate(this,[G_NORMAL_MAP])},{text:"Satellite",handler:this.changeView.createDelegate(this,[G_SATELLITE_MAP])},{text:"Hybrid",handler:this.changeView.createDelegate(this,[G_HYBRID_MAP])}],listeners:{render:{fn:function(G){this.active=0},scope:this},hide:{fn:function(G){this.active=0},scope:this},mouseover:{fn:function(G,I,H){this.active=1},scope:this}}},listeners:{menutriggerover:{fn:function(H,G,I){this.active=0;if(!H.hasVisibleMenu()){H.showMenu()}},scope:this,buffer:50},menutriggerout:{fn:function(H,G,I){if(!this.active){H.hideMenu()}},scope:this,buffer:50}}}],items:[{xtype:"gmappanel",id:"bsimap",scope:this,region:"center",style:"border:solid #000;border-width:1px 1px 0 0;",zoomLevel:5,icon:this.icon,gmapType:"map",mapConfOpts:["enableScrollWheelZoom","enableDoubleClickZoom","enableDragging"],mapControls:["GSmallMapControl"],setCenter:{lat:36.743313,lng:-119.789382},listeners:{render:{fn:function(G){G.el.mask();Ext.Ajax.request({url:this.url,params:"method=map.load",method:"POST",c:G,scope:this,callback:function(I,K,J){if(K==true){var H=Ext.decode(J.responseText);if(H.data.success){this.marks=I.c.addMarkers(H.data.data)}}else{Ext.ux.onServerFailure(I,J)}G.el.unmask()}})},scope:this}}},{id:"map-btq-preview-wrapper",region:"east",autoScroll:true,split:true,useSplitTips:true,collapsible:true,collapseMode:"mini",width:175,minWidth:175,maxWidth:175,border:false,items:[{id:"map-btq-preview",border:false,style:"color:#365F91;font-size:125%;padding:20px 10px;",html:"Click map markers to preview boutiques and see street view images of their neighborhood."}],buttonAlign:"center",buttons:[{text:"Open Boutique",disabled:true,handler:function(G,H){},scope:this}]}],listeners:{render:{fn:function(G){},scope:this}}})}C.show()},changeView:function(A){Ext.getCmp("bsimap").getMap().setMapType(A)},panTo:function(C,A,B){Ext.getCmp("bsimap").getMap().setCenter(new GLatLng(C,A),B)},streetViewOverlay:function(){Ext.getCmp("bsimap").getMap().setCenter(new GLatLng(lat,lng),16)},onClick:function(A,C,B){if(this.markerOn.nid!=B.nid){if(this.markerOn.mark){this.markerOn.mark.setImage(this.icon.image)}this.markerOn={nid:B.nid,mark:C};this.showDetails(B)}this.openStreetView(A,C,B)},openStreetView:function(C,F,E){var B=document.createElement("div");B.style.textAlign="left";B.style.width="400px";B.style.height="230px";B.innerHTML='<b style="font-size:12px">'+E.title+"</b>";var A=document.createElement("div");A.style.textAlign="center";A.style.width="400px";A.style.height="200px";panorama=new GStreetviewPanorama(A);panorama.setLocationAndPOV(C,null);B.appendChild(A);F.openInfoWindow(B)},onMouseover:function(B,A){if(this.markerOn.nid!=A.nid){B.setImage(this.iconOver.image)}},onMouseout:function(B,A){if(this.markerOn.nid!=A.nid){B.setImage(this.icon.image)}},showDetails:function(B){var A=Ext.getCmp("map-btq-preview-wrapper");var F=Ext.getCmp("map-btq-preview");A.body.hide();F.body.hide();F.destroy();A.remove("map-btq-preview,true");var E=new Ext.Panel({id:"map-btq-preview",cls:"map-btq-preview",border:false});var G=B.imgs[0].title;if(G==""){G=B.name}var C=new Ext.Panel({border:false,defaults:{border:false},items:[{style:"text-align:center;padding-top:10px;;",html:'<img src="files/imagecache/boutique120x90/'+B.imgs[0].filepath+'" style="border:1px solid #ccc;padding:5px;" qtip="<b>'+G+"</b.<br/>"+B.desc+'">'},{style:"text-align:center;font-weight:bold;padding:10px 0 5px;",html:B.name},{html:B.about}]});E.add(C);E.doLayout();A.add(E);A.doLayout();A.body.show();A.buttons[0].setHandler(function(H,I){this.app.getModule("btq-win").createWindow({hood:B.hood,name:B.name,merchantId:B.nid,scope:this})},this);A.buttons[0].enable();E.body.fadeIn({stopFx:true,duration:0.5})}});QoDesk.HomeWindow=Ext.extend(Ext.app.Module,{moduleId:"home-win",first:1,url:Bsi.URL_BASE+Bsi.URL_SRVCS,init:function(){this.launcher={text:"Explore",shortcutIconCls:"home-shortcut-icon",handler:this.createWindow,scope:this}},createWindow:function(C){var E=this.app;var P=this.app.getDesktop();var I=P.getWindow("home-win");if(!I){var G=new Ext.XTemplate('<div class="hoodthumbs clearfix">','<tpl for=".">','<div class="hood-thumbs ">','<div class="thumb-wrap {cls} clearfix">','<div class="brds">','<img id="{id}" src="inc/s/home-win/images/LoadingImgs.png">',"</div>",'<div class="bgImg" qtip="{tip}"></div>',"</div>","</div>","</tpl>","</div>");var J=[{id:"sanFranciscoImg",lnk:"area-SF_Bay_Area",cls:"sanFranciscoArea",tip:"<b>San Francisco Bay Area</b><br/> &nbsp; &nbsp; - San Francisco<br/> &nbsp; &nbsp; - Marin<br/> &nbsp; &nbsp; - Peninsula<br/> &nbsp; &nbsp; - Wine Country<br/>"},{id:"losAngelesImg",lnk:"area-LA_Metro_Area",cls:"losAngelesArea",tip:"<b>Los Angeles Metro Area</b><br/> &nbsp; &nbsp; - Westside<br/> &nbsp; &nbsp; - Mid-City<br/> &nbsp; &nbsp; - Orange County<br/>"},{id:"shop4CauseImg",lnk:"hood-Shop_4_Cause",cls:"shop4CauseArea",tip:"<b>Explore Boutiques where you can shop for a cause</b>"}];this.loopImages=function(Q){Q.fadeOut({endOpacity:0,easing:"easeOut",duration:1,useDisplay:true,callback:function(R){if(R&&R.recs&&R.recs[R.i]){R.dom.src=R.recs[R.i++].data.url;R.fadeIn({endOpacity:1,easing:"easeOut",duration:3,callback:function(S){if(S&&S.recs){if(S.i==S.recs.length){S.i=0}if(S.recs.length>1){this.loopImages.defer(3000,this,[S])}}},scope:this})}},scope:this})};var N=new Ext.DataView({tpl:G,singleSelect:true,overClass:"x-view-over",itemSelector:"div.hood-thumbs",store:new Ext.data.JsonStore({fields:["id","lnk","cls","tip"],data:J}),listeners:{render:{fn:function(Q){new Ext.data.JsonStore({url:"inc/s/home-win/get-images.php",baseParams:{dir:"SanFrancisco"},root:"images",fields:["name","fname","url",{name:"size",type:"float"},{name:"lastmod",type:"date",dateFormat:"timestamp"}],id:"sanFranciscoImg",listeners:{load:{fn:function(R,T,S){var U=Ext.get(R.id);if(U){U.recs=T;U.i=0;this.loopImages(U)}},scope:this}}}).load();new Ext.data.JsonStore({url:"inc/s/home-win/get-images.php",baseParams:{dir:"LosAngeles"},root:"images",fields:["name","fname","url",{name:"size",type:"float"},{name:"lastmod",type:"date",dateFormat:"timestamp"}],id:"losAngelesImg",listeners:{load:{fn:function(R,T,S){var U=Ext.get(R.id);if(U){U.recs=T;U.i=0;this.loopImages(U)}},scope:this}}}).load();new Ext.data.JsonStore({url:"inc/s/home-win/get-images.php",baseParams:{dir:"Shop4Cause"},root:"images",fields:["name","fname","url",{name:"size",type:"float"},{name:"lastmod",type:"date",dateFormat:"timestamp"}],id:"shop4CauseImg",listeners:{load:{fn:function(R,T,S){var U=Ext.get(R.id);if(U){U.recs=T;U.i=0;this.loopImages(U)}},scope:this}}}).load()},scope:this},click:{fn:function(T,R,U,S){var Q=T.store.data.items[R].data.lnk;if(Q){this.linkTo(Q)}},scope:this}}});I=P.createWindow({id:"home-win",title:"Where Would You Like to Shop Today?",cls:"x-window-tbar-clean",width:600,height:500,border:false,autoScroll:true,layout:"border",defaults:{border:false},items:[{region:"north",style:"padding:35px 0 15px;text-align:center;height:62px;",html:'<img src="inc/s/home-win/images/WhereTagLine.png">'},{region:"center",cls:"hoodArea",style:"padding-top:25px;",defaults:{border:false},items:[N]},{region:"south",height:100,style:"padding:10px;",layout:"column",defaults:{border:false},items:[{columnWidth:0.33,cls:"twitterWrap",items:[{xtype:"button",cls:"twitter",text:"",tooltip:"http://twitter.com/<b>BoutiqueStreet</b><br/>Get news first hand from local boutiques!",handler:function(Q,R){Bsi.analytics.trackPageview({type:"twtr"});window.open("http://www.twitter.com/BoutiqueStreet","twtr")},scope:this}]},{columnWidth:0.33,cls:"shareWrap",items:[{xtype:"button",cls:"share",text:"",tooltip:"Share BoutiqueStreet.com with friends!",handler:function(Q,R){this.app.getModule("share-win").createWindow({hood:["Shop 4 Cause"],name:"In Her Shoes 4 Cause",merchantId:"630",scope:this})},scope:this}]},{columnWidth:0.33,cls:"facebookWrap",items:[{xtype:"button",cls:"facebook",text:"",tooltip:"Join the BoutiqueStreet.com group on facebook!",handler:function(Q,R){Bsi.analytics.trackPageview({type:"fb"});window.open("http://www.facebook.com/group.php?gid=77711688020","facebook")},scope:this}]}]}]});if(this.first){this.first=0;I.center();var M=I.getPosition();var F=Ext.get("webtop-logo");var L=F.getRight();var K=this.app.getDesktop();var H=K.el.getWidth(true);var A=I.el.getWidth();var O=310;var B=15;if(H>=(A+O+B+L)){M[0]=((H-(A+O+B+L))/2)+L}else{if(H>=(A+O+B)){M[0]=(H-(A+O+B))/2}else{M[0]=B}}if(M[1]<38){M[1]=38}I.setPosition(M[0],M[1])}else{I.center();var M=I.getPosition();if(M[1]<38){M[1]=38}I.setPosition(M[0],M[1])}}I.show()},linkTo:function(B){this.app.getModule("hood-win").createWindow();var A=Ext.getCmp("neighborhoods").getNodeById(B);A.select();Ext.getCmp("boutiques").loadPanel(A)}});QoDesk.NeighborhoodWindow=Ext.extend(Ext.app.Module,{moduleId:"hood-win",active:0,url:Bsi.URL_BASE+Bsi.URL_SRVCS,init:function(){this.launcher={text:"Explore",shortcutIconCls:"exp-shortcut-icon",handler:this.createWindow,scope:this}},createWindow:function(A){var C=this.app;var E=this.app.getDesktop();var B=E.getWindow("hood-win");if(!B){this.neighborhoods=new Ext.tree.TreePanel({id:"neighborhoods",region:"west",autoScroll:true,width:145,border:false,rootVisible:false,lines:false,animCollapse:false,animate:false,bodyStyle:"border-right:1px solid #eaeaea;",loader:new Ext.tree.TreeLoader({preloadChildren:true,clearOnLoad:false}),root:new Ext.tree.AsyncTreeNode({id:"root",expanded:true,children:Ext.generaldata.neighborhoods}),selectNeighborhood:function(J){if(J){var H=this.getNodeById(J);var F=[H.id];var I=H.parentNode;while(I){F.unshift(I.id);I=I.parentNode}var G="/";I=G+F.join(G);this.selectPath(I)}},listeners:{click:{fn:function(G,F){F.stopEvent();Ext.getCmp("boutiques").loadPanel(G)},scope:this},load:{fn:function(F){if(F.id=="root"){this.neighborhoods.expandAll();this.neighborhoods.collapseAll();F.expandChildNodes()}},scope:this}}});this.introText=new Ext.Panel({style:"color:#365F91;padding:10px;font-size:14px",border:false,html:"<p>Welcome to Neighborhood Navigation.</p><p>Click on an area, region or neighborhood in the menu above to open corresponding tabs, which contain location descriptions and boutique thumbnails.</p>"});this.boutiques=new Ext.TabPanel({id:"boutiques",cls:"x-tab-strip-clean",neighborhoods:this.neighborhoods,region:"center",tabWidth:100,minTabWidth:100,plugins:new Ext.ux.plugin.TabCloseMenu(),enableTabScroll:true,border:false,activeTab:0,items:{id:"hood-home",title:"Intro",layout:"border",items:[{border:false,autoScroll:true,region:"center",items:this.introText}]},loadPanel:function(H){var G=this.getComponent(H.id);if(G){this.setActiveTab(G)}else{var I=this.add({id:H.id,border:false,title:H.id.replace(/[^-]*-/,"").replace(/_/g," "),layout:"fit",closable:true,defaults:{border:false}}).show();var F=new Ext.LoadMask(I.getEl(),{msg:"Loading Boutiques..."});F.show();I.add({border:false,layout:"fit",items:[{xtype:"hoodPanel",node:H,app:C,neighborhoods:this.neighborhoods,hoodMask:F}]});I.doLayout()}},listeners:{tabchange:{fn:function(G,F){if(F.id=="hood-home"){if(this.neighborhoods.selModel.selNode){this.neighborhoods.selModel.selNode.unselect()}}else{this.neighborhoods.selectNeighborhood(F.id)}},scope:this}}});B=E.createWindow({id:"hood-win",title:"Where Would You Like to Shop Today?",cls:"x-window-tbar-clean",width:600,height:510,border:false,layout:"border",defaults:{border:false},items:[this.neighborhoods,this.boutiques]})}B.show()}});Ext.ns("Ext.ux");Ext.ux.NeighborhoodPanel=Ext.extend(Ext.Panel,{initComponent:function(){Bsi.analytics.trackPageview({type:"btqs",data:{id:this.node.id}});this.url=Bsi.URL_BASE+Bsi.URL_SRVCS;this.getDefaultLayout();Ext.apply(this,{layout:this.layout||"border",border:this.border||false,defaults:this.defaults||{border:false},items:this.items||this.defaultLayout});Ext.ux.NeighborhoodPanel.superclass.initComponent.apply(this,arguments)},initTemplates:function(){this.thumbTemplate=new Ext.XTemplate('<div class="btqThumbs"><tpl for="."><div class="hood-area clearfix"><div class="btq-thumbs<tpl if="publish == 0"> publish0</tpl> nid-{nid}"><div class="thumb-wrap"><div class="thumb"><img src="files/imagecache/boutique120x90/{values.pic.path}" qtip="<b>{name}</b><br>{desc}"></div><div class="info clearfix"><table><tbody><tr><td class="name" qtip="<b>{name}</b><br>{desc}">{[values.name.ellipse(19)]}</td></tr><tr><td class="desc" qtip="<b>{name}</b><br>{desc}">{shortDesc}</td></tr></tbody></table></div></div></div></div></tpl></div>');this.thumbTemplate.compile()},initRecord:function(){this.record=new Ext.data.Record.create([{name:"publish",mapping:"publish"},{name:"head",mapping:"head"},{name:"name",mapping:"name"},{name:"nameLC",mapping:"nameLC"},{name:"nid",mapping:"nid"},{name:"desc",mapping:"desc"},{name:"hood",mapping:"hood"},{name:"pic",mapping:"pic"}])},initStore:function(){this.stores={};this.store=new Ext.data.Store({reader:new Ext.data.JsonReader({root:"data"},this.record),listeners:{load:{fn:function(A,C,B){},scope:this,single:true}}})},formatData:function(A){A.shortDesc=A.desc.ellipse(40);A.name=A.name.replace(/"/g,"&quot;").replace(/'/g,"&#039;");A.desc=A.desc.replace(/"/g,"&quot;").replace(/'/g,"&#039;");return A},initView:function(){this.view=new Ext.DataView({tpl:this.thumbTemplate,singleSelect:true,overClass:"x-view-over",itemSelector:"div.btq-thumbs",loadingText:'<div class="loading-indicator">loading...</div>',store:this.store,prepareData:this.formatData.createDelegate(this),prevInit:-1,listeners:{selectionchange:{fn:function(E,B){if(B.length>0){var A=E.getSelectedNodes();var C=E.getSelectedRecords();var F=E.getSelectedRecords()[0].data;this.showBoutique(F)}},scope:this,buffer:100},loadexception:{fn:this.onLoadException,scope:this},beforeselect:{fn:function(A){return A.store.getRange().length>0}}}})},showBoutique:function(A){this.app.getModule("btq-win").createWindow({hood:A.hood,name:A.name,merchantId:A.nid,scope:this})},showDetails:function(A,H){if(A&&A.length>0){selNode=A[0];var E=/nid-(\d+)/;var C=E.exec(selNode.className);var F=true;if(F){this.previewWrap.body.hide();this.preview.body.hide();var G=H[0].data;this.preview.destroy();this.previewWrap.remove(this.preview,true);this.preview=new Ext.Panel({autoScroll:true,bodyStyle:"padding:10px",border:false});this.preview.add({xtype:"panel",border:false,style:"padding-bottom:5px;text-align:center;font-weight:bold;color:#444;font-size:125%",html:G.name});this.preview.add({xtype:"panel",id:"n-boutique-preview",border:false,tbar:[{text:'<img style="margin-top:4px;margin-bottom:2px;" src="'+G.pic.path+'">',tooltip:G.pic.title,scope:this,handler:function(I,J){var K=this.view.getSelectedRecords()[0].data;this.showBoutique(K)}}]});var B=new Ext.Panel({border:false,style:"padding-top:5px;color#444;",html:G.desc});this.preview.add(B);this.preview.doLayout();this.previewWrap.add(this.preview);this.previewWrap.doLayout();this.previewWrap.body.show();this.preview.body.fadeIn({stopFx:true,duration:0.5})}}else{}},filter:function(A){if(this.view){this.view.store.filter("name",A)}},getDefaultLayout:function(){this.preview=new Ext.Panel({id:"n-boutique-preview",autoScroll:true,bodyStyle:"padding:10px",border:false,html:"Click on a "+this.node.attributes.text+" boutique to view a preview here"});this.previewWrap=new Ext.Panel({region:"center",border:false,layout:"fit",items:this.preview,buttonAlign:"center",buttons:[{text:"Open Store Window",scope:this,handler:function(A,C){var B=this.view.getSelectedRecords()[0];if(B){this.showBoutique(B.data)}}}]});this.previewTab=new Ext.Panel({title:"preview",layout:"border",border:false,items:this.previewWrap});this.eastArea=new Ext.Panel({region:"east",split:true,useSplitTips:true,collapsible:true,collapseMode:"mini",collapsed:true,animCollapse:false,width:155,minWidth:155,maxWidth:155,border:false,autoScroll:true,defaults:{border:false},listeners:{render:function(A){Ext.Ajax.request({url:this.url,params:"method=neighborhood.info&tid="+this.node.attributes.tid,method:"POST",scope:this,callback:function(C,H,G){if(H==true){var B=Ext.decode(G.responseText);A.add({style:"color:#365F91;font-size:125%;padding:8px 10px 10px;text-align:center;",html:this.node.attributes.text});if(B.data.success!=true){A.doLayout()}else{if(B.data.msg.imgs!=Bsi.BLANK_STRIPES){var F=B.data.msg.imgs[0].title;if(F==""){F=this.node.attributes.text}var E='<img src="files/imagecache/neighborhood120x90/'+B.data.msg.imgs[0].filepath+'" style="border:1px solid #ccc;padding:5px;" qtip="<b>'+F+'</b>">';A.add({style:"text-align:center",html:E})}A.add({style:"padding:10px;",html:B.data.msg.desc});A.doLayout();A.body.hide();A.expand();A.body.fadeIn({stopFx:true,duration:2})}}else{Ext.ux.onServerFailure(C,G)}}})},scope:this}});this.centerArea=new Ext.Panel({region:"center",autoScroll:true,listeners:{render:function(A){this.populateView(A)},scope:this}});this.defaultLayout=[this.centerArea,this.eastArea]},addStores:function(C){if(C.stores){var B;for(var A=0;A<C.stores.length;A++){B=C.stores[A];if(!this.stores[B.nid]){this.stores[B.nid]=B;this.store.add([new this.record({publish:B.publish,head:B.head,name:B.name,nameLC:B.name.toLowerCase(),nid:B.nid,desc:B.desc,hood:B.hood,pic:B.pic})])}}}},onRenderAAA:function(){Ext.ux.NeighborhoodPanel.superclass.onRender.apply(this,arguments)},initEventsAAA:function(){},afterRenderAAA:function(){Ext.ux.NeighborhoodPanel.superclass.afterRender.apply(this,arguments)},beforeDestroyAAA:function(){},onDestroyAAA:function(){},getHoodData:function(E,A){if(A.leaf){if(A.id==E){return A}}else{if(A.id==E){return A}if(A.children){var B;for(var C=0;C<A.children.length;C++){if(B=this.getHoodData(E,A.children[C])){return B}}}}},cleanHoodData:function(A){if(A.leaf){A.loader="";return A}else{if(A.children){var B;for(var C=0;C<A.children.length;C++){this.cleanHoodData(A.children[C])}}A.loader="";return A}},populateView:function(G){var I=10;var J=new Array(this.node.text);var H=this.node.parentNode;while(I&&(H.id!="root")){I--;J.push(H.text);H=H.parentNode}var A=J.reverse().join(" &nbsp;>&nbsp; ");this.centerArea.add({xtype:"panel",border:false,defaults:{border:false},style:"color:#365F91;font-size:125%;padding:8px 10px 0px;",html:A});this.centerArea.doLayout();if(this.node.attributes.comingSoon==1){var C=this.node.attributes.text;this.centerArea.add({xtype:"panel",border:false,defaults:{border:false},style:"text-align:center;padding-top:40px;",html:'<img qtip="Will be adding boutiques in '+C+' soon" src="inc/s/btq-panel/images/comingSoon.gif"/>'});this.centerArea.doLayout()}else{var B;for(var F=0;F<Ext.generaldata.neighborhoods.length;F++){B=this.getHoodData(this.node.attributes.id,Ext.generaldata.neighborhoods[F]);if(B){this.cleanHoodData(B);break}}var E=Ext.encode({data:B});Ext.Ajax.request({url:this.url,params:"method=neighborhood.load&data="+E,method:"POST",scope:this,callback:function(K,T,N){if(T==true){var Q=Ext.decode(N.responseText);var M=Q.data;this.initTemplates();this.initRecord();this.initStore();this.initView();this.centerArea.add({xtype:"panel",border:false,items:this.view});if(M.children){var R=/([^-]*)-(.*)/;var L=R.exec(M.id);if(L[1]=="rgn"){for(var P=0;P<M.children.length;P++){this.addStores(M.children[P])}}else{if(L[1]=="area"){var S;for(var P=0;P<M.children.length;P++){S=M.children[P];if(S.children){for(var O=0;O<S.children.length;O++){this.addStores(S.children[O])}}}}}}else{this.addStores(M)}this.store.sort("nameLC","ASC");this.stores={};this.centerArea.doLayout()}else{Ext.ux.onServerFailure(K,N)}this.hoodMask.hide()}})}}});Ext.reg("hoodPanel",Ext.ux.NeighborhoodPanel);QoDesk.CategoryWindow=Ext.extend(Ext.app.Module,{moduleId:"cat-win",first:1,url:Bsi.URL_BASE+Bsi.URL_SRVCS,init:function(){this.launcher={text:"Category",shortcutIconCls:"cat-shortcut-icon",handler:this.createWindow,scope:this}},createWindow:function(A){var C=this.app;var E=this.app.getDesktop();var B=E.getWindow("cat-win");if(!B){B=E.createWindow({id:"cat-win",title:"Category of Products and Boutiques",cls:"x-window-tbar-clean",width:400,height:500,border:false,layout:"fit",items:[{id:"categories",border:false,autoScroll:true,bodyStyle:"padding:10px 0 0 40px;",defaults:{border:false},items:[{style:"font-weight:bold;color:#365F91;font-size:14px;padding-bottom:5px;",html:"Shop 4 Cause"},{style:"padding-left:20px;",items:[{xtype:"button",text:"In Her Shoes 4 Cause",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Shop 4 Cause"],name:"In Her Shoes 4 Cause",merchantId:"630",scope:this})},scope:this},{xtype:"button",text:"Trade As One",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Shop 4 Cause"],name:"Trade As One",merchantId:"629",scope:this})},scope:this}]},{style:"font-weight:bold;color:#365F91;font-size:14px;padding:10px 0 5px;",html:"Women&#039;s Clothing &amp; Accessories"},{style:"padding-left:20px;",items:[{xtype:"button",text:"Adriana Fitness Fashion, Brentwood",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Brentwood"],name:"Adriana Fitness Fashion",merchantId:"700",scope:this})},scope:this},{xtype:"button",text:"Cassis, Palo Alto",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Palo Alto"],name:"Cassis",merchantId:"406",scope:this})},scope:this},{xtype:"button",text:"In Her Shoes, Palo Alto",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Palo Alto"],name:"In Her Shoes",merchantId:"249",scope:this})},scope:this},{xtype:"button",text:"Josef Boutique, San Mateo",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["San Mateo"],name:"Josef Boutique",merchantId:"626",scope:this})},scope:this},{xtype:"button",text:"Leaf &amp; Petal, Palo Alto",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Palo Alto"],name:"Leaf &amp; Petal",merchantId:"405",scope:this})},scope:this},{xtype:"button",text:"Mill Valley Hatbox, Mill Valley",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Mill Valley"],name:"Mill Valley Hatbox",merchantId:"187",scope:this})},scope:this},{xtype:"button",text:"Pamela Barish, Venice",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Venice"],name:"Pamela Barish",merchantId:"581",scope:this})},scope:this},{xtype:"button",text:"Parker Pettit, Venice",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Venice"],name:"Parker Pettit",merchantId:"844",scope:this})},scope:this},{xtype:"button",text:"Pink Tangerine, Menlo Park",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Menlo Alto"],name:"Pink Tangerine",merchantId:"531",scope:this})},scope:this},{xtype:"button",text:"Polkadots & Moonbeams, West Hollywood",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["West Hollywood"],name:"Polkadots & Moonbeams",merchantId:"724",scope:this})},scope:this},{xtype:"button",text:"Polkadots & Moonbeams Vintage, West Hollywood",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["West Hollywood"],name:"Polkadots & Moonbeams Vintage",merchantId:"725",scope:this})},scope:this},{xtype:"button",text:"Romi Boutique, Palo Alto",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Palo Alto"],name:"Romi",merchantId:"384",scope:this})},scope:this},{xtype:"button",text:"Romi Boutique, San Francisco",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["San Francisco"],name:"Romi",merchantId:"624",scope:this})},scope:this},{xtype:"button",text:"Sportago, St. Helena",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["St Helena"],name:"Sportago for Women",merchantId:"339",scope:this})},scope:this},{xtype:"button",text:"Switch, Beverly Hills",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Beverly Hills"],name:"Switch",merchantId:"810",scope:this})},scope:this},{xtype:"button",text:"Vian Hunter, Palo Alto",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Palo Alto"],name:"Vian Hunter",merchantId:"404",scope:this})},scope:this}]},{style:"font-weight:bold;color:#365F91;font-size:14px;padding:10px 0 5px;",html:"Men&#039;s Clothing &amp; Accessories"},{style:"padding-left:20px;",items:[{xtype:"button",text:"Sportago, St. Helena",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["St Helena"],name:"Sportago for Men",merchantId:"338",scope:this})},scope:this},{xtype:"button",text:"Mill Valley Hatbox, Mill Valley",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Mill Valley"],name:"Mill Valley Hatbox",merchantId:"187",scope:this})},scope:this}]},{style:"font-weight:bold;color:#365F91;font-size:14px;padding:10px 0 5px;",html:"Kids"},{style:"padding-left:20px;",items:[{xtype:"button",text:"gumshoe, Burlingame",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Burlingame"],name:"gumShoe",merchantId:"340",scope:this})},scope:this},{xtype:"button",text:"Le Cirque, Menlo Park",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Menlo Park"],name:"Le Cirque",merchantId:"337",scope:this})},scope:this}]},{style:"font-weight:bold;color:#365F91;font-size:14px;padding:10px 0 5px;",html:"Home Decor"},{style:"padding-left:20px;",items:[{xtype:"button",text:"Jak Home, Polk",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Polk"],name:"Jak Home",merchantId:"623",scope:this})},scope:this},{xtype:"button",text:"Maison R&#234;ve, Mill Valley",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Mill Valley"],name:"Maison R&#234;ve",merchantId:"737",scope:this})},scope:this},{xtype:"button",text:"View from the Terrace, Palo Alto",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Palo Alto"],name:"View from the Terrace",merchantId:"572",scope:this})},scope:this}]},{style:"font-weight:bold;color:#365F91;font-size:14px;padding:10px 0 5px;",html:"Gourmet"},{style:"padding-left:20px;",items:[{xtype:"button",text:"Wine Garage, Calistoga",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Calistoga"],name:"Wine Garage",merchantId:"237",scope:this})},scope:this}]},{style:"font-weight:bold;color:#365F91;font-size:14px;padding:10px 0 5px;",html:"Beauty Products"},{style:"padding-left:20px;",items:[{xtype:"button",text:"Heaven and Earth, St. Helena",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["St Helena"],name:"Heaven &amp; Earth",merchantId:"385",scope:this})},scope:this}]},{style:"padding-left:20px;",items:[{xtype:"button",text:"Kevin Josephson Salon, Beverly Hills",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Beverly Hills"],name:"Kevin Josephson Salon",merchantId:"692",scope:this})},scope:this}]},{style:"font-weight:bold;color:#365F91;font-size:14px;padding:10px 0 5px;",html:"Pets"},{style:"padding-left:20px;",items:[{xtype:"button",text:"Alpha Dog, Mill Valley",handler:function(F,G){this.app.getModule("btq-win").createWindow({hood:["Mill Valley"],name:"Alpha Dog",merchantId:"185",scope:this})},scope:this}]},{style:"padding-bottom:20px;",html:""}]}]})}B.show()}});Ext.app.SearchField=Ext.extend(Ext.form.TwinTriggerField,{initComponent:function(){Ext.app.SearchField.superclass.initComponent.call(this);this.on("specialkey",function(A,B){if(B.getKey()==B.ENTER){this.onTrigger2Click()}},this)},validationEvent:false,validateOnBlur:false,trigger1Class:"x-form-clear-trigger",trigger2Class:"x-form-search-trigger",hideTrigger1:true,width:180,hasSearch:false,paramName:"query",onTrigger1Click:function(){if(this.hasSearch){this.el.dom.value="";this.triggers[0].hide();this.hasSearch=false;this.focus()}},onTrigger2Click:function(){var E=this.getRawValue();if(E.length<1){Ext.Msg.alert("Invalid Search","You must enter a minimum of 3 characters to search products");this.onTrigger1Click();return }if(E.length<3){Ext.Msg.alert("Invalid Search","You must enter a minimum of 3 characters to search products");return }var C=Ext.getCmp("srch-numPerPage").getValue();var B=Ext.getCmp("searchTabs");var F=B.add({title:E,border:false,tabTip:E,tabWidth:50,closable:true,layout:"fit"}).show();F.body.hide();var A=new Ext.LoadMask(F.getEl(),{msg:"Searching..."});A.show();F.add({border:false,layout:"fit",items:new Ext.ux.SearchPanel({query:E,numPerPage:C,app:this.scope.app,srchMask:A})});F.doLayout();this.hasSearch=true;this.triggers[0].show();this.focus()}});QoDesk.SearchWindow=Ext.extend(Ext.app.Module,{moduleId:"srch-win",first:1,url:Bsi.URL_BASE+Bsi.URL_SRVCS,init:function(){this.launcher={text:"Search",shortcutIconCls:"srch-shortcut-icon",handler:this.createWindow,scope:this}},createWindow:function(A){var C=this.app;var E=this.app.getDesktop();var B=E.getWindow("srch-win");if(!B){B=E.createWindow({id:"srch-win",title:"Search for Products or Boutiques",cls:"x-window-tbar-clean",width:725,height:500,border:false,layout:"border",defaults:{border:false},items:[{region:"north",height:55,border:false,bodyStyle:"padding-top:15px;",layout:"column",defaults:{border:false},items:[{columnWidth:0.5,html:"&nbsp;"},{width:250,items:new Ext.app.SearchField({width:230,emptyText:"Search here...",scope:this})},{width:130,items:[{xtype:"combo",id:"srch-numPerPage",border:false,width:130,listWidth:130,allowBlank:false,labelSeparator:"",mode:"local",editable:false,triggerAction:"all",displayField:"disp",valueField:"n",emptyText:"Number per page",title:"Number per page",plugins:new Ext.ux.plugin.triggerfieldTooltip(),tooltip:{text:"Number Per Page"},store:new Ext.data.SimpleStore({fields:["n","disp"],data:[[10,"10 per page"],[25,"25 per page"],[50,"50 per page"],[100,"100 per page"]]}),listeners:{render:{fn:function(F){F.setValue(10)},scope:this}}}]},{columnWidth:0.5,html:"&nbsp;"}]},{xtype:"tabpanel",region:"center",id:"searchTabs",cls:"x-tab-strip-clean",border:false,tabWidth:50,plugins:new Ext.ux.plugin.TabCloseMenu(),enableTabScroll:true,activeTab:0,deferredRender:false,layoutOnTabChange:true,defaults:{border:false,tabWidth:50},items:[{title:"Intro",style:"color:#365F91;font-size:14px;",bodyStyle:"padding:20px;",html:"<p>Enter search criteria above and get results in a new tab here.</p>"}]}]})}B.show()}});Ext.ns("Ext.ux");Ext.ux.SearchPanel=Ext.extend(Ext.Panel,{initComponent:function(){this.prevInit=0;this.url=Bsi.URL_BASE+Bsi.URL_SRVCS;this.getDefaultTbar();this.getDefaultLayout();Ext.apply(this,{layout:this.layout||"border",border:this.border||false,defaults:this.defaults||{border:false},items:this.items||this.defaultLayout});Ext.ux.SearchPanel.superclass.initComponent.apply(this,arguments)},initTemplates:function(){this.thumbTemplate=new Ext.XTemplate('<div class="productThumbs srchProductThumbs clearfix">','<tpl for=".">','<div class="product-thumbs srch-product-thumbs nid-{nid}-{uniq}-srch clearfix">','<div class="thumb-wrap">','<div class="srchInfo clearfix">',"<table><tbody>","<tr>",'<td colspan=2 class="title"><a href="#" class="store-link" qtip="Click to go to the <b>{storeName}</b> boutique">{[values.storeName.ellipse(23)]}</a></td>',"</tr>","<tr>",'<td class="in">in</td>','<td class="title"><a href="#" class="hood-link" qtip="Click to explore more <b>{hoodName}</b> boutiques">{[values.hoodName.ellipse(23)]}</a></td>',"</tr>","</tbody></table>","</div>",'<div class="thumb clearfix">',"{imgTH}","</div>",'<div class="info clearfix">',"<table><tbody>","<tr>",'<td colspan=2 class="title">{[values.title.ellipse(23)]}</td>',"</tr>","<tr>",'<td class="price">{[values.display_price.ellipse(15)]}</td>','<td class="details"><a href="#" class="details-link" qtip="Click to zoom and for more details">Zoom</a></td>',"</tr>","</tbody></table>","</div>","</div>","</div>","</tpl>","</div>");this.thumbTemplate.compile()},initRecord:function(){this.record=new Ext.data.Record.create([{name:"publish",mapping:"publish"},{name:"display_price",mapping:"display_price"},{name:"sell_price",mapping:"sell_price"},{name:"imgs",mapping:"imgs"},{name:"nid",mapping:"nid"},{name:"title",mapping:"title"},{name:"description",mapping:"description"},{name:"order",mapping:"order"},{name:"sku",mapping:"sku"},{name:"attributes",mapping:"attributes"},{name:"options",mapping:"options"},{name:"qty",mapping:"qty"},{name:"zone",mapping:"zone"},{name:"taxrate",mapping:"taxrate"},{name:"store",mapping:"store"},{name:"hood",mapping:"hood"},{name:"type",mapping:"type"},{name:"uniq",mapping:"uniq"}])},initStore:function(){this.store=new Ext.data.Store({reader:new Ext.data.JsonReader({root:"data.products"},this.record),listeners:{load:{fn:function(C,F,E){if(F[0].data.nid!=0){var A=new Ext.ux.dd.ProdDragZone(this.view,{containerScroll:true,ddGroup:"prodDD"})}var G;for(var B=0;B<F.length;B++){G=F[B].data;Ext.select(".nid-"+G.nid+"-"+G.uniq+"-srch").on({click:{fn:function(H){this.prodHandler(H)},scope:this}})}this.view.select(0);if(this.prevInit==0){this.prevInit=1;this.srchMask.hide();this.body.fadeIn({stopFx:true,duration:0.5,callback:function(H){this.prevExpand(this.eastArea)},scope:this})}},scope:this}}})},formatData:function(A){A.title=A.title.replace(/"/g,"&quot;").replace(/'/g,"&#039;");A.storeName=A.store.name.replace(/"/g,"&quot;").replace(/'/g,"&#039;");A.hoodName=A.store.hood.replace(/"/g,"&quot;").replace(/'/g,"&#039;");if(A.imgs==Bsi.BLANK_STRIPES){A.imgTH="<em></em>"}else{A.imgTH='<em><img src="files/imagecache/product150/'+A.imgs[0].filepath+'" qtip="<b>'+A.title+"</b><br><b>"+A.display_price+'</b><br>Click to see preview on the right or<br>Drag &amp; Drop into open shopping cart"></em>'}return A},initView:function(){this.view=new Ext.DataView({tpl:this.thumbTemplate,singleSelect:true,overClass:"x-view-over",itemSelector:"div.product-thumbs",loadingText:'<div class="loading-indicator">loading...</div>',store:this.store,prepareData:this.formatData.createDelegate(this),prevInit:-1,listeners:{selectionchange:{fn:function(E,B){if(B.length>0){var A=E.getSelectedNodes();var C=E.getSelectedRecords();var F=E.getSelectedRecords()[0].data;this.showDetails(B,this.view)}},scope:this,buffer:100},loadexception:{fn:this.onLoadException,scope:this},beforeselect:{fn:function(A){return A.store.getRange().length>0}}}})},prodHandler:function(F){var H=F.getTarget(".details-link");var G=this.view.getRecord(F.getTarget(".product-thumbs")).data;if(H){this.showProduct(G)}else{var C=F.getTarget(".store-link");if(C){this.app.getModule("btq-win").createWindow({hood:G.hood,name:G.store.name,merchantId:G.store.nid,scope:this})}else{var B=F.getTarget(".hood-link");if(B){this.app.getModule("hood-win").createWindow();var A="hood-"+G.store.hood.replace(/ /g,"_");var E=Ext.getCmp("neighborhoods").getNodeById(A);E.select();Ext.getCmp("boutiques").loadPanel(E)}}}},showProduct:function(A){if(A.nid!=0){A.storeName=A.store.name;A.hoodNames=A.hood;this.app.getModule("prod-win").createWindow({selRec:A,title:A.title})}},showDetails:function(S,L){var F=this.eastArea.getComponent(0);var J=F.getComponent(0);if(S&&S.length>0){S=S[0];var C=/nid-(\d+)/;var M=C.exec(S.className);var P=true;var H=J.body.child("div.thumb");if(H){P=!(H.hasClass(M[0]))}if(P){F.body.hide();J.body.hide();var R=this.view.getSelectedRecords()[0].data;R.title=R.title.replace(/"/g,"&quot;").replace(/'/g,"&#039;");if(R.imgs==Bsi.BLANK_STRIPES){R.imgTH="<em></em>"}else{R.imgTH='<em><img src="files/imagecache/product100/'+R.imgs[0].filepath+'" qtip="<b>'+R.title+'</b><br>Drag &amp; Drop into open shopping cart"></em>'}J.destroy();F.remove(J,true);var B=new Ext.Panel({data:R,cls:"product-preview",border:false,listeners:{render:{fn:function(U){this.eastArea.getComponent(0).buttons[0].setDisabled((U.data.nid==0))},scope:this}}});var G='<div class="product-details clearfix"><div class="thumb-wrap"><div class="thumb nid-'+R.nid+'">'+R.imgTH+'</div><div class="info clearfix"><table><tbody><tr><td class="title">'+R.title+'</td></tr><tr><td class="price">'+R.display_price+"</td></tr></tbody></table></div></div></div>";var E=new Ext.Panel({border:false,html:G});B.add(E);var T;var N;var K=new Array();if(R.attributes&&(R.attributes.length!=0)){for(var O in R.attributes){if(R.attributes[O].options.length!=0){K=new Array();for(var A in R.attributes[O].options){T=R.attributes[O].options[A].name;display_price="";N=0;if(R.attributes[O].options[A].price!=0){display_price=" $"+R.attributes[O].options[A].price;N=R.attributes[O].options[A].price}K.push(new Array(A,T,display_price,N))}B.add({border:false,style:"margin-bottom:10px;",items:[{xtype:"combo",border:false,width:110,listWidth:110,allowBlank:false,labelSeparator:"",mode:"local",editable:false,triggerAction:"all",displayField:"name",valueField:"name",emptyText:R.attributes[O].name,title:R.attributes[O].name,plugins:new Ext.ux.plugin.triggerfieldTooltip(),tooltip:{text:R.attributes[O].name},data:R,index:O,tpl:new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item">{name}{display_price}</div></tpl>'),store:new Ext.data.SimpleStore({fields:["oid","name","display_price","price"],data:K}),listeners:{render:{fn:function(U){if(U.data.options[U.index].name){U.setValue(U.data.options[U.index].name)}},scope:this},select:{fn:function(W,V,U){W.data.options[W.index]=W.data.attributes[W.index].options[V.data.oid]},scope:this}}}]})}}}var Q=[["1"],["2"],["3"],["4"],["5"]];B.add({border:false,style:"margin-bottom:6px;",items:[{xtype:"combo",border:false,width:50,listWidth:50,allowBlank:false,labelSeparator:"",mode:"local",editable:false,triggerAction:"all",displayField:"n",emptyText:"QTY",title:"QTY",plugins:new Ext.ux.plugin.triggerfieldTooltip(),tooltip:{text:"QUANTITY"},data:R,store:new Ext.data.SimpleStore({fields:["n"],data:Q}),listeners:{render:{fn:function(U){if(U.data.qty>0){U.setValue(U.data.qty)}},scope:this},select:{fn:function(W,V,U){W.data.qty=V.data.n},scope:this}}}]});B.add({border:false,cls:"prev-details-button",items:[{xtype:"button",iconCls:"icon-details-link",text:"Zoom",tooltip:"Click to zoom and for more details",data:R,scope:this,handler:function(U,V){var W=U.data;W.winTitle=this.title;this.showProduct(W)}}]});B.add({xtype:"panel",border:false,cls:"product-description",html:R.description});B.doLayout();F.add(B);F.doLayout();F.body.show();B.body.fadeIn({stopFx:true,duration:0.5});if(R.nid!=0){var I=new Ext.ux.dd.PrevDragSource(R,E.body.child("div.product-details"),{ddGroup:"prodDD"})}}}else{}},prevExpand:function(A){if(A.isVisible()){A.collapse()}else{A.body.hide();A.expand();A.body.fadeIn({stopFx:true,duration:2})}},filter:function(C){if(this.view){this.view.store.filter("title",C);var E,B=this.store.getRange();for(var A=0;A<B.length;A++){E=B[A].data;Ext.select(".nid-"+E.nid+"-"+E.uniq+"-srch").on({click:{fn:function(F){this.prodHandler(F)},scope:this}})}this.view.select(0)}},sortImages:function(){var A=Ext.getCmp("sortSelect-"+this.id).getValue();this.view.store.sort(A,A=="name"?"asc":"desc")},getDefaultLayout:function(){this.eastArea=new Ext.Panel({region:"east",style:"color:#000;",split:true,useSplitTips:true,collapsible:true,collapseMode:"mini",collapsed:true,animCollapse:false,width:175,minWidth:175,maxWidth:175,border:false,layout:"fit",defaults:{border:false},cls:"bbar-blackbar",items:[{xtype:"form",autoScroll:true,items:[{cls:"product-preview",border:false}],buttons:[{text:"Add to Shopping Cart",cls:"redBuyBtn",scope:this,handler:function(A,B){this.app.getModule("cart-win").createWindow({data:Ext.ux.clone(this.eastArea.getComponent(0).getComponent(0).data)})}}]}]});this.centerArea=new Ext.Panel({region:"center",cls:"x-panel-tbar-clean",tbar:this.defaultTbar,autoScroll:true,defaults:{border:false},listeners:{render:function(A){this.populateView(A)},scope:this}});this.defaultLayout=[this.centerArea]},getDefaultTbar:function(){this.defaultTbar=[{text:"&nbsp;",cls:"x-item-no-button"},"->",{text:"Page:",cls:"x-item-no-button",hidden:true},{xtype:"combo",hidden:true,border:false,width:50,listWidth:50,allowBlank:false,labelSeparator:"",mode:"local",editable:false,triggerAction:"all",displayField:"n",valueField:"i",emptyText:"Page",title:"Page",oVal:0,plugins:new Ext.ux.plugin.triggerfieldTooltip(),tooltip:{text:"Page Number"},store:new Ext.data.SimpleStore({fields:["i","n"],data:[[0,1]]}),listeners:{render:{fn:function(A){A.setValue(0)},scope:this},select:{fn:function(E,C,A){if(A!=E.oVal){E.oVal=A;var B=new Ext.LoadMask(this.centerArea.getEl(),{msg:"Searching..."});B.show();Ext.Ajax.request({url:this.url,params:"method=util.search&query="+this.query+"&numPerPage="+this.numPerPage+"&page="+A,method:"POST",srchPgrMask:B,scope:this,callback:function(H,J,I){if(J==true){var G=Ext.decode(I.responseText);var F=G.data.data.results;if(G.data.success){this.centerArea.topToolbar.items.items[0].setText(F.start_res+" - "+F.end_res+F.cnt_total+" for <b>"+this.query+"</b>");this.store.loadData(G.data)}this.centerArea.body.fadeIn({stopFx:true,duration:0.5})}else{Ext.ux.onServerFailure(H,I)}H.srchPgrMask.hide()}})}},scope:this}}}]},getHoodData:function(E,A){if(A.leaf){if(A.id==E){return A}}else{if(A.id==E){return A}if(A.children){var B;for(var C=0;C<A.children.length;C++){if(B=this.getHoodData(E,A.children[C])){return B}}}}},cleanHoodData:function(A){if(A.leaf){A.loader="";return A}else{if(A.children){var B;for(var C=0;C<A.children.length;C++){this.cleanHoodData(A.children[C])}}A.loader="";return A}},populateView:function(A){Ext.Ajax.request({url:this.url,params:"method=util.search&query="+this.query+"&numPerPage="+this.numPerPage+"&page=0",method:"POST",scope:this,callback:function(G,I,H){if(I==true){var F=Ext.decode(H.responseText);var E=F.data.data.results;if(F.data.success){this.initTemplates();this.initRecord();this.initStore();this.initView();this.layout.rendered=false;this.add(this.eastArea);this.doLayout();this.centerArea.topToolbar.items.items[0].setText(E.start_res+" - "+E.end_res+E.cnt_total+" for <b>"+this.query+"</b>");var B=new Array();for(var C=1;C<E.pg_cnt;C++){B.push(new Ext.data.Record({i:C,n:C+1}))}this.centerArea.topToolbar.items.items[3].store.add(B);this.centerArea.topToolbar.items.each(function(J){J.show()},this);this.centerArea.add({style:"padding:5px 10px 10px;",items:this.view});this.centerArea.doLayout();this.store.loadData(F.data)}else{this.centerArea.add({style:"color:#365F91;font-size:14px;padding:30px;",html:"Search for <b>"+this.query+"</b> returned no results"});this.centerArea.doLayout();this.srchMask.hide();this.body.fadeIn({stopFx:true,duration:0.5})}}else{Ext.ux.onServerFailure(G,H)}}})}});Ext.reg("searchPanel",Ext.ux.SearchPanel);QoDesk.NewStuffWindow=Ext.extend(Ext.app.Module,{moduleId:"newstuff-win",first:1,url:Bsi.URL_BASE+Bsi.URL_SRVCS,init:function(){this.launcher={text:"NewStuff",shortcutIconCls:"newstuff-shortcut-icon",handler:this.createWindow,scope:this}},createWindow:function(C){var E=this.app;var Q=this.app.getDesktop();var J=Q.getWindow("newstuff-win");if(!J){this.ftrBtqRecord=new Ext.data.Record.create([{name:"publish",mapping:"publish"},{name:"nid",mapping:"nid"},{name:"name",mapping:"name"},{name:"desc",mapping:"desc"},{name:"hood",mapping:"hood"},{name:"pic",mapping:"pic"},{name:"logo",mapping:"logo"},{name:"prod",mapping:"prod"}]);var K=new Ext.data.JsonReader({root:"data"},this.ftrBtqRecord);this.ftrBtqStore=new Ext.data.Store({reader:K});this.addStores=function(V){var U;var S=new Array();var R=new Array();for(var T=0;T<V.length;T++){U=V[T];R.push(new this.ftrBtqRecord({publish:U.publish,nid:U.nid,name:U.name,desc:U.desc,hood:U.hood,pic:U.pic,logo:U.logo,prod:U.prod}))}this.ftrBtqStore.add(R)};var O=function(R){R.name=Ext.util.Format.htmlEncode(R.name);R.desc=Ext.util.Format.htmlEncode(R.desc);R.shortDesc=R.desc.ellipse(80);R.prod.title=R.prod.title.replace(/"/g,"&quot;").replace(/'/g,"&#039;");if(R.pic==Bsi.BLANK_STRIPES){R.picImgTH='<div style="background:#fff;width:130px;height:100px;border:1px solid #ccc;"></div>'}else{R.picImgTH='<img src="files/imagecache/boutique120x90/'+R.pic.path+'">'}if(R.prod.imgs==Bsi.BLANK_STRIPES){R.prod.imgTH='<div style="background:#fff;width:150px;height:150px;border:1px solid #ccc;"></div>'}else{R.prod.imgTH='<img src="files/imagecache/product150/'+R.prod.imgs[0].filepath+'">'}if(R.logo==Bsi.BLANK_STRIPES){R.logoImgTH=R.name.ellipse(25)}else{R.logoImgTH='<img src="files/imagecache/logoWx38/'+R.logo.path+'" title="'+R.logo.title+'" alt="'+R.logo.alt+'">'}R.prod.title=Ext.util.Format.htmlEncode(R.prod.title);return R};var H=new Ext.XTemplate('<tpl for=".">','<div class="ftrbtq-thumbs x-carousel-item clearfix">','<div class="store-thumb-wrap clearfix">','<div class="info clearfix">',"<table><tbody>","<tr>","<td colspan=2>",'<div class="name">',"{logoImgTH}","</div>","</td>","</tr>","<tr>","<td>",'<div class="thumb clearfix">',"{picImgTH}","</div>","</td>",'<td class="desc">{shortDesc}</td>',"</tr>","</tbody></table>","</div>","</div>",'<div class="prod-thumb-wrap clearfix">','<div class="info clearfix">',"<table><tbody>","<tr>","<td colspan=2>",'<div class="thumb clearfix">',"{values.prod.imgTH}",'<div class="buyRibbon"></div>',"</div>","</td>","</tr>","<tr>",'<td class="title">{[values.prod.title.ellipse(25)]}</td>',"</tr>","<tr>",'<td class="price">{[values.prod.display_price.ellipse(25)]}</td>',"</tr>","</tbody></table>","</div>","</div>","</div>","</tpl>");this.ftrBtqView=new Ext.DataView({id:"ftrBtqView",cls:"clearfix",tpl:H,singleSelect:true,overClass:"x-view-over",itemSelector:"div.ftrbtq-thumbs",store:this.ftrBtqStore,prepareData:O.createDelegate(this),listeners:{render:{fn:function(R){Ext.Ajax.request({url:this.url,params:"method=util.featureboutique",method:"POST",scope:this,callback:function(T,V,U){if(V==true){var S=Ext.decode(U.responseText);this.addStores(S.data);this.carousel.doLayout()}else{Ext.ux.onServerFailure(T,U)}}})},scope:this},click:{fn:function(U,R,V,S){var T=U.store.data.items[R].data;this.app.getModule("btq-win").createWindow({hood:T.hood,name:T.name,merchantId:T.nid,scope:this})},scope:this}}});this.carousel=new Ext.Panel({id:"carousel",border:false,layout:"carousel",layoutConfig:{pagedScroll:true,scrollButtonPosition:"split",scrollDuration:0.75,marginScrollButtons:5,loopCount:1,loopPictureDelay:8,dataView:this.ftrBtqView},items:this.ftrBtqView});J=Q.createWindow({id:"newstuff-win",title:"What's New",width:310,height:420,border:false,defaults:{border:false},autoScroll:true,bodyStyle:"padding:5px 10px 0;",items:[{items:this.carousel}]});if(this.first){this.first=0;J.center();var N=J.getPosition();var F=Ext.get("webtop-logo");var M=F.getRight();var L=this.app.getDesktop();var G=L.el.getWidth(true);var P=J.el.getWidth();var I=L.getWindow("home-win");var A=(I)?I.width:0;var B=15;if(G>=(A+P+B+M)){N[0]=((G-(A+P+B+M))/2)+M+A+B}else{if(G>=(A+P+B)){N[0]=((G-(A+P+B))/2)+A+B}else{N[0]=G-(P+B)}}if(N[1]<38){N[1]=38}J.setPosition(N[0],N[1])}else{J.center();var N=J.getPosition();if(N[1]<38){N[1]=38}J.setPosition(N[0],N[1])}}J.show()}});QoDesk.CartWindow=Ext.extend(Ext.app.Module,{moduleId:"cart-win",url:Bsi.URL_BASE+Bsi.URL_SRVCS,addNewProd:0,tabState:new Array(),init:function(){this.launcher={text:"Shopping Cart",shortcutIconCls:"cart-shortcut-icon",handler:this.createWindow,scope:this}},createWindow:function(F){var N=this.app.getDesktop();var I=N.getWindow("cart-win");var A=(F)?this.getTabNum(F.tabName):0;var E={};if(F){if(F.data){this.addNewProd=1;E=F}}if(!I){this.addNewProd=0;var M=new Ext.XTemplate('<div class="productThumbs clearfix">','<tpl for=".">','<div class="product-thumbs nid-{nid}-{uniq}<tpl if="publish == 0"> publish0</tpl> clearfix">','<div class="thumb-wrap">','<div class="thumb">',"{imgTH}","</div>",'<div class="info clearfix">',"<table><tbody>","<tr>",'<td colspan=2 class="title">{[values.title.ellipse(23)]}</td>',"</tr>","<tr>",'<td class="price">{[values.display_price.ellipse(15)]}</td>','<td class="details"><a href="#" class="details-link">Zoom</a></td>',"</tr>","</tbody></table>","</div>","</div>","</div>","</tpl>","</div>");M.compile();this.prodRecord=new Ext.data.Record.create([{name:"publish",mapping:"publish"},{name:"display_price",mapping:"display_price"},{name:"sell_price",mapping:"sell_price"},{name:"imgs",mapping:"imgs"},{name:"nid",mapping:"nid"},{name:"title",mapping:"title"},{name:"description",mapping:"description"},{name:"order",mapping:"order"},{name:"sku",mapping:"sku"},{name:"attributes",mapping:"attributes"},{name:"options",mapping:"options"},{name:"qty",mapping:"qty"},{name:"zone",mapping:"zone"},{name:"taxrate",mapping:"taxrate"},{name:"store",mapping:"store"},{name:"hood",mapping:"hood"},{name:"uniq",mapping:"uniq"},{name:"shipOpt",mapping:"shipOpt"},{name:"shipOpts",mapping:"shipOpts"},{name:"delivery_display",mapping:"delivery_display"},{name:"delivery_first_name",mapping:"delivery_first_name"},{name:"delivery_last_name",mapping:"delivery_last_name"},{name:"delivery_company",mapping:"delivery_company"},{name:"delivery_street1",mapping:"delivery_street1"},{name:"delivery_street2",mapping:"delivery_street2"},{name:"delivery_city",mapping:"delivery_city"},{name:"delivery_zone",mapping:"delivery_zone"},{name:"delivery_postal_code",mapping:"delivery_postal_code"},{name:"delivery_country",mapping:"delivery_country"},{name:"delivery_phone",mapping:"delivery_phone"}]);var H=new Ext.data.JsonReader({root:"product"},this.prodRecord);this.prodStore=new Ext.data.Store({reader:H,newProd:E,listeners:{load:{fn:function(P,R,Q){var S;for(var O=0;O<R.length;O++){S=R[O].data;Ext.select(".nid-"+S.nid+"-"+S.uniq).on({click:{fn:function(T){this.prodHandler(T)},scope:this}})}if(P.newProd.data){this.addProduct(this,P.newProd.data)}else{this.prodView.select(0);Ext.fly(this.prodView.getNode(0)).frame("#8db2e3",1);this.proceedChk()}},scope:this},add:{fn:function(P,Q,O){P.newProd.data=Q[0].data},scope:this}}});var G=function(O){O.title=O.title.replace(/"/g,"&quot;").replace(/'/g,"&#039;");if(O.imgs==Bsi.BLANK_STRIPES){O.imgTH="<em></em>"}else{O.imgTH='<em><img src="files/imagecache/product150/'+O.imgs[0].filepath+'" qtip="<b>'+O.title+"</b><br><b>"+O.display_price+'</b><br>Click to see preview on the right"></em>'}return O};this.prodView=new Ext.DataView({id:"shoppingbag-products",newProd:E,tpl:M,singleSelect:true,overClass:"x-view-over",itemSelector:"div.product-thumbs",loadingText:'<div class="loading-indicator">loading...</div>',store:this.prodStore,prepareData:G.createDelegate(this),listeners:{selectionchange:{fn:function(O,P){this.showDetails(P);if(P.length>0&&(O.store.newProd.data)){var Q=O.store.newProd.data;Ext.select(".nid-"+Q.nid+"-"+Q.uniq).on({click:{fn:function(R){this.prodHandler(R)},scope:this}});O.store.newProd.data=0}},scope:this,buffer:100},dblclick:{fn:function(R,O,S,P){var Q=R.getSelectedRecords()[0].data;this.showProduct(Q)},scope:this},render:{fn:function(O){Ext.Ajax.request({url:this.url,params:"method=cart.load",method:"POST",scope:this,callback:function(S,W,V){if(W==true){var R=Ext.decode(V.responseText);var T=1;var U=[];var P;for(var Q=0;Q<R.data.length;Q++){P=R.data[Q];T=0;U.push(P)}if(!T){O.store.loadData({product:U})}else{if(O.newProd.data){this.addProduct(this,O.newProd.data);O.newProd.data=0}}}else{Ext.ux.onServerFailure(S,V)}}});new Ext.dd.DropTarget(Ext.getCmp("shoppingbag-products-panel").getEl(),{ddGroup:"prodDD",scope:this,nofityOver:function(P,R,Q){return this.dropAllowed},notifyDrop:function(P,Q,R){this.scope.addProduct(this.scope,R.data);return true}})},scope:this},loadexception:{fn:this.onLoadException,scope:this},beforeselect:{fn:function(O){return O.store.getRange().length>0}}}});var K=new Ext.Panel({region:"center",border:false,layout:"border",items:[{xtype:"panel",border:false,region:"north",height:40,bodyStyle:"color:#666666;",html:"<p>Once all product options have been selected the 'Proceed to Secure Checkout' button below will be enabled.</p>"},{id:"shoppingbag-products-panel",region:"center",cls:"products",autoScroll:true,border:false,items:this.prodView}],buttonAlign:"center",buttons:[{id:"proceedCheckout",text:"Proceed to Secure Checkout",iconCls:"icon-lock",handler:function(O,P){this.addSecureCheckout()},scope:this}]});var L=new Ext.XTemplate('<div class="addrThumbs"><tpl for="."><div class="addr-thumbs clearfix" qtip="<div><b>{display}</b></div><div>{first_name} {last_name}</div><div>{street1} </div><div>{city} {zoneName} {postal_code}</div><div>{countryName}</div>"><div class="addr-wrap" qtip="<div><b>{display}</b></div><div>{first_name} {last_name}</div><div>{street1} </div><div>{city} {zoneName} {postal_code}</div><div>{countryName}</div>"><span class="label" qtip="<div><b>{display}</b></div><div>{first_name} {last_name}</div><div>{street1} </div><div>{city} {zoneName} {postal_code}</div><div>{countryName}</div>">{[values.display.ellipse(18)]}</span><tpl if="values.shipping == 1">    - shipping addr</tpl><tpl if="values.billing == 1"><tpl if="values.shipping == 1"><br></tpl>    - billing addr</tpl></div></div></tpl></div>');L.compile();this.addrRecord=new Ext.data.Record.create([{name:"display",mapping:"display"},{name:"label",mapping:"label"},{name:"first_name",mapping:"first_name"},{name:"last_name",mapping:"last_name"},{name:"company",mapping:"company"},{name:"street1",mapping:"street1"},{name:"street2",mapping:"street2"},{name:"city",mapping:"city"},{name:"country",mapping:"country"},{name:"zone",mapping:"zone"},{name:"postal_code",mapping:"postal_code"},{name:"phone",mapping:"phone"},{name:"shipping",mapping:"shipping"},{name:"billing",mapping:"billing"}]);var J=new Ext.data.JsonReader({root:"addrs"},this.addrRecord);this.addrStore=new Ext.data.Store({reader:J});this.shipAddrStore=new Ext.data.Store({reader:J});this.billAddrStore=new Ext.data.Store({reader:J});var C=function(P){P.zoneName="";for(var O=0;O<Ext.generaldata.states.length;O++){if(Ext.generaldata.states[O][0]==P.zone){P.zoneName=Ext.generaldata.states[O][1];break}}P.countryName="";for(var O=0;O<Ext.generaldata.countries.length;O++){if(Ext.generaldata.countries[O][0]==P.country){P.countryName=Ext.generaldata.countries[O][1];break}}P.display=P.display.replace(/"/g,"&quot;").replace(/'/g,"&#039;");P.first_name=P.first_name.replace(/"/g,"&quot;").replace(/'/g,"&#039;");P.last_name=P.last_name.replace(/"/g,"&quot;").replace(/'/g,"&#039;");P.street1=P.street1.replace(/"/g,"&quot;").replace(/'/g,"&#039;");P.city=P.city.replace(/"/g,"&quot;").replace(/'/g,"&#039;");P.zoneName=P.zoneName.replace(/"/g,"&quot;").replace(/'/g,"&#039;");P.postal_code=P.postal_code.replace(/"/g,"&quot;").replace(/'/g,"&#039;");P.countryName=P.countryName.replace(/"/g,"&quot;").replace(/'/g,"&#039;");return P};this.addrView=new Ext.DataView({id:"addrView",tpl:L,singleSelect:true,overClass:"x-view-over",itemSelector:"div.addr-thumbs",loadingText:'<div class="loading-indicator">loading...</div>',emptyText:"<i>No Saved Adresses.</i>",store:this.addrStore,prepareData:C.createDelegate(this),listeners:{selectionchange:{fn:function(P,O){this.showAddr(O)},scope:this,buffer:100},loadexception:{fn:this.onLoadException,scope:this}}});var B=[{title:"Shopping Cart",iconCls:"icon-cart",id:"shoppingcart",layout:"border",items:[K,{xtype:"panel",id:"shoppingbag-product-preview-wrapper",region:"east",split:true,useSplitTips:true,collapsible:true,collapseMode:"mini",width:175,minWidth:175,maxWidth:175,border:false,autoScroll:true,buttonAlign:"center",items:[{xtype:"panel",id:"shoppingbag-product-preview",border:false}],buttons:[{text:"Remove",iconCls:"icon-cart-remove",cls:"editButton x-btn-text-icon",handler:function(O,R){var T=Ext.getCmp("shoppingbag-product-preview").selRec;if(T){data=T.data}else{data=0}if(data){var P=this.prodView.getSelectedIndexes();this.removeProduct(T);var S=this.prodStore.getCount();if(S==0){Ext.getCmp("shoppingbag-product-preview").body.update("")}else{if((P.length==0)||(P==0)){this.prodView.select(0)}else{var Q=P[0]-1;if(Q>-1){this.prodView.select(Q)}}}this.proceedChk();Ext.Ajax.request({url:this.url,params:"method=cart.remove&nid="+data.nid+"&uniq="+data.uniq,method:"POST",scope:this,callback:function(V,X,W){if(X==true){var U=Ext.decode(W.responseText)}else{Ext.ux.onServerFailure(V,W)}}})}},scope:this}]}],listeners:{render:{fn:function(O){Ext.getCmp("proceedCheckout").setDisabled(1)},scope:this}}}];if(Bsi.USR_AUTH){B.push({title:"Address Book",iconCls:"icon-addr-book",id:"addressbook",tabTip:"Manage your personal addresses",layout:"border",items:[{xtype:"panel",id:"addresses",region:"center",border:false,shim:false,animCollapse:false,constrainHeader:true,autoScroll:true,items:[{xtype:"panel",border:false,html:'<div style="padding:5px 0 0 5px;font-weight:bold">Addresses</div><div style="padding:5px 10px;">Make ordering easy!  Register with BoutiqueStreet.com and you can save your frequently used addresses.&dagger Give them a "Name" that you remember.  They\'ll show up in drop down menus when you go to Checkout.</div><div style="padding:5px 10px;font-size:9px;font-style:italic;">&dagger Your privacy is important to us &mdash we will not share your addresses with anyone.</div>'},{xtype:"form",id:"addrForm",labelAlign:"right",labelWidth:85,bodyStyle:"padding:5px 5px 0;overflow-x:hidden;",border:false,defaults:{width:380,allowBlank:false,labelSeparator:""},defaultType:"textfield",monitorValid:true,items:[{xtype:"hidden",name:"label"},{fieldLabel:'"Name"',allowBlank:false,width:"95%",name:"display",maskRe:Ext.form.VTypes.addrNameMask,vtype:"addrName"},{xtype:"checkbox",boxLabel:"For use as shipping address",name:"shipping"},{xtype:"checkbox",boxLabel:"For use as billing address",name:"billing"},{fieldLabel:"First Name",width:"95%",name:"first_name"},{fieldLabel:"Last Name",width:"95%",name:"last_name"},{fieldLabel:'<span qtip="Only if applicable" style="color:#aaa;">Company</span>',allowBlank:true,width:"95%",name:"company"},{fieldLabel:"Address 1",width:"95%",name:"street1"},{fieldLabel:'<span qtip="Only if applicable" style="color:#aaa;">Address 2</span>',allowBlank:true,width:"95%",name:"street2"},{fieldLabel:"City",width:"95%",name:"city"},{xtype:"combo",width:"auto",fieldLabel:"State",hiddenName:"shipstate",valueField:"code",displayField:"name",typeAhead:true,selectOnFocus:true,mode:"local",triggerAction:"all",emptyText:"Select a state",name:"zone",title:"State",plugins:new Ext.ux.plugin.triggerfieldTooltip(),tooltip:{text:"State"},store:new Ext.data.SimpleStore({fields:["code","abbr","name"],data:Ext.generaldata.states})},{xtype:"combo",width:"auto",fieldLabel:"Country",hiddenName:"shipcountry",valueField:"code",displayField:"name",typeAhead:true,selectOnFocus:true,mode:"local",triggerAction:"all",emptyText:"Select a Country",name:"country",title:"Country",plugins:new Ext.ux.plugin.triggerfieldTooltip(),tooltip:{text:"Country"},store:new Ext.data.SimpleStore({fields:["code","abbr","name"],data:Ext.generaldata.countries})},{fieldLabel:"Postal Code",width:"95%",name:"postal_code",maskRe:Ext.form.VTypes.postalMask,vtype:"postal"},{fieldLabel:"Phone #",width:"95%",name:"phone",maskRe:Ext.form.VTypes.phoneMask,vtype:"phone"}],listeners:{clientvalidation:{fn:function(P,O){Ext.getCmp("addrFormSave").setDisabled(!O);Ext.getCmp("addrFormDelete").setDisabled(!O)},scope:this}}}],buttonAlign:"center",buttons:[{text:"New",style:"width:100px",scope:this,handler:function(O,Q){this.addrView.select("");var P=Ext.getCmp("addrForm");P.getForm().reset()}},{text:"Save",id:"addrFormSave",style:"width:100px",scope:this,handler:function(O,S){var R={};var T;var Q=Ext.getCmp("addrForm");for(var P=0;P<Q.items.length;P++){T=Q.items.items[P].getValue();if(((Q.items.items[P].name=="shipping")||(Q.items.items[P].name=="billing"))&&(T=="")){T=0}R[Q.items.items[P].name]=T}R.label=R.display;if(!R.shipping&&!R.billing){Ext.Msg.alert("Save","Must select at least one <u>for use</u> option: shipping, billing.")}else{var U=Ext.encode(R);if(R.display!=""){Ext.Ajax.request({url:this.url,params:"method=user.saveaddr&addr="+U,method:"POST",scope:this,callback:function(V,g,X){if(g==true){var c=Ext.decode(X.responseText);if(c.data.msg=="update"){var W=Ext.getCmp("addrForm");var b=this.addrStore.find("display",c.data.addr.display);this.addrView.select(b);Ext.fly(this.addrView.getNode(b)).frame("#8db2e3",1);var e=this.addrView.getSelectedRecords()[0];for(var Y in e.data){e.data[Y]=c.data.addr[Y]}e.commit();if(c.data.addr.shipping){var a=this.shipAddrStore.getAt(this.shipAddrStore.find("display",c.data.addr.display));for(var Y in c.data.addr){a.data[Y]=c.data.addr[Y]}a.commit()}if(c.data.addr.billing){var f=this.billAddrStore.getAt(this.billAddrStore.find("display",c.data.addr.display));for(var Y in c.data.addr){f.data[Y]=c.data.addr[Y]}f.commit()}var j}else{var Z=new this.addrRecord({display:c.data.addr.display,label:c.data.addr.label,first_name:c.data.addr.first_name,last_name:c.data.addr.last_name,company:c.data.addr.company,street1:c.data.addr.street1,street2:c.data.addr.street2,city:c.data.addr.city,country:c.data.addr.country,zone:c.data.addr.zone,postal_code:c.data.addr.postal_code,phone:c.data.addr.phone,shipping:c.data.addr.shipping,billing:c.data.addr.billing});this.addrStore.add([Z]);if(c.data.addr.shipping){this.shipAddrStore.add([Z])}if(c.data.addr.billing){this.billAddrStore.add([Z])}var b=this.addrStore.indexOf(Z);this.addrView.select(b);Ext.fly(this.addrView.getNode(b)).frame("#8db2e3",1)}}else{Ext.ux.onServerFailure(V,X)}}})}}}},{text:"Delete",id:"addrFormDelete",style:"width:100px",scope:this,handler:function(W,U){var P=Ext.getCmp("addrForm");var V=P.items.items[1].getValue();var T=this.addrStore.find("display",V);if((V!="")&&(T!=-1)){var X=P.items.items[0].getValue();var R=this.addrView.getSelectedRecords()[0];this.addrStore.remove(R);if(Number(R.data.shipping)){var S=this.shipAddrStore.getAt(this.shipAddrStore.find("display",R.data.display));this.shipAddrStore.remove(S)}if(Number(R.data.billing)){var Y=this.shipAddrStore.getAt(this.shipAddrStore.find("display",R.data.display));this.billAddrStore.remove(Y)}var O=this.addrStore.getCount();var Q=T-1;if(Q>-1){this.addrView.select(Q)}else{if(O>0){this.addrView.select(T)}else{var P=Ext.getCmp("addrForm");P.getForm().reset()}}Ext.Ajax.request({url:this.url,params:"method=user.removeaddr&label="+X,method:"POST",scope:this,callback:function(a,c,b){if(c==true){var Z=Ext.decode(b.responseText);if(Z.data==true){}else{}}else{Ext.ux.onServerFailure(a,b)}}})}else{}}}]},{xtype:"panel",id:"savedaddrinfo",region:"east",width:150,border:false,bodyStyle:"border-left:1px solid #a0a0a0;",layout:"border",items:[{xtype:"panel",region:"north",border:false,bodyStyle:"border-bottom:1px solid #ccc;",html:'<div style="font-weight:bold;padding:5px 0px 5px;text-align:center">Saved Addresses</div><div style="padding:0 10px 5px;">Select an address from the list below to view details and edit.</div>'},{xtype:"panel",region:"center",border:false,autoScroll:true,bodyStyle:"padding:5px;",items:this.addrView}]}],listeners:{render:{fn:function(O){Ext.Ajax.request({url:this.url,params:"method=user.getaddr",method:"POST",scope:this,callback:function(P,Y,Q){if(Y==true){var V=Ext.decode(Q.responseText);var T=1;var U=[];var W;var X=[];var S=[];for(var R=0;R<V.data.length;R++){T=0;W=V.data[R];U.push(W);if(Number(W.shipping)){X.push(W)}if(Number(W.billing)){S.push(W)}}if(!T){this.addrStore.loadData({addrs:U});this.addrView.select(0);if(X.length>0){this.shipAddrStore.loadData({addrs:X})}if(S.length>0){this.billAddrStore.loadData({addrs:S})}}}else{Ext.ux.onServerFailure(P,Q)}}})},scope:this}}})}B.push({title:"Order History",iconCls:"icon-history",id:"orderHistory",tabTip:"Manage your orders",style:"color:#365F91;font-size:125%;padding:20px;",html:"Order management tools coming soon..."},{title:"Wish List",iconCls:"icon-wish",id:"wishList",tabTip:"Manage your wishlists",style:"color:#365F91;font-size:125%;padding:20px;",html:"Ability to make, save, and share wishlists coming soon..."});I=N.createWindow({id:"cart-win",title:"Shopping Cart",width:625,height:525,minWidth:625,border:false,layout:"fit",shim:false,animCollapse:false,constrainHeader:true,items:new Ext.TabPanel({id:"cart-win-tabs",activeTab:A,border:false,defaults:{hideMode:"offsets",border:false,header:false},items:B,listeners:{render:{fn:function(O){this.tabState[0]=0;this.tabState[1]=0},scope:this},tabchange:{fn:function(P,Q){this.tabState[1]=this.tabState[0];this.tabState[0]=Q.id;if(Q.id=="shoppingcart"){if(!Q.init){Q.doLayout();Q.init=1}}if(Q.id=="addressbook"){if(!Q.init){Q.doLayout();this.addrView.select(0);Q.init=1}}if((this.tabState[1]=="checkout")&&(this.tabState[0]!="checkout")){var O=Ext.getCmp("checkout");if(O){P.remove(O)}if(Bsi.USR_AUTH){Ext.Ajax.request({url:this.url,params:"method=user.getaddr",method:"POST",scope:this,callback:function(R,b,S){if(b==true){var Y=Ext.decode(S.responseText);var V=1;var W=[];var Z;var a=[];var U=[];for(var T=0;T<Y.data.length;T++){V=0;Z=Y.data[T];W.push(Z);if(Number(Z.shipping)){a.push(Z)}if(Number(Z.billing)){U.push(Z)}}if(!V){var X=this.addrView.getSelectedIndexes();this.addrStore.loadData({addrs:W});this.addrView.select(X[0]);if(a.length>0){this.shipAddrStore.loadData({addrs:a})}if(U.length>0){this.billAddrStore.loadData({addrs:U})}}}else{Ext.ux.onServerFailure(R,S)}}})}this.prodStore.removeAll();Ext.getCmp("shoppingbag-product-preview").body.update("");Ext.Ajax.request({url:this.url,params:"method=cart.load",method:"POST",scope:this,callback:function(U,Y,X){if(Y==true){var T=Ext.decode(X.responseText);var V=1;var W=[];var R;for(var S=0;S<T.data.length;S++){R=T.data[S];V=0;W.push(R)}if(!V){this.prodStore.loadData({product:W})}else{Ext.getCmp("proceedCheckout").setDisabled(1)}}else{Ext.ux.onServerFailure(U,X)}}})}},scope:this}}})})}else{Ext.getCmp("cart-win-tabs").activate(A)}if(this.addNewProd){this.addProduct(this,E.data)}I.show()},getTabNum:function(A){var B=0;if(A){switch(A){case"ShoppingCart":B=0;break;case"AddressBook":B=1;break;case"OrderHistory":B=2;break;case"WishList":B=3;break}}return B},setActiveTab:function(B){var A=Ext.getCmp("cart-win");A.layout.setActiveItem(B)},prodHandler:function(A){var C=A.getTarget(".details-link");if(C){var B=this.prodView.getRecord(A.getTarget(".product-thumbs")).data;this.showProduct(B)}},showProduct:function(A){if(A.nid!=0){A.storeName=A.store.name;A.hoodNames=A.hood;this.app.getModule("prod-win").createWindow({selRec:A,title:A.title})}},proceedChk:function(){var F,C=this.prodStore;var E=(C.data.items.length!=0);for(var B=0;B<C.data.items.length;B++){for(var A in C.data.items[B].data.options){F=C.data.items[B].data.options[A];if(typeof F=="object"){if(!F.oid){E=0}}}}Ext.getCmp("proceedCheckout").setDisabled(!E)},removeProduct:function(A){this.prodStore.remove(A)},addProduct:function(C,E){this.addNewProd=1;if(!(E.qty>0)){E.qty=1}var H=new Date().getTime();var F=new C.prodRecord({publish:E.publish,display_price:E.display_price,sell_price:E.sell_price,imgs:E.imgs,nid:E.nid,title:E.title,description:E.description,order:E.order,sku:E.sku,attributes:E.attributes,options:E.options,qty:E.qty,zone:E.zone,taxrate:E.taxrate,store:E.store,hood:E.hood,uniq:H,shipOpt:"-1",shipOpts:"-1",delivery_display:"-1",delivery_first_name:"-1",delivery_last_name:"-1",delivery_company:"-1",delivery_street1:"-1",delivery_street2:"-1",delivery_city:"-1",delivery_zone:"-1",delivery_postal_code:"-1",delivery_country:"-1",delivery_phone:"-1"});C.prodView.store.add([F]);var B=Ext.ux.clone(E);var G=Ext.encode({options:B.options,zone:B.zone,taxrate:B.taxrate,store:B.store,shipOpt:"-1",delivery_display:"-1",delivery_first_name:"-1",delivery_last_name:"-1",delivery_company:"-1",delivery_street1:"-1",delivery_street2:"-1",delivery_city:"-1",delivery_zone:"-1",delivery_postal_code:"-1",delivery_country:"-1",delivery_phone:"-1"});G=encodeURIComponent(G);Ext.Ajax.request({url:C.url,rec:F,params:"method=cart.add&nid="+E.nid+"&uniq="+H+"&qty="+E.qty+"&data="+G,method:"POST",scope:C,callback:function(J,L,K){if(L==true){var I=Ext.decode(K.responseText);J.rec.data.shipOpts=I.data.shipOpts}else{Ext.ux.onServerFailure(J,K)}}});var A=C.prodView.store.indexOf(F);C.prodView.select(A);Ext.fly(C.prodView.getNode(A)).frame("#8db2e3",1);C.proceedChk()},showAddr:function(G){var E=Ext.getCmp("addrForm");if(G&&G.length>0){G=G[0];var F=this.addrView.getSelectedRecords()[0].data;var A;for(var C=0;C<E.items.length;C++){if(E.items.items[C].name){E.items.items[C].setValue(F[E.items.items[C].name])}else{A=E.items.items[C];for(var B=0;B<A.items.length;B++){A.items.items[B].setValue(F[A.items.items[B].name])}}}}else{}},addSecureCheckout:function(){var B=Bsi.URL_S_BASE+Bsi.URL_CHKOUT;var A=Ext.getCmp("cart-win-tabs");var C=A.add({id:"checkout",title:"Secure Checkout",iconCls:"icon-lock",closable:true,layout:"border",items:[{xtype:"iframepanel",id:"checkout-iframe",region:"center",border:false,loadMask:{msg:"Loading Secure Checkout Form..."},defaultSrc:B,buttonAlign:"center"}]}).show();Ext.getCmp("checkout-iframe").setSrc(B);A.doLayout()},showDetails:function(T){var H=Ext.getCmp("shoppingbag-product-preview-wrapper");var K=Ext.getCmp("shoppingbag-product-preview");if(T&&T.length>0){T=T[0];var E=/nid-(\d+-\d+)/;var M=E.exec(T.className);var P=true;var J=K.body.child("div.thumb");if(J){P=!(J.hasClass(M[0]))}if(P){H.body.hide();K.body.hide();var C=this.prodView.getSelectedRecords()[0];var R=C.data;R.title=R.title.replace(/"/g,"&quot;").replace(/'/g,"&#039;");if(R.imgs==Bsi.BLANK_STRIPES){R.imgTH="<em></em>"}else{R.imgTH='<em><img src="files/imagecache/product100/'+R.imgs[0].filepath+'" qtip="<b>'+R.title+'</b>"></em>'}K.destroy();H.remove("shoppingbag-product-preview",true);var B=new Ext.Panel({id:"shoppingbag-product-preview",selRec:C,border:false});var I='<div class="product-details clearfix"><div class="thumb-wrap"><div class="thumb nid-'+R.nid+"-"+R.uniq+'">'+R.imgTH+'</div><div class="info clearfix"><table><tbody><tr><td class="title">'+R.title+'</td></tr><tr><td class="price">'+R.display_price+"</td></tr></tbody></table></div></div></div>";var G=new Ext.Panel({border:false,html:I});B.add(G);var F;var U;var N;var S;var L=new Array();if(R.attributes&&(R.attributes.length!=0)){for(var O in R.attributes){if(R.attributes[O].options.length!=0){L=new Array();F=O;for(var A in R.attributes[O].options){U=R.attributes[O].options[A].name;S="";N=0;if(R.attributes[O].options[A].price!=0){S=" $"+R.attributes[O].options[A].price;N=R.attributes[O].options[A].price}L.push(new Array(F,A,U,S,N))}B.add({border:false,style:"margin-bottom:10px;",items:[{xtype:"combo",border:false,width:110,listWidth:110,allowBlank:false,labelSeparator:"",editable:false,mode:"local",triggerAction:"all",displayField:"name",valueField:"name",emptyText:R.attributes[O].name,title:R.attributes[O].name,plugins:new Ext.ux.plugin.triggerfieldTooltip(),tooltip:{text:R.attributes[O].name},data:R,index:O,tpl:new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item">{name}{display_price}</div></tpl>'),store:new Ext.data.SimpleStore({fields:["aid","oid","name","display_price","price"],data:L}),listeners:{render:{fn:function(V){V.setValue(V.data.options[V.index].name)},scope:this},select:{fn:function(Z,Y,V){if(Y.data.oid!=Z.data.options[Z.index].oid){var X=Number(Y.data.price)-Number(Z.data.options[Z.index].price);Z.data.options[Z.index]=Z.data.attributes[Z.index].options[Y.data.oid];this.proceedChk();var W=Ext.encode({options:Z.data.options});Ext.Ajax.request({url:this.url,params:"method=cart.update&nid="+Z.data.nid+"&uniq="+Z.data.uniq+"&data="+W,method:"POST",scope:this,callback:function(b,e,c){if(e==true){var a=Ext.decode(c.responseText)}else{Ext.ux.onServerFailure(b,c)}}})}},scope:this}}}]})}}}var Q=[["1"],["2"],["3"],["4"],["5"]];B.add({border:false,style:"margin-bottom:6px;",items:[{xtype:"combo",border:false,width:50,listWidth:50,allowBlank:false,labelSeparator:"",editable:false,mode:"local",triggerAction:"all",displayField:"n",emptyText:"QTY",title:"QTY",plugins:new Ext.ux.plugin.triggerfieldTooltip(),tooltip:{text:"QUANTITY"},data:R,store:new Ext.data.SimpleStore({fields:["n"],data:Q}),listeners:{render:{fn:function(V){if(V.data.qty>0){V.setValue(V.data.qty)}else{V.validate()}},scope:this},select:{fn:function(Y,X,V){if(X.data.n!=Y.data.qty){Y.data.qty=X.data.n;var W=Ext.encode({qty:Y.data.qty});Ext.Ajax.request({url:this.url,params:"method=cart.update&nid="+Y.data.nid+"&uniq="+Y.data.uniq+"&data="+W,method:"POST",scope:this,callback:function(a,c,b){if(c==true){var Z=Ext.decode(b.responseText)}else{Ext.ux.onServerFailure(a,b)}}})}},scope:this}}}]});B.add({border:false,cls:"prev-details-button",style:"padding-bottom:5px;margin-top:-7px;",items:[{xtype:"button",iconCls:"icon-details-link",text:"Zoom",tooltip:"Click for more details",scope:this,handler:function(V,W){var X=this.prodView.getSelectedRecords()[0].data;this.showProduct(X)}}]});B.add({xtype:"panel",border:false,html:R.description});B.doLayout();H.add(B);H.doLayout();H.body.show();B.body.fadeIn({stopFx:true,duration:0.5})}}else{}}});QoDesk.AccountWindow=Ext.extend(Ext.app.Module,{moduleId:"acct-win",url:Bsi.URL_BASE+Bsi.URL_SRVCS,init:function(){this.launcher={text:"Account",shortcutIconCls:"account-shortcut-icon",handler:this.createWindow,scope:this}},createWindow:function(A){var C=this.app.getDesktop();var B=C.getWindow("acct-win");if(!B){B=C.createWindow({id:"acct-win",title:"Account",width:450,height:375,resizable:false,border:false,defaults:{border:false},items:[{id:"infoForm",xtype:"form",title:"General Info",cls:"x-panel-hdr-clean",style:"padding:15px 20px 0;",bodyStyle:"padding:10px 0;",labelAlign:"right",labelWidth:55,defaults:{labelSeparator:"",allowBlank:false},defaultType:"textfield",monitorValid:true,items:[{fieldLabel:"username",style:"overflow-x:hidden;",width:"95%",name:"name",maskRe:Ext.form.VTypes.userNameMask,vtype:"userName"},{xtype:"panel",border:false,style:"color:#1A4D8F;padding:0 0 5px 65px;",html:"Period, hypen and underscore puncutations allowed."},{fieldLabel:"email",width:"95%",name:"mail",vtype:"email"},{xtype:"panel",style:"padding:5px 0 0 60px;",border:false,layout:"column",defaults:{border:false,style:"padding-right:10px;"},items:[{width:75,items:[{xtype:"button",text:"Reload",scope:this,handler:function(E,H){var G=E.findParentByType("form");var F=new Ext.LoadMask(G.bwrap,{msg:"Loading Information..."});F.show();Ext.Ajax.request({url:this.url,params:"method=user.getinfo",method:"POST",formMask:F,scope:this,callback:function(K,N,M){if(N==true){var J=Ext.decode(M.responseText);var I={name:J.data.name,mail:J.data.mail};var L=E.findParentByType("form");L.getForm().setValues(I)}else{Ext.ux.onServerFailure(K,M)}K.formMask.hide()}})}}]},{width:120,items:[{id:"infoFormSubmit",xtype:"button",text:"Submit Change",disabled:true,scope:this,handler:function(F,J){var I=F.findParentByType("form");var E=I.getForm().getValues();var G=new Ext.LoadMask(I.bwrap,{msg:"Changing Information..."});G.show();var H={};for(p in E){if(E[p]!=I.values[p]){H[p]=E[p]}}var K=Ext.encode({data:H});Ext.Ajax.request({url:this.url,params:"method=user.setinfo&data="+K,method:"POST",formMask:G,scope:this,callback:function(P,S,R){if(S==true){var O=Ext.decode(R.responseText);if(O.data.success==true){var M=3000;var L='<div style="background:#eeffee;color:#009900;text-align:center;">Information Successfully Changed</div>';var Q=F.findParentByType("form");Q.values=E}else{var M=4000;var L='<div style="background:#ffeeee;color:#990000;text-align:center;">'+O.data.data+"</div>"}P.formMask.el._maskMsg.fadeOut({duration:1,scope:this,callback:function(T){T.removeClass("x-mask-loading");T.dom.innerHTML=L;T.fadeIn({duration:1})}});var N=new Ext.util.DelayedTask(function(){P.formMask.hide();if(O.data.success==true&&O.data.data.name){var T=Ext.getCmp("welcomeTxt");T.setText("Welcome "+E.name)}},this);N.delay(M)}else{P.formMask.hide();Ext.ux.onServerFailure(P,R)}}})}}]}]}],listeners:{render:{fn:function(F){var E=Ext.getCmp("infoForm");Ext.Ajax.request({url:this.url,params:"method=user.getinfo",method:"POST",scope:this,callback:function(I,K,J){if(K==true){var H=Ext.decode(J.responseText);var G={name:H.data.name,mail:H.data.mail};F.values=G;F.getForm().setValues(G)}else{Ext.ux.onServerFailure(I,J)}}})},scope:this},clientvalidation:{fn:function(J,E){var I=J.getForm().getValues();var H=J.values;if(J.values){var G=1;for(var F in I){if(I[F]!==H[F]){G=0;break}}Ext.getCmp("infoFormSubmit").setDisabled(G||!E)}},scope:this}}},{id:"passForm",xtype:"form",title:"password",cls:"x-panel-hdr-clean x-form-btn-clean",style:"padding:15px 20px 20px",bodyStyle:"padding:10px 0;",labelAlign:"right",labelWidth:55,defaults:{labelSeparator:""},defaultType:"textfield",monitorValid:true,items:[{id:"passnew",fieldLabel:"New",width:"95%",name:"passnew",inputType:"password",vtype:"password"},{id:"passconfirm",fieldLabel:"Confirm",width:"95%",name:"passconfirm",inputType:"password",vtype:"password"},{xtype:"panel",border:false,style:"color:#1A4D8F;padding-left:65px;",html:"Passwords must conform to the following:<br/>- min of 8 chars<br/>- min of 1 numeric char<br/>- no char sequences"},{xtype:"panel",style:"padding:9px 0 0 60px;",border:false,layout:"column",defaults:{border:false,style:"padding-right:10px;"},items:[{width:65,items:[{xtype:"button",text:"Clear",scope:this,handler:function(E,G){var F=E.findParentByType("form");F.getForm().reset()}}]},{width:120,items:[{id:"passFormSubmit",xtype:"button",text:"Submit Change",disabled:true,scope:this,handler:function(F,J){var I=F.findParentByType("form");var E=I.getForm().getValues();var G=new Ext.LoadMask(I.bwrap,{msg:"Changing Password..."});G.show();var H=Ext.encode({data:E});Ext.Ajax.request({url:this.url,params:"method=user.setpass&data="+H,method:"POST",formMask:G,scope:this,callback:function(O,R,Q){if(R==true){var N=Ext.decode(Q.responseText);var P=F.findParentByType("form");P.getForm().reset();if(N.data){var L=3000;var K='<div style="background:#eeffee;color:#009900;text-align:center;">Password Successfully Changed</div>'}else{var L=4000;var K='<div style="background:#ffeeee;color:#990000;text-align:center;">Original Password Incorrect<br/>Password <b>NOT</b> Changed</div>'}O.formMask.el._maskMsg.fadeOut({duration:1,scope:this,callback:function(S){S.removeClass("x-mask-loading");S.dom.innerHTML=K;S.fadeIn({duration:1})}});var M=new Ext.util.DelayedTask(function(){O.formMask.hide()},this);M.delay(L)}else{O.formMask.hide();Ext.ux.onServerFailure(O,Q)}}})}}]},{id:"passFormMsg",columnWidth:1,style:"font-size:13",msg:0,defaults:{border:false},items:[{id:"passFormMsgClr",html:"&nbsp;"},{id:"passFormMsgNo",style:"border:1px solid #990000;background:#ffeeee;color:#990000;padding:3px 5px 5px;text-align:center;",hidden:true,width:150,html:"New Password Mismatches"},{id:"passFormMsgYes",style:"border:1px solid #009900;background:#eeffee;color:#009900;padding:3px 5px 5px;text-align:center;",hidden:true,width:150,html:"New Password Matches"}]}]}],listeners:{clientvalidation:{fn:function(H,F){var J=H.getForm().getValues();var I=Ext.getCmp("passFormMsg");var G=(J.passnew==J.passconfirm);var E=((J.passnew!="")&&(J.passconfirm!=""));if(E){if(!F&&I.msg>0){I.items.items[I.msg].hide();I.msg=0;I.items.items[I.msg].show()}else{if(F){if(!G&&(I.msg!=1)){I.hide();I.items.items[I.msg].hide();I.msg=1;I.items.items[I.msg].show();I.items.items[I.msg].body.hide();I.show();I.items.items[I.msg].body.fadeIn({stopFx:true,duration:1})}else{if(G&&(I.msg<2)){I.hide();I.items.items[I.msg].hide();I.msg=2;I.items.items[I.msg].show();I.items.items[I.msg].body.hide();I.show();I.items.items[I.msg].body.fadeIn({stopFx:true,duration:1})}}}}}else{if(I.msg>0){I.items.items[I.msg].hide();I.msg=0;I.items.items[I.msg].show()}}F=(F&&E&&G);Ext.getCmp("passFormSubmit").setDisabled(!F)},scope:this}}}]})}B.show()}});QoDesk.PreferenceWindow=Ext.extend(Ext.app.Module,{moduleId:"pref-win",url:Bsi.URL_BASE+Bsi.URL_SRVCS,init:function(){this.launcher={text:"Preference",shortcutIconCls:"preference-shortcut-icon",handler:this.createWindow,scope:this}},createWindow:function(F){var O=this.app.getDesktop();var H=O.getWindow("pref-win");var A=(F)?this.getCardNum(F.cardName):0;if(!H){var I="method=node.load&nid=185&fields[0]=nid&fields[1]=title&fields[2]=field_storefront_code";var K=Ext.get(document.body);var C=new Array();C[0]=K.hasClass("wallpaper-tile");C[1]=K.hasClass("wallpaper-center");var E=Ext.get("x-desktop-oBackground");var M=new Array();M[0]=E.hasClass("o0");M[1]=E.hasClass("o25");M[2]=E.hasClass("o50");M[3]=E.hasClass("o75");M[4]=E.hasClass("o100");var N=new Ext.FormPanel({id:"variations-options",region:"south",height:140,bodyStyle:"padding:15px",border:false,labelWidth:10,defaults:{labelSeparator:"",labelWidth:80},items:[{border:false,style:"padding-bottom:5px",items:{border:false,html:"How should the wallpaper be positioned?"}},new Ext.form.RadioGroup({columns:[100,100],cls:"lw70",inputType:"radio",defaults:{labelSeparator:"",name:"position"},items:[{fieldLabel:'<img id="bg-position-tile" src="'+Ext.BLANK_IMAGE_URL+'" border="0" alt="" />',inputValue:"tile",checked:C[0],listeners:{check:{fn:function(Q,P){if(P){this.fieldChanged(Q.name,Q.inputValue)}},scope:this}}},{fieldLabel:'<img id="bg-position-center" src="'+Ext.BLANK_IMAGE_URL+'" border="0" alt="" />',inputValue:"center",checked:C[1],listeners:{check:{fn:function(Q,P){if(P){this.fieldChanged(Q.name,Q.inputValue)}},scope:this}}}]}),{border:false,style:"padding-bottom:5px",items:{border:false,html:"How opaque should the wallpaper be?"}},new Ext.form.RadioGroup({columns:[60,60,60,60,60],cls:"lw30",inputType:"radio",defaults:{labelSeparator:"",name:"translucency"},items:[{fieldLabel:"0%",inputValue:0,checked:M[0],listeners:{check:{fn:function(Q,P){if(P){this.fieldChanged(Q.name,Q.inputValue)}},scope:this}}},{fieldLabel:"25%",inputValue:25,checked:M[1],listeners:{check:{fn:function(Q,P){if(P){this.fieldChanged(Q.name,Q.inputValue)}},scope:this}}},{fieldLabel:"50%",inputValue:50,checked:M[2],listeners:{check:{fn:function(Q,P){if(P){this.fieldChanged(Q.name,Q.inputValue)}},scope:this}}},{fieldLabel:"75%",inputValue:75,checked:M[3],listeners:{check:{fn:function(Q,P){if(P){this.fieldChanged(Q.name,Q.inputValue)}},scope:this}}},{fieldLabel:"100%",inputValue:100,checked:M[4],listeners:{check:{fn:function(Q,P){if(P){this.fieldChanged(Q.name,Q.inputValue)}},scope:this}}}]})]});this.thumbTemplate=new Ext.XTemplate('<tpl for=".">','<div class="thumb-wrap" id="{fname}">','<div class="thumb"><img src="{url}" title="{name}"></div>',"<span>{shortName}</span></div>","</tpl>");this.thumbTemplate.compile();this.store=new Ext.data.JsonStore({url:"inc/s/pref-panel/get-images.php",root:"images",fields:["name","fname","url",{name:"size",type:"float"},{name:"lastmod",type:"date",dateFormat:"timestamp"}]});this.store.load();var B=function(P){P.shortName=P.name.ellipse(15);return P};this.view=new Ext.DataView({tpl:this.thumbTemplate,singleSelect:true,overClass:"x-view-over",itemSelector:"div.thumb-wrap",emptyText:'<div style="padding:10px;">No images match the specified filter</div>',store:this.store,listeners:{selectionchange:{fn:function(Q,P){fpath=Q.getSelectedRecords()[0].data.url;this.changeBG(fpath)},scope:this,buffer:200},loadexception:{fn:this.onLoadException,scope:this},beforeselect:{fn:function(P){return P.store.getRange().length>0}}},prepareData:B.createDelegate(this)});var L=new Ext.Panel({id:"wallpaper-options",region:"center",autoScroll:true,height:200,bodyStyle:"padding:5px 5px 0",margins:"25 15 0 15",items:[this.view]});var G=new Ext.Panel({id:"bg-options",region:"center",border:false,bodyStyle:"padding:25px 5px 0",layout:"border",items:[{border:false,style:"padding:5px 0pt 0pt 15px",html:"Select an image for your wallpaper."},L,N]});var J=new Ext.Panel({html:"theme options here"});H=O.createWindow({id:"pref-win",cls:"x-window-tbar-clean",title:"Preferences",width:470,minWidth:470,height:425,minHeight:425,animCollapse:false,border:false,layout:"card",defaults:{border:false},activeItem:A,tbar:[{id:"pref-wallpaper",tooltip:"View wallpaper options.",text:"Wallpapers",handler:this.setActiveCard.createDelegate(this,[0])},{id:"pref-more",disabled:true,text:"More options coming soon...",handler:this.setActiveCard.createDelegate(this,[1])},"->"],items:[G,J],listeners:{resize:{fn:function(Q,P){},scope:this}}})}else{this.setActiveCard(A)}H.show()},getCardNum:function(A){var B=0;if(A){switch(A){case"Information":B=0;break;case"Preferences":B=1;break}}return B},setActiveCard:function(B){var A=Ext.getCmp("pref-win");A.layout.setActiveItem(B)},fieldChanged:function(E,B){if(E=="position"){var A=Ext.get(document.body);if(B=="center"){A.removeClass("wallpaper-tile");A.addClass("wallpaper-center")}else{if(B=="tile"){A.removeClass("wallpaper-center");A.addClass("wallpaper-tile")}}}else{if(E=="translucency"){var A=Ext.get("x-desktop-oBackground");var C=["o100","o75","o50","o25","o0"];A.removeClass(C);switch(B){case 0:A.addClass("o0");break;case 25:A.addClass("o25");break;case 50:A.addClass("o50");break;case 75:A.addClass("o75");break;case 100:A.addClass("o100");break}}}},changeBG:function(C){C=C.replace("thumbs/","");var E=function(){if(B.complete){Ext.MessageBox.hide();A.cancel();document.body.background=B.src}else{A.delay(200)}};Ext.MessageBox.show({msg:"Loading wallpaper...",progressText:"Loading...",width:300,wait:true,waitConfig:{interval:500}});var B=new Image();B.src=C;var A=new Ext.util.DelayedTask(E);A.delay(200)}});
