Ext.ns("bc.campaign");bc.campaign.Campaign=function(){var b={};b.get=function(){};return b};Ext.ns("bc.channel");bc.channel.Channel=function(b){var a={},d,c,f;a.setName=function(e){f=e};a.getName=function(){return f};a.setLayout=function(e){d=e};a.getLayout=function(){return d};a.setSearch=function(e){c=e};a.getSearch=function(){return c};if(b){if(b.name)f=b.name;d=b.layout?b.layout:bc.layout.DEFAULT_LAYOUT;if(b.search)c=b.search}return a};Ext.ns("bc.command.session");
bc.command.session.Session=function(){function b(){c=(new Date).getTime()}function a(g){var h=g.lastIndexOf(" ");return h>-1?g.substr(h+1):g}var d={},c,f,e={},n={};d.startTime=function(){return c};d.activateCommand=function(g){d.deactivateCommand();g=a(g);if(bc.command[g]){f=bc.command[g]();e[g]=f}};d.deactivateCommand=function(){f=null};d.commandIssued=function(g){return e[g]};d.commandSupportsLookahead=function(){if(f)return f.lookaheadMgr!=null;return false};d.appendCommandLookaheadBuffer=function(g){d.commandSupportsLookahead()&&
f.lookaheadMgr.appendBuffer(g)};d.truncateCommandLookaheadBuffer=function(g){d.commandSupportsLookahead()&&f.lookaheadMgr.truncateBuffer(g)};d.commandLookaheadBuffer=function(){if(d.commandSupportsLookahead())return f.lookaheadMgr.buffer();return false};d.lookaheadComponentDisplayed=function(){if(d.commandSupportsLookahead()){arguments.length>0&&f.lookaheadMgr.componentDisplayed(arguments[0]);return f.lookaheadMgr.componentDisplayed()}return false};d.focusLookaheadSelection=function(g){d.commandSupportsLookahead()&&
f.lookaheadMgr.focusSelection(g)};d.navigateLookaheadComponent=function(g){d.commandSupportsLookahead()&&f.lookaheadMgr.navigateComponent(g)};d.destroyLookaheadComponentIfDisplayed=function(){d.commandSupportsLookahead()&&f.lookaheadMgr.destroyComponentIfDisplayed()};d.lookaheadSelectionSwaps=function(){return n};d.applyLookaheadSelectionSwaps=function(g){var h=g;for(var m in n)h=g.split(m).join(n[m]);return h};b();return d};Ext.ns("bc.cmdhist");
bc.cmdhist.CommandHistory=function(b){function a(){d.allCommands={};for(var e=0,n=b.length;e<n;e++)d.allCommands[b[e]]=1}var d={},c=-1,f;d.hasNext=function(){return c+1<b.length};d.next=function(){if(d.hasNext())return b[++c]};d.hasPrev=function(){return c-1>=0};d.prev=function(){if(d.hasPrev())return b[--c];else if(f)return f};d.current=function(){return b[c]};d.remove=function(){return b.remove[b[c]]};d.getPosition=function(){return c};d.cliInput=function(){if(arguments.length>=1&&!d.allCommands[arguments[0]])f=
arguments[0];return f};a();return d};Ext.ns("bc.commmand");bc.command.ask=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.ITEMACTION;b.process=function(){return{}};return b};Ext.ns("bc.commmand");bc.command.bid=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.ITEMACTION;b.process=function(){return{}};return b};Ext.ns("bc.commmand");
bc.command.category=function(){function b(){d.cmdType=bc.command.CMDTYPE.FINDQUERY;d.lookaheadMgr=bc.command.category.lookaheadMgr(f);a()}function a(){Ext.Ajax.request({url:"/ebaycat/idlist",method:"POST",params:{},success:function(e){eval("var categoryIdList = "+e.responseText);c=categoryIdList.idlist},failure:function(){}})}var d=bc.command.Command(),c,f=3;b();d.validInput=function(e){return c?c[e]?true:false:true};d.substituteCommand=function(){return"keyword"};d.process=function(e){return{CategoryID:e}};
return d};bc.command.cat=bc.command.category;bc.command.catname=bc.command.category;
bc.command.category.lookaheadMgr=function(b){function a(){}function d(){Ext.Ajax.request({url:"/ebaycat/namebegins/"+h,method:"POST",params:{},success:function(j){j=Ext.util.JSON.decode(j.responseText);f(j)},failure:function(j){alert("Failure!\n"+j.responseText)}})}function c(j,r){p.lookaheadSelectionSwaps()[j]=r}function f(j){j=j.catlist;if(j.length>1)bc.commander.activeInstance.ui.showLookaheadPanel(j);else j.length==1?e(j[0]):g.destroyComponentIfDisplayed()}function e(j){n(j);g.destroyComponentIfDisplayed();
c(j.categorynamepath,j.ebay_categoryid)}function n(j){var r=bc.commander.activeInstance.ui.getDashboardCommandEl(),o=r.getValue(),x=o.lastIndexOf(p.commandLookaheadBuffer());categoryLookAheadBuffer="";r.setValue(o.substr(0,x)+j.categorynamepath);p.deactivateCommand()}var g={},h,m,k,p=bc.commander.activeInstance.startCliSession();a();g.appendBuffer=function(j){if(!h&&j!=":"&&j!=" ")h=j;else if(h)h+=j;h&&h.length>=b&&d()};g.truncateBuffer=function(j){if(h)h=j<h.length?h.substr(0,h.length-j):"";h&&h.length>=
b?d():g.destroyComponentIfDisplayed()};g.buffer=function(){return h};g.componentDisplayed=function(){if(arguments.length>0)k=arguments[0];return k};g.navigateComponent=function(j){if(m){var r=m;if(j==Ext.EventObject.LEFT||j==Ext.EventObject.UP)g.focusSelection(--r);else if(j==Ext.EventObject.RIGHT||j==Ext.EventObject.DOWN)g.focusSelection(++r);else if(j==Ext.EventObject.ENTER){j=bc.commander.activeInstance.ui.lookaheadData()[m-1];e(j)}}};g.focusSelection=function(j){if(j!=m){var r=Ext.get("lookahead-selection-"+
m);r&&r.removeClass("lookahead-table-cell-selected")}if(r=Ext.get("lookahead-selection-"+j)){r.addClass("lookahead-table-cell-selected");m=j}else{Ext.get("lookahead-selection-1").addClass("lookahead-table-cell-selected");m=1}};g.destroyComponentIfDisplayed=function(){if(g.componentDisplayed()){bc.commander.activeInstance.ui.destroyLookaheadPanel();g.componentDisplayed(false)}};return g};Ext.ns("bc.commmand");bc.command.categoryid=function(){function b(){d.cmdType=bc.command.CMDTYPE.FINDQUERY;a()}function a(){Ext.Ajax.request({url:"/ebaycat/idlist",method:"POST",params:{},success:function(f){eval("var categoryIdList = "+f.responseText);c=categoryIdList.idlist},failure:function(){}})}var d=bc.command.Command(),c;b();d.validInput=function(f){return c?c[f]?true:false:true};d.substituteCommand=function(){return"keyword"};d.process=function(f){return{CategoryID:f}};return d};
bc.command.catid=bc.command.categoryid;Ext.ns("bc.commmand");bc.command.condition=function(){var b=bc.command.Command(),a={"new":com.ebay.shoppingservice.ItemConditionCodeType.New,used:com.ebay.shoppingservice.ItemConditionCodeType.Used};b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(d){if(a[d.toLowerCase()])return{Condition:a[d.toLowerCase()]}};return b};bc.command.cond=bc.command.condition;Ext.ns("bc.commmand");bc.command.echoenv=function(){me=bc.command.Command();me.process=function(b){bc.env[b]?alert(bc.env[b]):alert("environment var not found")};return me};Ext.ns("bc.commander");bc.commander.GenericCommander=function(b){var a={};a.getName=function(){return b};Ext.QuickTips.init();return a};
bc.commander.EbayCommander=function(){function b(){o.bus=new Ext.util.Observable}function a(){o.stateManager=bc.identity.StateManager();o.stateManager.run(d)}function d(){o.identity=o.stateManager.getIdentity();Ext.state.Manager.setProvider(new bc.state.ModuleWebServiceProvider);o.ui=bc.ui.UI();p()}function c(){if(!u){o.ui.renderModules();u=true}}function f(){if(!x){o.commandprocessor=bc.command.CommandProcessor();o.shortcutmanager=bc.shortcuts.ShortcutsManager();o.displayNextItem=e;o.displayPrevItem=
n;o.launchViewItemPage=h;o.bus.on(bc.events.USER_LOGIN_STATE_CHANGE,j);x=true;o.ui.hideSplash();bc.cookie.Bccookie.visits.count()<1&&o.ui.showWelcome()}}function e(){var q=o.stateManager.getIdentity().getUuid(),v=o.datamanager.dataIterator.current();if(q&&v){o.stateManager.getViewedItems()[v.itemID]=1;g(q,v.itemID)}v&&pageTracker._trackPageview("/evt_next_item/"+v.itemID);if(o.datamanager.dataIterator.hasNext()){v=o.datamanager.dataIterator.next();o.ui.updateModules(v)}}function n(){o.stateManager.getIdentity().getUuid();
if(o.datamanager.dataIterator.hasPrev()){var q=o.datamanager.dataIterator.prev();q&&pageTracker._trackPageview("/evt_prev_item/"+q.itemID);o.ui.updateModules(q)}}function g(q,v){Ext.Ajax.request({url:"/vieweditems/setviewed/"+q+"/"+v,method:"POST",success:function(){},failure:function(){}})}function h(){var q=o.datamanager.dataIterator.current();if(window.open(q.viewItemURLForNaturalSearch))q&&pageTracker._trackPageview("/evt_ebayview_item/"+q.itemID);else{q&&pageTracker._trackPageview("/evt_pbwarn_item/"+
q.itemID);pageTracker._trackEvent("Warning","PopupBlockerWarning");o.ui.showPopupBlockerWarning()}}function m(){c();e();f()}function k(){Ext.Msg.alert("Search Error","There were no items found matching your search criteria.");(function(){Ext.MessageBox.hide()}).defer(3E3);o.stateManager.updateCriteria(y);z++<1&&o.datamanager.fetchActiveCriteriaIterator(y)}function p(){if(!o.datamanager){o.datamanager=bc.ebay.DataManager();o.datamanager.fetchHandlers({success:m,failure:k})}j()}function j(){var q=o.stateManager.getActiveCriteria();
if(bc.rerouted.payload&&bc.rerouted.payload.command){q=r(bc.rerouted.payload.command);bc.command.CommandProcessor().process(q);bc.rerouted={}}else o.datamanager.fetchActiveCriteriaIterator(q)}function r(q){var v="";for(var s in q)v+=s+": "+q[s]+" ";return v}var o=bc.commander.GenericCommander("EbayCommander"),x=false,u=false,w,z=0,y={CategoryID:1172};o.getStateManager=function(){return o.stateManager};var l=function(){b();a()};o.run=function(){o.eBay=bc.ebay.EBay(l)};o.startCliSession=function(){if(w==
null)w=bc.command.session.Session();return w};o.endCliSession=function(){w=null};return o};Ext.ns("bc.commmand");bc.command.itemid=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.ITEMQUERY;b.process=function(a){return{ItemID:a}};return b};Ext.ns("bc.commmand");
bc.command.itemtype=function(){var b=bc.command.Command(),a={allfixedprice:com.ebay.shoppingservice.ItemTypeCodeType.AllFixedPriceItemTypes,all:com.ebay.shoppingservice.ItemTypeCodeType.AllItems,auction:com.ebay.shoppingservice.ItemTypeCodeType.AuctionItemsOnly,classifieds:com.ebay.shoppingservice.ItemTypeCodeType.ClassifiedItemsOnly,excludestores:com.ebay.shoppingservice.ItemTypeCodeType.ExcludeStoreInventory,fixedprice:com.ebay.shoppingservice.ItemTypeCodeType.FixedPriceItem};b.cmdType=bc.command.CMDTYPE.FINDQUERY;
b.process=function(d){return a[d.toLowerCase()]?{ItemType:a[d.toLowerCase()]}:""};return b};bc.command.type=bc.command.itemtype;Ext.ns("bc.command");bc.command.Command=function(){var b={};b.cmdType=bc.command.CMDTYPE.UNKNOWN;b.process=function(){};return b};
bc.command.CommandProcessor=function(){var b={},a=bc.commander.activeInstance.startCliSession();b.process=function(d){d=a.applyLookaheadSelectionSwaps(d);d=bc.command.Parser.parse(d);for(var c=bc.command.CommandManager(),f=0;f<d.length;f++){var e=d[f],n=e[0];e=e[1];if(bc.command[n]){n=a.commandIssued(n)||bc.command[n]();if(n.validInput&&!n.validInput(e))if(n.substituteCommand){n=n.substituteCommand();if(bc.command[n])n=bc.command[n]();else continue}else continue;c.processCommandResult(n.cmdType,n.process(e))}else Ext.MessageBox.alert("Unknown Command: "+
n)}c.executeCommandActions()};return b};bc.command.CMDTYPE={UNKNOWN:0,FINDQUERY:1,ITEMQUERY:2,ITEMACTION:3};
bc.command.CommandManager=function(){var b={},a={},d=0,c=bc.commander.activeInstance.bus,f=bc.commander.activeInstance.stateManager;b.processCommandResult=function(e,n){switch(e){case bc.command.CMDTYPE.FINDQUERY:d=bc.command.CMDTYPE.FINDQUERY;b.appendCriteriaChange(n);break;case bc.command.CMDTYPE.ITEMQUERY:d=bc.command.CMDTYPE.ITEMQUERY;b.appendCriteriaChange(n);break}};b.executeCommandActions=function(){b.executeCriteriaChange()};b.appendCriteriaChange=function(e){Ext.apply(a,e)};b.executeCriteriaChange=
function(){if(a!={}){switch(d){case bc.command.CMDTYPE.FINDQUERY:c.fireEvent(bc.events.CRITERIA_CHANGE,a);f.updateCriteria(a);break;case bc.command.CMDTYPE.ITEMQUERY:c.fireEvent(bc.events.ITEM_LOOKUP,a);break}a={}}};return b};
bc.command.Parser=function(){function b(c){c=c.replace(/^\s+/g,"");return c.replace(/\s+$/g,"")}function a(c,f){var e=new RegExp("\u000b");if(f.test(c)){c=c.split(f);for(i=0;i<c.length;i++)for(c[i]=b(c[i]);e.test(c[i]);)c[i]=c[i].replace(e,":");return c}else{for(;e.test(c);)c=c.replace(e,":");return b(c)}}function d(c,f){return new Array(b(c[0]),a(c[1],f))}return{parse:function(c){for(var f=/:/,e=/\"[^\"]*\"/,n=/'[^']*'/,g=/[^ :]*:[^:]+(?=\s\S+:)/,h=/,/,m=/"/,k=/'/,p=[];e.test(c);){for(var j=""+e.exec(c),
r=j.replace(f,"\u000b");m.test(r);)r=r.replace('"',"");c=c.replace(j,r)}for(;n.test(c);){j=""+n.exec(c);for(r=j.replace(f,"\u000b");k.test(r);)r=r.replace("'","");c=c.replace(j,r)}for(;g.test(c);){j=""+g.exec(c);e=j.split(f);if(c.indexOf(j)!=0&&p.length==0){n=c.split(j);p.push(d(new Array("keyword",n[0]),h));c=c.substr(c.indexOf(j))}p.push(d(e,h));c=b(c.replace(j,""))}e=c.split(f);if(e.length!=1){arr1=b(e[0]).split(" ");if(arr1.length>1){e[0]=arr1[arr1.length-1];arr1[arr1.length-1]=null;p.push(d(new Array("keyword",
arr1.join(" ")),h))}p.push(d(e,h))}else p.push(d(new Array("keyword",e[0]),h));return p}}}();Ext.ns("bc.commmand");bc.command.keyword=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(a){return{QueryKeywords:a}};return b};Ext.ns("bc.commmand");bc.command.layout=function(){var b=bc.command.Command();b.process=function(a){bc.commander.activeInstance.bus.fireEvent(bc.events.LAYOUT_CHANGE,{data:a})};return b};bc.command.lo=bc.command.layout;Ext.ns("bc.commmand");bc.command.layouttoggle=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.ITEMACTION;b.process=function(a){var d=bc.commander.activeInstance.ui;d.updateModulesWinConfig({frame:a=="true"?false:true});a=bc.commander.activeInstance.datamanager.dataIterator.current();d.updateModules(a);return{}};return b};bc.command.tl=bc.command.layouttoggle;Ext.ns("bc.commmand");bc.command.maxbids=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(a){return{BidCountMax:a}};return b};bc.command.maxbid=bc.command.maxbids;bc.command.bidmax=bc.command.maxbids;bc.command.maximumbid=bc.command.maxbids;bc.command.maximumbids=bc.command.maxbids;bc.command.bidmaximum=bc.command.maxbids;bc.command.bidcountmax=bc.command.maxbids;bc.command.maxbidcount=bc.command.maxbids;bc.command.bidcntmax=bc.command.maxbids;
bc.command.bidcountmaximum=bc.command.maxbids;bc.command.mostbids=bc.command.maxbids;Ext.ns("bc.commmand");bc.command.maxdistance=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(a){return{MaxDistance:a}};return b};bc.command.distance=bc.command.maxdistance;bc.command.far=bc.command.maxdistance;Ext.ns("bc.commmand");bc.command.maxfeedback=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(a){return{FeedbackScoreMax:a}};return b};bc.command.feedbackmax=bc.command.maxfeedback;bc.command.maxfb=bc.command.maxfeedback;Ext.ns("bc.commmand");bc.command.minbid=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(a){return{BidCountMin:a}};return b};bc.command.minbids=bc.command.minbid;bc.command.bidmin=bc.command.minbid;bc.command.minimumbid=bc.command.minbid;bc.command.minimumbids=bc.command.minbid;bc.command.bidcountmin=bc.command.minbid;bc.command.bidcntmin=bc.command.minbid;bc.command.biccountminimum=bc.command.minbid;bc.command.bids=bc.command.minbid;Ext.ns("bc.commmand");bc.command.minfeedback=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(a){return{FeedbackScoreMin:a}};return b};bc.command.fb=bc.command.minfeedback;bc.command.minfb=bc.command.minfeedback;bc.command.feedback=bc.command.minfeedback;Ext.ns("bc.commmand");bc.command.notcategoryid=function(){function b(){d.cmdType=bc.command.CMDTYPE.FINDQUERY;a()}function a(){Ext.Ajax.request({url:"/ebaycat/idlist",method:"POST",params:{},success:function(f){eval("var categoryIdList = "+f.responseText);c=categoryIdList.idlist},failure:function(){}})}var d=bc.command.Command(),c;b();d.validInput=function(f){return c?c[f]?true:false:true};d.substituteCommand=function(){return"keyword"};d.process=function(f){return{CategoryIDExclude:f}};return d};
bc.command.notcatid=bc.command.notcategoryid;bc.command.nocatid=bc.command.notcategoryid;bc.command.ncatid=bc.command.notcategoryid;Ext.ns("bc.commmand");bc.command.postalcode=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(a){return{PostalCode:a}};return b};bc.command.zip=bc.command.postalcode;bc.command.zipcode=bc.command.postalcode;Ext.ns("bc.commmand");bc.command.pricemax=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(a){return{PriceMax:{currencyID:com.ebay.shoppingservice.CurrencyCodeType.USD,Value:a}}};return b};bc.command.maxprice=bc.command.pricemax;bc.command.maximumprice=bc.command.pricemax;bc.command.priceunder=bc.command.pricemax;bc.command.under=bc.command.pricemax;Ext.ns("bc.commmand");bc.command.pricemin=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(a){return{PriceMin:{currencyID:com.ebay.shoppingservice.CurrencyCodeType.USD,Value:a}}};return b};bc.command.minprice=bc.command.pricemin;bc.command.minimumprice=bc.command.pricemin;bc.command.priceover=bc.command.pricemin;bc.command.over=bc.command.pricemin;Ext.ns("bc.commmand");bc.command.sellerid=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(a){return{SellerID:a}};return b};bc.command.seller=bc.command.sellerid;Ext.ns("bc.commmand");bc.command.setenv=function(){var b=bc.command.Command();b.process=function(){};return b};Ext.ns("bc.commmand");
bc.command.sort=function(){var b=bc.command.Command(),a={bestmatch:com.ebay.shoppingservice.SimpleItemSortCodeType.BestMatch,bestmatchcategorygroup:com.ebay.shoppingservice.SimpleItemSortCodeType.BestMatchCategoryType,bestmatchplusendtime:com.ebay.shoppingservice.SimpleItemSortCodeType.BestMatchPlusEndTime,bestmatchplusprice:com.ebay.shoppingservice.SimpleItemSortCodeType.BestMatchPlusPrice,bidcount:com.ebay.shoppingservice.SimpleItemSortCodeType.BidCount,country:com.ebay.shoppingservice.SimpleItemSortCodeType.Country,currentbid:com.ebay.shoppingservice.SimpleItemSortCodeType.CurrentBid,
distance:com.ebay.shoppingservice.SimpleItemSortCodeType.Distance,endtime:com.ebay.shoppingservice.SimpleItemSortCodeType.EndTime,priceplusshipping:com.ebay.shoppingservice.SimpleItemSortCodeType.PricePlusShipping,startdate:com.ebay.shoppingservice.SimpleItemSortCodeType.StartDate};b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(d){return a[d.toLowerCase()]?{ItemSort:a[d.toLowerCase()]}:""};return b};bc.command.itemsort=bc.command.sort;bc.command.sortby=bc.command.sort;Ext.ns("bc.commmand");
bc.command.sortorder=function(){var b=bc.command.Command(),a={ascending:com.ebay.shoppingservice.SortOrderCodeType.Ascending,asc:com.ebay.shoppingservice.SortOrderCodeType.Ascending,a:com.ebay.shoppingservice.SortOrderCodeType.Ascending,descending:com.ebay.shoppingservice.SortOrderCodeType.Descending,desc:com.ebay.shoppingservice.SortOrderCodeType.Descending,d:com.ebay.shoppingservice.SortOrderCodeType.Descending};b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(d){return a[d.toLowerCase()]?{SortOrder:a[d.toLowerCase()]}:
""};return b};bc.command.order=bc.command.sortorder;Ext.ns("bc.commmand");bc.command.storename=function(){var b=bc.command.Command();b.cmdType=bc.command.CMDTYPE.FINDQUERY;b.process=function(a){return{StoreName:a}};return b};bc.command.store=bc.command.storename;Ext.ns("bc.cookie");
bc.cookie.Bccookie=function(){var b={};b.initInfo={exist:function(){return YAHOO.util.Cookie.get("initinfo")!=null},get:function(){return Ext.util.JSON.decode(YAHOO.util.Cookie.get("initinfo"))},remove:function(){YAHOO.util.Cookie.remove("initinfo",{domain:".buyercommand.com"})}};b.uuid={exist:function(){return YAHOO.util.Cookie.get("idt")!=null},get:function(){return YAHOO.util.Cookie.get("idt")},remove:function(){YAHOO.util.Cookie.remove("idt",{domain:".buyercommand.com"})}};b.visits={count:function(){var a=
YAHOO.util.Cookie.get("bcv"),d=new Date("January 12, 2025");a==null?YAHOO.util.Cookie.set("bcv",1,{expires:d}):YAHOO.util.Cookie.set("bcv",parseInt(a)+1,{expires:d});return a==null?0:a}};return b}();Ext.ns("bc.ebay");
bc.ebay.EBay=function(b){function a(f){var e=new com.ebay.shoppingservice.ShoppingConfig(c);d.service=new com.ebay.shoppingservice.Shopping(e);if(!d.service)throw new Error("eBay service failed");f()}var d={},c={version:607,appId:"BidiomIn-f041-466b-ba0e-23d19778df82",trackingId:"5335821432",trackingPartnerCode:"9",affiliateUserId:"user"};com.ebay.widgets.needs({baseUrl:"http://w-1.ebay.com/js/607/min/",files:["GetSingleItem.js","FindItemsAdvanced.js","GetItemStatus.js","GetCategoryInfo.js"],resources:[].concat(com.ebay.shoppingservice.Shopping.getSingleItem,
com.ebay.shoppingservice.Shopping.findItemsAdvanced,com.ebay.shoppingservice.Shopping.getItemStatus,com.ebay.shoppingservice.Shopping.getCategoryInfo),callback:function(){a(b)}});d.getSingleItem=function(f,e){f=new com.ebay.shoppingservice.ShoppingCallback(f);e=new com.ebay.shoppingservice.GetSingleItemRequestType(e);d.service.getSingleItem(e,f)};d.getItemStatus=function(f,e){f=new com.ebay.shoppingservice.ShoppingCallback(f);e=new com.ebay.shoppingservice.GetItemStatusRequestType(e);d.service.getItemStatus(e,
f)};d.findItemsAdvanced=function(f,e){f=new com.ebay.shoppingservice.ShoppingCallback(f);bc.log(Ext.util.JSON.encode(e));e=new com.ebay.shoppingservice.FindItemsAdvancedRequestType(e);d.service.findItemsAdvanced(e,f)};d.getCategoryInfo=function(f,e){f=new com.ebay.shoppingservice.ShoppingCallback(f);e=new com.ebay.shoppingservice.GetCategoryInfoRequestType(e);d.service.getCategoryInfo(e,f)};return d};
bc.ebay.DataManager=function(){function b(l){bc.log(l)}function a(){bc.log("inside: _topLevelCatFetchFailure")}function d(l){l.MaxEntries=k.defaultPageSize;l.IncludeSelector="Details, SearchDetails, SellerInfo, ItemSpecifics, IncludePictureURL";return l}function c(l){x=l;if(l.searchResult!=null&&l.searchResult[0].itemArray.item.length>0){l=e(l.searchResult[0].itemArray.item);z+=k.defaultPageSize-l.length;if(l.length==0)k.growItemList();else{g(l);u=u.concat(l);if(!k.dataIterator){k.dataIterator=bc.ebay.ManagerActiveDataGrowIterator(k);
o.success()}}}}function f(l){x=l;if(l.searchResult!=null&&l.searchResult[0].itemArray.item.length>0){u=e(l.searchResult[0].itemArray.item);z+=k.defaultPageSize-u.length;if(u.length==0)k.growItemList();else{g(u);k.dataIterator=bc.ebay.ManagerActiveDataGrowIterator(k);o.success()}}else o.failure()}function e(l){var q=bc.commander.activeInstance.getStateManager().getViewedItems();_filteredItems=[];for(var v=0,s=l.length;v<s;v++)q[l[v].itemID]||_filteredItems.push(l[v]);return _filteredItems}function n(l){x=
l;if(l.item){u=[].concat(l.item);if(!x.totalItems)x.totalItems=1;g(u);k.dataIterator=bc.ebay.ManagerActiveDataIterator(k);o.success()}else o.failure()}function g(l){for(var q=0;q<l.length;q++)for(var v=0;v<l[q].pictureURL.length;v++){function s(t){var A=new Image;A.onload=function(){bc.log("loaded "+t)};A.src=t}s(l[q].pictureURL[v])}}function h(){j=r;w++<1?k.fetchActiveCriteriaIterator(r):o.failure()}function m(){bc.commander.activeInstance.bus.on(bc.events.CRITERIA_CHANGE,k.fetchActiveCriteriaIterator);
bc.commander.activeInstance.bus.on(bc.events.ITEM_LOOKUP,k.fetchItemIDIterator)}var k={},p=bc.commander.activeInstance.eBay,j={},r={},o,x={},u=[],w=0,z=0,y=1;k.defaultPageSize=5;k.fetchHandlers=function(l){o=l};k.fetchActiveCriteriaIterator=function(l){r=j;j=l;l=d(l);p.findItemsAdvanced({success:f,failure:h},l)};k.fetchItemIDIterator=function(l){j=l;p.getSingleItem({success:n,failure:h},l)};k.getRetrievedListLength=function(){return u.length};k.getTotalItemsLength=function(){return x.totalItems-z};
k.getCurrentItemPosition=function(){return k.dataIterator.getPosition()};k.getItems=function(){return u};k.growItemList=function(){if(x.pageNumber!==undefined&&x.totalPages>y++){var l=j;l=d(l);l.pageNumber=y;p.findItemsAdvanced({success:c,failure:h},l)}};k.getChildCategories=function(l){p.getChildCategories({success:b,failure:a},{siteid:0,CategoryID:l,IncludeSelector:"ChildCategories"})};k.fetchAllCategories=function(){for(var l=[-1];l.length>0;){var q=l.pop();k.getChildCategories(q)}};m();return k};
bc.ebay.ManagerActiveDataIterator=function(b){var a=b.getItems(),d={},c=-1;d.hasNext=function(){return c+1<b.getTotalItemsLength()};d.next=function(){a=b.getItems();if(d.hasNext())return a[++c]};d.hasPrev=function(){a=b.getItems();return c-1>=0};d.prev=function(){a=b.getItems();return a[--c]};d.current=function(){a=b.getItems();return a[c]};d.remove=function(){a=b.getItems();return a.remove[a[c]]};d.getPosition=function(){return c};return d};
bc.ebay.ManagerActiveDataGrowIterator=function(b){function a(){return b.getRetrievedListLength()<b.getTotalItemsLength()&&d.getPosition()>b.getRetrievedListLength()-b.defaultPageSize}var d=bc.ebay.ManagerActiveDataIterator(b),c={};c.next=d.next;d.next=function(){a()&&b.growItemList();return c.next()};return d};Ext.ns("bc.env");Ext.ns("bc.events");bc.events.LAYOUT_CHANGE="layout_change";bc.events.CUST_WINDOW_HIDE="customize_window_hide";bc.events.CUST_WINDOW_SHOW="customize_window_show";bc.events.JOIN_WINDOW_HIDE="join_window_hide";bc.events.JOIN_WINDOW_SHOW="join_window_show";bc.events.LOGIN_WINDOW_HIDE="login_window_hide";bc.events.LOGIN_WINDOW_SHOW="login_window_show";bc.events.USER_LOGIN_STATE_CHANGE="user_login_state_change";bc.events.CAMPAIGN_LOAD="campaign_load";bc.events.CRITERIA_CHANGE="criteria_change";
bc.events.ITEM_LOOKUP="item_lookup";bc.events.ITEM_IMG_WIN_SHOW="item_img_win_show";Ext.ns("bc.identity");
bc.identity.Identity=function(b){var a={},d=null,c="",f="",e=null,n=null,g="",h="";a.state=bc.commander.activeInstance.stateManager;a.setUuid=function(m){d=m};a.getUuid=function(){return d};a.setFirstName=function(m){c=m};a.getFirstName=function(){return c};a.setLastName=function(m){f=m};a.getLastName=function(){return f};a.getFullName=function(){return getFirstName()+" "+getLastName()};a.setInitDate=function(m){e=m};a.getInitDate=function(){return e};a.setJoinDate=function(m){n=m};a.getJoinDate=
function(){return n};a.setEmail=function(m){g=m};a.getEmail=function(){return g};a.setPassword=function(m){h=m};a.getPassword=function(){return h};if(b){if(b.uuid)d=b.uuid;if(b.fname!=undefined)c=b.fname;if(b.lname!=undefined)f=b.lname;if(b.init_date!=undefined)e=b.init_date;if(b.join_date!=undefined)n=b.join_date;if(b.email!=undefined)g=b.email}return a};Ext.ns("bc.identity");
bc.identity.StateManager=function(){function b(k){if(!k)throw new Error("No identity state");d=bc.identity.Identity(k.identity);if(k.activechannel){n=k.activechannel;g=k.channels[k.activechannel].layout;h=k.channels[k.activechannel].search}c=k.channels;f=k.searches;e=k.layouts;m=k.viewed_items}var a={},d=null,c,f,e,n,g,h,m;a.addHandlers=function(k){for(var p in k)m_handlers[p].push(k[p])};a.getIdentity=function(){return d};a.getViewedItems=function(){return m};a.getActiveCriteria=function(){return f[c[n].search]};
a.getActiveModules=function(){return e[c[n].layout]};a.getActiveChannel=function(){return n};a.getActiveLayout=function(){return g};a.getActiveSearch=function(){return h};a.run=function(k){a.refreshIdentity(new Array(k))};a.isUserLoggedIn=function(){return d.getEmail()?true:false};a.subscribeModule=function(k,p){var j=k.getInfo(),r={};r.addmodules={};r.addmodules[k.cls]={};delete j.cls;delete j.name;delete j.description;delete j.image;r.addmodules[k.cls]=j;a.updateIdentityChanges(r,p)};a.unsubscribeModule=
function(k,p){k.getInfo();var j={};j.removemodules={};j.removemodules[k.cls]={};a.updateIdentityChanges(j,p)};a.updateCriteria=function(k,p){a.updateIdentityChanges({criteriaupdate:k},p)};a.isModuleActive=function(k){return a.getActiveModules()[k]?true:false};a.refreshIdentity=function(k){Ext.Ajax.request({url:"/user/getidentitystate",method:"POST",success:function(p){p=Ext.util.JSON.decode(p.responseText);if(p.identitystate){b(p.identitystate);if(k)for(var j in k)k[j]()}else Ext.MessageBox.alert("Error",
"Missing identity")},failure:function(p){p=Ext.util.JSON.decode(p.responseText);Ext.MessageBox.alert("Error",p.reason)}})};a.updateIdentityChanges=function(k,p){Ext.Ajax.request({url:"/user/updatestate",method:"POST",params:{data:Ext.encode(k),layout:bc.commander.activeInstance.stateManager.getActiveLayout(),search:bc.commander.activeInstance.stateManager.getActiveSearch()},success:function(j){j=Ext.util.JSON.decode(j.responseText);if(j.identitystate){b(j.identitystate);if(p)for(var r in p)p[r]()}else Ext.MessageBox.alert("Error",
"Missing identity")},failure:function(j){j=Ext.util.JSON.decode(j.responseText);Ext.MessageBox.alert("Error",j.reason)}})};a.updateIdentityState=function(k){b(k)};return a};Ext.ns("bc.layout");bc.layout.DEFAULT_LAYOUT="standard";bc.layout.Layout=function(b){var a={},d="",c=null;a.getName=function(){return d};a.getLayoutId=function(){return c};if(b){if(b.name)d=b.name;if(b.layout_id)c=b.layout_id}return a};top!=self&&top.location.replace("http://www.buyercommand.com");Ext.onReady(function(){bc.commander.activeInstance=bc.commander.EbayCommander();bc.commander.activeInstance.run()});Ext.ns("bc.module");bc.module.Module=function(){var b={};b.getInfo=function(){};b.show=function(){b.createWindow();b.win.show()};b.destroy=function(){b.win.hide();b.win.destroy()};return b};Ext.ns("bc.modules");
bc.modules.BigItemBids=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Big Item Bids",description:"This module displays the item bids of the currently selected item.",image:bc.STATIC_URL+"/i/bigitembids.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new d(b)};var d=Ext.extend(Ext.Window,{bcmodule:true,frame:true,border:false,closable:false,floating:true,layout:"fit",autoHeight:true,initComponent:function(){d.superclass.initComponent.apply(this,arguments);
this.bigTitle=new Ext.BoxComponent({autoEl:{tag:"div",cls:"bigtitle"},autoWidth:true,autoHeight:true});this.add(this.bigTitle)},setBigItemBids:function(c){this.setWidth(Ext.util.TextMetrics.measure(this.bigTitle.getEl(),c).width+this.getFrameWidth());this.bigTitle.getEl().update(c)},updateContent:function(c){this.setBigItemBids("Bids: "+c.bidCount)}});return a};Ext.ns("bc.modules");
bc.modules.BigItemCategoryID=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Big Item Category ID",description:"This module displays the eBay Category for the currently selected item.",image:bc.STATIC_URL+"/i/bigitemcategoryid.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new d(b)};var d=Ext.extend(Ext.Window,{bcmodule:true,frame:true,border:false,closable:false,floating:true,layout:"fit",autoHeight:true,initComponent:function(){d.superclass.initComponent.apply(this,
arguments);this.bigTitle=new Ext.BoxComponent({autoEl:{tag:"div",cls:"bigtitle"},autoWidth:true,autoHeight:true});this.add(this.bigTitle)},setBigItemText:function(c){this.setWidth(Ext.util.TextMetrics.measure(this.bigTitle.getEl(),c).width+this.getFrameWidth());this.bigTitle.getEl().update(c)},updateContent:function(c){c.primaryCategoryID?this.setBigItemText("Category ID: "+c.primaryCategoryID):this.setBigItemText("Category ID: Unknown")}});return a};Ext.ns("bc.modules");
bc.modules.BigItemCategoryName=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Big Item Category Name",description:"This module displays the eBay Category for the currently selected item.",image:bc.STATIC_URL+"/i/bigitemcategoryname.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new d(b)};var d=Ext.extend(Ext.Window,{bcmodule:true,frame:true,border:false,closable:false,floating:true,layout:"fit",autoHeight:true,initComponent:function(){d.superclass.initComponent.apply(this,
arguments);this.bigTitle=new Ext.BoxComponent({autoEl:{tag:"div",cls:"bigtitle"},autoWidth:true,autoHeight:true});this.add(this.bigTitle)},setBigItemText:function(c){this.setWidth(Ext.util.TextMetrics.measure(this.bigTitle.getEl(),c).width+this.getFrameWidth());this.bigTitle.getEl().update(c)},updateContent:function(c){c.primaryCategoryName?this.setBigItemText("Category Name: "+c.primaryCategoryName):this.setBigItemText("Category Name: Unavailable")}});return a};Ext.ns("bc.modules");
bc.modules.BigItemCurrentBidAmount=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Big Item Current Bid Amount",description:"This module displays the bid amount of the currently selected item.",image:bc.STATIC_URL+"/i/bigitemcurrentbidamount.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new d(b)};var d=Ext.extend(Ext.Window,{bcmodule:true,frame:true,border:false,closable:false,floating:true,layout:"fit",autoHeight:true,
initComponent:function(){d.superclass.initComponent.apply(this,arguments);this.bigTitle=new Ext.BoxComponent({autoEl:{tag:"div",cls:"bigtitle"},autoWidth:true,autoHeight:true});this.add(this.bigTitle)},setTextInfo:function(c){this.setWidth(Ext.util.TextMetrics.measure(this.bigTitle.getEl(),c).width+this.getFrameWidth());this.bigTitle.getEl().update(c)},updateContent:function(c){this.setTextInfo("Current Bid: "+Ext.util.Format.usMoney(c.convertedCurrentPrice.value))}});return a};Ext.ns("bc.modules");
bc.modules.BigItemLocation=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Big Item Location",description:"This module displays the seller's location of the currently selected item.",image:bc.STATIC_URL+"/i/bigitemlocation.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new d(b)};var d=Ext.extend(Ext.Window,{bcmodule:true,frame:true,border:false,closable:false,floating:true,layout:"fit",autoHeight:true,initComponent:function(){d.superclass.initComponent.apply(this,
arguments);this.bigTitle=new Ext.BoxComponent({autoEl:{tag:"div",cls:"bigtitle"},autoWidth:true,autoHeight:true});this.add(this.bigTitle)},setBigItemLocation:function(c){this.setWidth(Ext.util.TextMetrics.measure(this.bigTitle.getEl(),c).width+this.getFrameWidth());this.bigTitle.getEl().update(c)},updateContent:function(c){this.setBigItemLocation(c.location)}});return a};Ext.ns("bc.modules");
bc.modules.BigItemNumber=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Big Item Number",description:"This module displays the item number of the currently selected item.",image:bc.STATIC_URL+"/i/bigitemnumber.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new d(b)};var d=Ext.extend(Ext.Window,{bcmodule:true,frame:true,border:false,closable:false,floating:true,layout:"fit",autoHeight:true,initComponent:function(){d.superclass.initComponent.apply(this,arguments);
this.bigTitle=new Ext.BoxComponent({autoEl:{tag:"div",cls:"bigtitle"},autoWidth:true,autoHeight:true});this.add(this.bigTitle)},setBigItemNumber:function(c){this.setWidth(Ext.util.TextMetrics.measure(this.bigTitle.getEl(),c).width+this.getFrameWidth());this.bigTitle.getEl().update(c)},updateContent:function(c){this.setBigItemNumber(c.itemID)}});return a};Ext.ns("bc.modules");
bc.modules.BigItemShippingCost=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Big Item Shipping Cost",description:"This module displays the shipping cost for the currently selected item.",image:bc.STATIC_URL+"/i/bigitemshippingcost.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new d(b)};var d=Ext.extend(Ext.Window,{bcmodule:true,frame:true,border:false,closable:false,floating:true,layout:"fit",autoHeight:true,initComponent:function(){d.superclass.initComponent.apply(this,
arguments);this.bigTitle=new Ext.BoxComponent({autoEl:{tag:"div",cls:"bigtitle"},autoWidth:true,autoHeight:true});this.add(this.bigTitle)},setBigItemText:function(c){this.setWidth(Ext.util.TextMetrics.measure(this.bigTitle.getEl(),c).width+this.getFrameWidth());this.bigTitle.getEl().update(c)},updateContent:function(c){c.shippingCostSummary&&c.shippingCostSummary.shippingServiceCost?this.setBigItemText("Shipping Cost: "+Ext.util.Format.usMoney(c.shippingCostSummary.shippingServiceCost.value)):this.setBigItemText("Shipping Cost: Undetermined")}});
return a};Ext.ns("bc.modules");
bc.modules.BigItemTimeLeft=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Big Item Time Left",description:"This module displays the time left before the auction ends for the currently selected item.",image:bc.STATIC_URL+"/i/bigitemtimeleft.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new d(b)};var d=Ext.extend(Ext.Window,{bcmodule:true,frame:true,border:false,closable:false,floating:true,layout:"fit",autoHeight:true,
initComponent:function(){d.superclass.initComponent.apply(this,arguments);this.bigTitle=new Ext.BoxComponent({autoEl:{tag:"div",cls:"bigtitle"},autoWidth:true,autoHeight:true});this.add(this.bigTitle)},setBigItemText:function(c){this.setWidth(Ext.util.TextMetrics.measure(this.bigTitle.getEl(),c).width+this.getFrameWidth());this.bigTitle.getEl().update(c)},updateContent:function(c){this.setBigItemText("Time Left: "+c.timeLeft)}});return a};Ext.ns("bc.modules");
bc.modules.BigItemTitle=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Big Item Title",description:"This module displays the item title of the currently selected item.",image:bc.STATIC_URL+"/i/bigitemtitle.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new d(b)};var d=Ext.extend(Ext.Window,{bcmodule:true,frame:true,border:false,closable:false,floating:true,layout:"fit",autoHeight:true,initComponent:function(){d.superclass.initComponent.apply(this,arguments);
this.bigTitle=new Ext.BoxComponent({autoEl:{tag:"div",cls:"bigtitle"},autoWidth:true,autoHeight:true});this.add(this.bigTitle)},setBigItemTitle:function(c){this.setWidth(Ext.util.TextMetrics.measure(this.bigTitle.getEl(),c).width+this.getFrameWidth());this.bigTitle.getEl().update(c)},updateContent:function(c){this.setBigItemTitle(c.title)}});return a};Ext.ns("bc.modules");
bc.modules.BigPositionInSearchResultItemCount=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Big Position In Search Result Item Count",description:"This module displays the currently selected item number within the number of items returned in the search result.",image:bc.STATIC_URL+"/i/bigpositioninserchresultitemcount.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new d(b)};var d=Ext.extend(Ext.Window,{bcmodule:true,
frame:true,border:false,closable:false,floating:true,layout:"fit",autoHeight:true,initComponent:function(){d.superclass.initComponent.apply(this,arguments);this.bigTitle=new Ext.BoxComponent({autoEl:{tag:"div",cls:"bigtitle"},autoWidth:true,autoHeight:true});this.add(this.bigTitle)},setTextInfo:function(c){this.setWidth(Ext.util.TextMetrics.measure(this.bigTitle.getEl(),c).width+this.getFrameWidth());this.bigTitle.getEl().update(c)},updateContent:function(){var c=bc.commander.activeInstance.datamanager;
c&&this.setTextInfo("Result Count: "+(c.getCurrentItemPosition()+1)+" of "+c.getTotalItemsLength())}});return a};Ext.ns("bc.modules");
bc.modules.ItemImage=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Image of the Item",description:"This module displays the primary image of the currently selected item.",image:bc.STATIC_URL+"/i/itemimage.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new d(b)};var d=Ext.extend(Ext.Window,{bcmodule:true,frame:true,border:false,closable:false,resizable:true,floating:true,layout:"fit",autoHeight:true,listeners:{show:function(){bc.commander.activeInstance.bus.fireEvent(bc.events.ITEM_IMG_WIN_SHOW)}},
initComponent:function(){d.superclass.initComponent.apply(this,arguments);this.imageCmp=new Ext.BoxComponent({autoEl:{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"The Image"},autoHeight:true});this.add(this.imageCmp)},setSrc:function(c){this.imageCmp.getEl().dom.src=Ext.BLANK_IMAGE_URL;this.imageCmp.getEl().setDisplayed(false);var f=new Image,e=this;f.onload=function(){e.imageCmp.getEl().setDisplayed(true);e.imageCmp.getEl().dom.src=c;Ext.isSafari&&e.imageCmp.getEl().setWidth(e.getInnerWidth())};f.src=
c},initEvents:function(){d.superclass.initEvents.apply(this,arguments);Ext.apply(this.resizer,{preserveRatio:true})},updateContent:function(c){c.pictureURL.length<1?this.setSrc(bc.IMAGE_MISSING_ITEM_PICTURE):this.setSrc(c.pictureURL[0])}});return a};Ext.ns("bc.modules");
bc.modules.ItemInfoGrid=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Item Infomation Grid",description:"This module displays the basic information of the currently selected item in a grid.",image:bc.STATIC_URL+"/i/iteminfogrid.jpg",x:a.x||1,y:a.y||1,width:300,height:200,z:1}};a.createWindow=function(){if(!a.win)a.win=new c(b)};var d=new Ext.data.ArrayStore({fields:["info","data"]}),c=Ext.extend(Ext.Window,{bcmodule:true,frame:true,resizable:false,border:false,
closable:false,floating:true,layout:"fit",autoHeight:true,initComponent:function(){c.superclass.initComponent.apply(this,arguments);this.infoGrid=new Ext.grid.GridPanel({store:d,viewConfig:{scrollOffset:2},colModel:new Ext.grid.ColumnModel({columns:[{id:"info",dataIndex:"info",sortable:false},{dataIndex:"data",sortable:false,align:"right"}],defaults:{menuDisabled:true}}),autoExpandColumn:"info",trackMouseOver:false,autoHeight:true});this.add(this.infoGrid)},updateContent:function(f){var e=bc.commander.activeInstance.datamanager;
d.loadData([["Results Count",e.getCurrentItemPosition()+1+" of "+e.getTotalItemsLength()],["Current Bid",Ext.util.Format.usMoney(f.convertedCurrentPrice.value)],["Shipping Cost",f.shippingCostSummary&&f.shippingCostSummary.shippingServiceCost?Ext.util.Format.usMoney(f.shippingCostSummary.shippingServiceCost.value):"Undefined"],["Time Left",f.timeLeft],["Bids",f.bidCount],["Category ID",f.primaryCategoryID]])}});return a};Ext.ns("bc.modules");
bc.modules.PriceShipPieGraph=function(b){var a=bc.module.Module(),d=new Ext.data.JsonStore({fields:["costcomponent","amount"],data:[{costcomponent:"Bid Amount",amount:1},{costcomponent:"Shipping",amount:1}]});a.getInfo=function(){return{cls:a.cls||null,name:"Pie Chart of Item Price and Shipping",description:"This module displays a pie chart indicating the percentage of the total purchase price including shipping.",image:bc.STATIC_URL+"/i/priceshippiegraph.jpg",x:a.x||100,y:a.y||100,width:300,height:300,
z:1}};a.createWindow=function(){if(!a.win)a.win=new Ext.Window(Ext.apply(b,{bcmodule:true,frame:true,border:false,closable:false,floating:true,layout:"fit",width:300,height:300,items:{xtype:"piechart",store:d,dataField:"amount",categoryField:"costcomponent",extraStyle:{legend:{display:"bottom",padding:5,font:{family:"Tahoma",size:13}}}},updateContent:function(c){d.loadData([{costcomponent:"Bid Amount",amount:c.convertedCurrentPrice.value},{costcomponent:"Shipping",amount:c.shippingCostSummary&&c.shippingCostSummary.shippingServiceCost?
c.shippingCostSummary.shippingServiceCost.value:0}])}}))};a.show=function(){a.createWindow();a.win.show()};return a};Ext.ns("bc.modules");
bc.modules.RightNowOnEbay=function(b){var a=bc.module.Module(),d=bc.commander.activeInstance;a.getInfo=function(){return{cls:a.cls||null,name:"Right Now on eBay Button",description:"This module displays a button to launch the user to eBay.com to view the currently selected item.",image:bc.STATIC_URL+"/i/rightnowonebay.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new Ext.Window(Ext.apply(b,{bcmodule:true,frame:true,border:false,closable:false,floating:true,
layout:"fit",autoWidth:true,items:new Ext.Button({width:108,height:45,hideLabel:true,iconCls:"ebayrightnow",autoWidth:true,autoHeight:true,handler:function(){pageTracker._trackEvent("Navigation","ViewViaEbayButtonModule");d.launchViewItemPage()}}),updateContent:function(){}}))};a.show=function(){a.createWindow();a.win.show()};return a};Ext.ns("bc.modules");
bc.modules.SimpleDataNavigation=function(b){var a=bc.module.Module(),d=bc.commander.activeInstance;a.getInfo=function(){return{cls:a.cls||null,name:"Simple Data Navigation",description:"This module displays navigation buttons to move forward and backward through listings.",image:bc.STATIC_URL+"/i/simpledatanavigation.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new Ext.Window(Ext.apply(b,{bcmodule:true,frame:true,border:false,closable:false,floating:true,
layout:"column",autoHeight:true,width:175,items:[{xtype:"toolbar",items:[{text:"<< Previous Item",handler:function(){d.displayPrevItem()}},"-",{text:"Next Item >>",handler:function(){d.displayNextItem()}}]}],updateContent:function(){}}))};a.show=function(){a.createWindow();a.win.show()};return a};Ext.ns("bc.modules");
bc.modules.SimpleMap=function(b){var a=bc.module.Module();a.getInfo=function(){return{cls:a.cls||null,name:"Seller Location on Map",description:"This module displays a map indicating the state the current seller is located in.  It can be useful to visualize the location on a map for quickly determining shipping time.",image:bc.STATIC_URL+"/i/simplemap.jpg",x:a.x||1,y:a.y||1,width:100,height:100,z:1}};a.createWindow=function(){if(!a.win)a.win=new d(b)};var d=function(c){function f(g){if(g.match(/^[A-Z]{2}$/))return g.toUpperCase();var h=
g.match(/, ?([A-Za-z]{2}).?$/);if(h)return h[1].toUpperCase();if(h=g.match(/, ?(.*)$/)){h=h[1].toUpperCase();for(var m in e)if(e[m].name==h)return m}if(h=g.trim()){h=h.toUpperCase();for(m in e)if(e[m].name==h)return m}if(g=g.match(/(\w*)$/)){h=g[1].toUpperCase();for(m in e)if(e[m].name==h)return m}return null}d.superclass.constructor.call(this,c);var e={AL:{name:"ALABAMA",offset:[278,182]},AK:{name:"ALASKA",offset:[1,1]},AZ:{name:"ARIZONA",offset:[77,156]},AR:{name:"ARKANSAS",offset:[227,159]},CA:{name:"CALIFORNIA",
offset:[8,95]},CO:{name:"COLORADO",offset:[130,108]},CT:{name:"CONNECTICUT",offset:[364,73]},DE:{name:"DELAWARE",offset:[352,106]},DC:{name:"DISTRICT OF COLUMBIA",offset:[349,103]},FL:{name:"FLORIDA",offset:[293,201]},GA:{name:"GEORGIA",offset:[292,163]},HI:{name:"HAWAII",offset:[1,33]},ID:{name:"IDAHO",offset:[64,58]},IL:{name:"ILLINOIS",offset:[249,112]},IN:{name:"INDIANA",offset:[270,111]},IA:{name:"IOWA",offset:[207,89]},KS:{name:"KANSAS",offset:[192,117]},KY:{name:"KENTUCKY",offset:[286,127]},
LA:{name:"LOUISIANA",offset:[240,204]},ME:{name:"MAINE",offset:[379,39]},MD:{name:"MARYLAND",offset:[349,105]},MA:{name:"MASSACHUSETTS",offset:[374,64]},MI:{name:"MICHIGAN",offset:[277,75]},MN:{name:"MINNESOTA",offset:[219,49]},MS:{name:"MISSISSIPPI",offset:[251,182]},MO:{name:"MISSOURI",offset:[229,128]},MT:{name:"MONTANA",offset:[94,34]},NE:{name:"NEBRASKA",offset:[192,100]},NV:{name:"NEVADA",offset:[32,98]},NH:{name:"NEW HAMPSHIRE",offset:[367,52]},NJ:{name:"NEW JERSEY",offset:[353,86]},NM:{name:"NEW MEXICO",
offset:[123,150]},NY:{name:"NEW YORK",offset:[350,65]},NC:{name:"NORTH CAROLINA",offset:[333,140]},ND:{name:"NORTH DAKOTA",offset:[171,38]},OH:{name:"OHIO",offset:[294,97]},OK:{name:"OKLAHOMA",offset:[186,152]},OR:{name:"OREGON",offset:[18,36]},PA:{name:"PENNSYLVANIA",offset:[339,88]},PR:{name:"PUERTO RICO",offset:[300,250]},RI:{name:"RHODE ISLAND",offset:[373,71]},SC:{name:"SOUTH CAROLINA",offset:[321,161]},SD:{name:"SOUTH DAKOTA",offset:[171,64]},TN:{name:"TENNESSEE",offset:[270,148]},TX:{name:"TEXAS",
offset:[187,205]},UT:{name:"UTAH",offset:[85,95]},VT:{name:"VERMONT",offset:[357,48]},VI:{name:"VIRGIN ISLANDS",offset:[292,267]},VA:{name:"VIRGINIA",offset:[342,147]},WA:{name:"WASHINGTON",offset:[26,8]},WV:{name:"WEST VIRGINIA",offset:[309,114]},WI:{name:"WISCONSIN",offset:[246,71]},WY:{name:"WYOMING",offset:[133,90]}};c={};for(var n in e)c[e[n].name]=n;this.setLocation=function(g){if(this.imgStateMarker){g=f(g);if(g=e[g]){this.imgStateMarker.setPosition(g.offset[0],g.offset[1]);this.imgStateMarker.show()}else this.imgStateMarker.hide()}};
this.setItem=function(g){this.setLocation(g.location)};this.updateContent=function(g){g.location&&this.setLocation(g.location)};this.showContent=function(g){g.location&&this.setLocation(g.location)}};Ext.extend(d,Ext.Window,{bcmodule:true,layout:"fit",resizable:false,closable:false,floating:true,constructor:function(c){Ext.apply(this,c);a.superclass.constructor.apply(this,arguments)},onRender:function(){var c={img:"/i/us_state_map.jpg",width:400};d.superclass.onRender.apply(this,arguments);this.setWidth(c.width+
this.getFrameWidth());this.body.setStyle({position:"relative"});this.imgStateMap=new Ext.BoxComponent({autoEl:{tag:"img",src:c.img},autoWidth:true,autoHeight:true});this.add(this.imgStateMap);this.imgStateMarker=new Ext.BoxComponent({autoEl:{tag:"img",src:"/i/us_state_map_marker.png",style:{position:"absolute",top:0,left:0}},autoWidth:true,autoHeight:true,hidden:true});this.add(this.imgStateMarker)}});return a};Ext.ns("bc.search");
bc.search.Search=function(b){var a={},d="",c="",f="ebay";a.setName=function(e){d=e};a.getName=function(){return d};a.setCriteria=function(e){c=e};a.getCriteria=function(){return c};a.setDomain=function(e){f=e};a.getDomain=function(){return f};a.search=function(){Ext.Ajax.request({url:"/search",success:function(){}.createDelegate(a),failure:function(){Ext.Msg.alert("Searching error","There was an error loading the search results.")},method:"POST",params:{domain:a.getDomain(),criteria:a.getCriteria(),start:0,
limit:20}})};if(b){d=b.name;c=b.criteria;if(b.domain)f=b.domain}return a};Ext.ns("bc.shortcuts");
bc.shortcuts.ItemShortcuts=function(b){function a(){e=b.handlers.nextItem;n=b.handlers.prevItem;g=b.handlers.viewItem;c=new Ext.KeyMap(Ext.get(document),[{key:"j",fn:function(h){pageTracker._trackEvent("Navigation","NextViaJ");e(h)},stopEvent:true},{key:"k",fn:function(h){pageTracker._trackEvent("Navigation","PrevViaK");n(h)},stopEvent:true},{key:"v",fn:function(h){pageTracker._trackEvent("Navigation","ViewViaV");g(h)},stopEvent:true}]);f=new Ext.KeyNav(Ext.get(document),{left:function(h){pageTracker._trackEvent("Navigation","PrevViaLeftArrow");
n(h)},right:function(h){pageTracker._trackEvent("Navigation","NextViaRightArrow");e(h)}})}var d={},c,f,e,n,g;d.enable=function(){c.enable();f.enable()};d.disable=function(){c.disable();f.disable()};a();return d};
bc.shortcuts.CharCodeHandlerShortcuts=function(){var b={bListenerCreated:false,bListenerEnabled:false},a=function(d){if(b.bListenerEnabled){var c;if(d.getCharCode()in b.charCodeHandlerMap)c=b.charCodeHandlerMap[d.getCharCode()];else if("default"in b.charCodeHandlerMap)c=b.charCodeHandlerMap["default"];c&&c(d)}};b.enable=function(){if(!b.bListenerCreated){Ext.EventManager.addListener(Ext.get(document),"keypress",a,this);b.bListenerCreated=true}b.bListenerEnabled=true};b.disable=function(){b.bListenerEnabled=
false};return b};bc.shortcuts.CliActivationShortcuts=function(){function b(){a.charCodeHandlerMap={47:d,58:d}}var a=bc.shortcuts.CharCodeHandlerShortcuts(),d=function(c){pageTracker._trackEvent("Navigation","CommandModeInvokedViaShortcut");bc.commander.activeInstance.shortcutmanager.commandInputPresentHandler();c.stopEvent();c.preventDefault()};b();return a};
bc.shortcuts.Shortcuts=function(b){function a(m,k){for(var p in k)k[p](m)}function d(m){var k=bc.commander.activeInstance,p=k.shortcutmanager.commandHistory;p.cliInput(k.ui.getDashboardCommandEl().getValue());(m=m==Ext.EventObject.UP?p.next():p.prev())&&k.ui.getDashboardCommandEl().setValue(m)}var c={},f=[],e=[],n=[],g=[],h;Ext.apply(c,b);h=function(){var m={},k=false,p=false,j=bc.commander.activeInstance.startCliSession(),r=function(o){if(p)switch(o.getCharCode()){case Ext.EventObject.BACKSPACE:j.commandSupportsLookahead()&&
j.truncateCommandLookaheadBuffer(1);break;case Ext.EventObject.LEFT:case Ext.EventObject.RIGHT:if(j.lookaheadComponentDisplayed()){j.navigateLookaheadComponent(o.getCharCode());o.stopEvent();o.preventDefault()}break;case Ext.EventObject.UP:case Ext.EventObject.DOWN:if(j.lookaheadComponentDisplayed()){j.navigateLookaheadComponent(o.getCharCode());o.stopEvent();o.preventDefault()}else d(o.getCharCode());break;case Ext.EventObject.ENTER:if(j.lookaheadComponentDisplayed()){j.navigateLookaheadComponent(o.getCharCode());
o.stopEvent();o.preventDefault();break}bc.log("command conclude ENTER invoked");a(o,n);bc.commander.activeInstance.endCliSession();break;case Ext.EventObject.ESC:if(j.lookaheadComponentDisplayed()){j.destroyLookaheadComponentIfDisplayed();o.stopEvent();o.preventDefault();break}bc.log("command conclude ESC invoked");a(o,e);break;case 58:bc.log("colon entered on command line");a(o,g);default:j.commandSupportsLookahead()&&j.appendCommandLookaheadBuffer(String.fromCharCode(o.getCharCode()));break}};m.enable=
function(){if(!k){Ext.EventManager.addListener(Ext.get(document),"keypress",r,this);k=true}p=true};m.disable=function(){p=false};return m}();c.enableCommandEntryListener=function(){h.enable()};c.disableCommandEntryListener=function(){h.disable()};c.addCommandInputPresentHandler=function(m){f.push(m)};c.addCancelInputHandler=function(m){e.push(m)};c.addCommandLookAheadHandler=function(m){g.push(m)};c.addProcessInputHandler=function(m){n.push(m)};return c};Ext.ns("bc.shortcuts");
bc.shortcuts.ShortcutsManager=function(b){function a(){var h=f.getDashboardCommandEl();e.disableCommandEntryListener();var m=h.getValue();m=m.toLowerCase();n.process(m);h.setValue("");Ext.get("go").child("button").dom.focus();c.itemShortcuts.enable();c.cliActivationShortcuts.enable();Ext.Ajax.request({url:"/cmdhist/appendtouuid/"+g.identity.getUuid(),method:"POST",params:{cmd:m},success:function(k){k=Ext.util.JSON.decode(k.responseText).cmdhist;c.commandHistory=bc.cmdhist.CommandHistory(k)},failure:function(){}})}
function d(){var h=f.getDashboardCommandEl();c.itemShortcuts=bc.shortcuts.ItemShortcuts({handlers:{nextItem:function(){g.displayNextItem()},prevItem:function(){g.displayPrevItem()},viewItem:function(){g.launchViewItemPage()}}});c.cliActivationShortcuts=bc.shortcuts.CliActivationShortcuts();c.cliActivationShortcuts.enable();c.commandInputPresentHandler=function(){h.focus();e.enableCommandEntryListener()};e.addCancelInputHandler(function(){e.disableCommandEntryListener();Ext.get("go").child("button").dom.focus();
c.itemShortcuts.enable();c.cliActivationShortcuts.enable()});e.addCommandLookAheadHandler(function(){bc.commander.activeInstance.startCliSession().activateCommand(h.getValue().toLowerCase())});e.addProcessInputHandler(a);h.on("focus",function(){c.itemShortcuts.disable();c.cliActivationShortcuts.disable();e.enableCommandEntryListener();g.startCliSession()});h.on("blur",function(){c.itemShortcuts.enable();c.cliActivationShortcuts.enable()});Ext.Ajax.request({url:"/cmdhist/listbyuuid/"+g.identity.getUuid(),
method:"POST",success:function(m){m=Ext.util.JSON.decode(m.responseText).cmdhist;c.commandHistory=bc.cmdhist.CommandHistory(m)},failure:function(){}});bc.commander.activeInstance.bus.on(bc.events.JOIN_WINDOW_HIDE,c.onJoinWindowHide);bc.commander.activeInstance.bus.on(bc.events.JOIN_WINDOW_SHOW,c.onJoinWindowShow);bc.commander.activeInstance.bus.on(bc.events.LOGIN_WINDOW_HIDE,c.onLoginWindowHide);bc.commander.activeInstance.bus.on(bc.events.LOGIN_WINDOW_SHOW,c.onLoginWindowShow);bc.commander.activeInstance.bus.on(bc.events.CUST_WINDOW_HIDE,
c.onCustomizeWindowHide);bc.commander.activeInstance.bus.on(bc.events.CUST_WINDOW_SHOW,c.onCustomizeWindowShow)}var c={},f=bc.commander.activeInstance.ui,e=bc.shortcuts.Shortcuts(),n=bc.commander.activeInstance.commandprocessor,g=bc.commander.activeInstance;Ext.apply(c,b);c.onJoinWindowHide=function(){c.itemShortcuts.enable()};c.onJoinWindowShow=function(){c.itemShortcuts.disable()};c.onLoginWindowHide=function(){c.itemShortcuts.enable()};c.onLoginWindowShow=function(){c.itemShortcuts.disable()};
c.onCustomizeWindowHide=function(){c.itemShortcuts.enable()};c.onCustomizeWindowShow=function(){c.itemShortcuts.disable()};c.invokeProcessCommandInput=function(){a()};d();return c};Ext.ns("bc.state");bc.state.ModuleWebServiceProvider=function(b){this.addEvents("readsuccess","readfailure","savesuccess","savefailure");bc.state.ModuleWebServiceProvider.superclass.constructor.call(this);Ext.apply(this,b,{delay:750,dirty:false,started:false,autoStart:true,autoRead:false,uuid:bc.commander.activeInstance.identity.getUuid(),url:"/user/updatestate",method:"post",state:{}});this.dt=new Ext.util.DelayedTask(this.submitState,this);this.autoStart&&this.start()};
Ext.extend(bc.state.ModuleWebServiceProvider,Ext.state.Provider,{initState:function(b){bc.log("initState called");b instanceof Array?Ext.each(b,function(a){bc.log(a)},this):bc.log(b)},set:function(b,a){b&&Ext.getCmp(b).bcmodule&&this.queueChange(b,a)},start:function(){this.dt.delay(this.delay);this.started=true},stop:function(){this.dt.cancel();this.started=false},queueChange:function(b,a){var d=undefined===this.state[b]||this.state[b]!==a;if(d){this.state[b]=a;this.dirty=true}this.started&&this.start();
return d},submitState:function(){if(this.dirty){this.dt.cancel();var b={url:this.url,method:this.method,scope:this,success:this.onSaveSuccess,failure:this.onSaveFailure,params:{}},a={};a.data=Ext.encode({updatemodules:this.state});a.layout=bc.commander.activeInstance.stateManager.getActiveLayout();Ext.apply(b.params,a);this.dirty=false;Ext.Ajax.request(b)}else this.dt.delay(this.delay)},onSaveSuccess:function(b){var a={};try{a=Ext.decode(b.responseText)}catch(d){}bc.log(a)},onSaveFailure:function(){bc.log("save state failed")}});Ext.ns("bc.ui.customize");
bc.ui.customize.ModulesCustomizer=function(){function b(){return u[w]}function a(){var l=b();z.unsubscribeModule(l,{success:function(){l.subscribed=false;h(u[w]);y.renderModules();var q=bc.commander.activeInstance.datamanager.dataIterator.current();y.updateModules(q);Ext.WindowMgr.bringToFront(j)},failure:function(){}})}function d(){var l=b();z.subscribeModule(l,{success:function(){l.subscribed=true;h(u[w]);y.renderModules();var q=bc.commander.activeInstance.datamanager.dataIterator.current();y.updateModules(q);
Ext.WindowMgr.bringToFront(j)},failure:function(){}})}function c(){f({})}function f(l){var q=o.findById("module_description");if(q){l.name?q.setTitle(l.name):q.setTitle("Module description");l.description?q.findById("module_description_body").setValue(l.description):q.findById("module_description_body").setValue("No modules available.");l.image&&o.findById("customize_map").body.update('<img src="'+l.image+'" />')}}function e(){if(bc.modules)for(var l in bc.modules)if(bc.modules[l]){var q=bc.modules[l]();
if(q){q.cls=l;q.subscribed=z.isModuleActive(l);u.push(q)}}}function n(){if(u.length>0){w==-1&&w++;h(u[w])}else c();g()}function g(){o.findById("customize_map").getTopToolbar().findById("module_counter").setText("Module "+(w+1)+" of "+u.length)}function h(l){if(l.subscribed){Ext.getCmp("customize_btn_subscribe").disable();Ext.getCmp("customize_btn_unsubscribe").enable()}else{Ext.getCmp("customize_btn_subscribe").enable();Ext.getCmp("customize_btn_unsubscribe").disable()}f(l.getInfo())}function m(){var l=
[];for(var q in bc.env){var v=bc.env[q];if(v=="")v='""';l.push(q+":"+v)}x.setValue(l.join(",\n"))}function k(){n();m()}var p={},j,r,o,x,u=[],w=-1,z=bc.commander.activeInstance.stateManager,y=bc.commander.activeInstance.ui;o=new Ext.Panel({title:"Gallery",anchor:"100% 100%",layout:"column",items:[{xtype:"panel",frame:true,columnWidth:0.6,height:396,items:[{xtype:"panel",items:[{id:"customize_map",xtype:"panel",frame:true,autoScroll:true,tbar:[{xtype:"label",id:"module_counter",text:"Module 1 of 10"}],
html:" "}],border:true}],buttonAlign:"left",buttons:[{text:"Previous",handler:function(){if(u.length>0){if(w==0)w=u.length;h(u[--w]);g()}}},{text:"Next",handler:function(){if(u.length>0){if(w==u.length-1)w=-1;h(u[++w]);g()}}}]},{xtype:"panel",frame:true,columnWidth:0.4,height:396,items:[{id:"module_description",xtype:"panel",padding:"10 2 2 2",title:" ",items:[{id:"module_description_body",xtype:"textarea",readonly:true,width:255,height:300,value:""}]}],buttons:[{text:"Subscribe",id:"customize_btn_subscribe",
handler:d},{text:"Unsubscribe",id:"customize_btn_unsubscribe",handler:a}]}]});x=new Ext.form.TextArea({renderTo:Ext.getBody(),anchor:"100% 100%",enableColors:false,enableAlignments:false,enableSourceEdit:true});r=new Ext.Panel({title:"Enviro",anchor:"100% 100%",frame:true,layout:"fit",items:[x],buttons:[{text:"Save",handler:function(){var l=x.getValue();if(l!=""){l=l.split(/,?\n\s?/);for(var q=l.length,v=bc.command.setenv(),s=0;s<q;s++)v.process(l[s].trim())}}}]});r=new Ext.TabPanel({anchor:"100% 100%",
activeTab:0,frame:true,items:[o,r],buttons:[{text:"Close",handler:function(){p.hide()}}]});j=new Ext.Window({id:"customize_module_customizer",width:710,height:500,title:"Customize BuyerCommand",layout:"fit",closeAction:"hide",listeners:{hide:function(){bc.commander.activeInstance.bus.fireEvent(bc.events.CUST_WINDOW_HIDE)}},items:[r]});p.show=function(){j.show();k();bc.commander.activeInstance.bus.fireEvent(bc.events.CUST_WINDOW_SHOW)};p.hide=function(){j.hide()};e();return p};Ext.ns("bc.ui");
bc.ui.Dashboard=function(b){function a(){var s=h.getTopToolbar();x=s.getComponent("join_toolbar_button");z=s.getComponent("login_toolbar_button");y=s.getComponent("logout_toolbar_button");p.on(bc.events.USER_LOGIN_STATE_CHANGE,n.onUserIsLoggedIn);d()}function d(){if(j&&r.isUserLoggedIn()){x.hide();z.hide();y.show()}else{x.show();z.show();y.hide()}}function c(){p.on(bc.events.ITEM_IMG_WIN_SHOW,n.onItemImageWindowShow)}function f(){var s=new Ext.Container({autoEl:{tag:"img",src:bc.STATIC_URL+"/i/ebay_rightnow.gif"},
cls:"ebay_rnlogo_opacity",id:"ebay_logo_container",x:m.getWidth()-100,y:m.getHeight()-k.getHeight()-60});m.add(s)}function e(){m.remove("ebay_logo_container");f()}var n={},g,h,m,k,p=bc.commander.activeInstance.bus,j=bc.commander.activeInstance.identity,r=bc.commander.activeInstance.stateManager,o=[],x,u,w,z,y,l,q;Ext.apply(n,b);var v={join:function(){var s=u.getForm();s.isValid()&&s.submit({method:"POST",url:"/user/join",success:function(t,A){t=Ext.util.JSON.decode(A.response.responseText);if(t.success&&
t.join&&t.identitystate){r.updateIdentityState(t.identitystate);p.fireEvent(bc.events.USER_LOGIN_STATE_CHANGE);u.getForm().reset();w.hide()}else Ext.MessageBox.alert("Join failed",t.reason)},failure:function(){Ext.Msg.alert("Error from server","Action failure")}})},login:function(){var s=l.getForm();s.isValid()&&s.submit({method:"POST",url:"/user/login",success:function(t,A){t=Ext.util.JSON.decode(A.response.responseText);if(t.success&&t.login&&t.identitystate){r.updateIdentityState(t.identitystate);
p.fireEvent(bc.events.USER_LOGIN_STATE_CHANGE);l.getForm().reset();q.hide()}else Ext.MessageBox.alert("Login failure",t.reason)},failure:function(){Ext.Msg.alert("Error from server","Action failure")}})},logout:function(){Ext.Ajax.request({method:"POST",url:"/user/logout",success:function(s){s=Ext.util.JSON.decode(s.responseText);if(s.success&&s.logout&&s.identitystate){r.updateIdentityState(s.identitystate);p.fireEvent(bc.events.USER_LOGIN_STATE_CHANGE)}else window.location.replace("/")},failure:function(){alert("failure")}})}};
new Ext.BoxComponent({autoEl:{tag:"img",src:bc.STATIC_URL+"/i/working.gif",style:"width:20px; height:20px; margin-bottom:2px;"}});h=new Ext.Panel({region:"north",border:false,scope:n,tbar:[{xtype:"tbspacer"},{xtype:"label",html:"BuyerCommand&trade;",style:{fontSize:20}},{xtype:"tbspacer"},{xtype:"tbspacer"},{xtype:"tbspacer"},{xtype:"button",text:"Join",id:"join_toolbar_button",handler:function(){pageTracker._trackEvent("Membership","JoinClicked");u.getForm().reset();w.show()},hidden:true},{xtype:"tbspacer"},
{xtype:"tbspacer"},{xtype:"tbspacer"},{xtype:"button",text:"Login",id:"login_toolbar_button",handler:function(){pageTracker._trackEvent("Membership","LoginClicked");l.getForm().reset();q.show()},hidden:true},{xtype:"tbspacer"},{xtype:"tbspacer"},{xtype:"tbspacer"},{xtype:"button",text:"Logout",id:"logout_toolbar_button",hidden:true,handler:function(){pageTracker._trackEvent("Membership","LogoutClicked");v.logout()}},{xtype:"tbfill"},{xtype:"button",text:"Blog",handler:function(){pageTracker._trackEvent("Assistance",
"BlogClicked");window.open("http://blog.buyercommand.com")}},{xtype:"button",text:"Help",handler:function(){pageTracker._trackEvent("Assistance","HelpClicked");window.open("http://help.buyercommand.com")}},{xtype:"tbspacer"},{xtype:"tbspacer"}]});m=new Ext.Panel({id:"panel_center",region:"center",border:false,layout:"absolute"});k=new Ext.Panel({id:"panel_south",region:"south",border:false,height:28,items:[new Ext.Toolbar({cls:"x-toolbar-top-border-south-anchor",items:[{xtype:"tbspacer"},{xtype:"tbspacer"},
{xtype:"textfield",id:"dashboard_command",emptyText:"Search eBay Here!",text:"",width:400},{xtype:"tbspacer"},{xtype:"tbspacer"},{xtype:"tbspacer"},{xtype:"button",id:"go",text:"Go",handler:function(){pageTracker._trackEvent("Navigation","GoClicked");bc.commander.activeInstance.shortcutmanager.invokeProcessCommandInput()}},{xtype:"tbspacer"},{xtype:"tbseparator"},{xtype:"tbspacer"},{xtype:"label",html:"Use Keyboard for Efficient Browsing:"},{xtype:"tbspacer"},{xtype:"button",text:"J",handler:function(){pageTracker._trackEvent("Navigation",
"NextViaJBtnSouthToolbar");bc.commander.activeInstance.displayNextItem()}},{xtype:"tbspacer"},{xtype:"label",html:"View Next Item"},{xtype:"tbseparator"},{xtype:"button",text:"K",handler:function(){pageTracker._trackEvent("Navigation","NextViaKBtnSouthToolbar");bc.commander.activeInstance.displayPrevItem()}},{xtype:"tbspacer"},{xtype:"label",html:"Previous Item"},{xtype:"tbseparator"},{xtype:"button",text:"V",handler:function(){pageTracker._trackEvent("Navigation","ViewViaVBtnSouthToolbar");bc.commander.activeInstance.launchViewItemPage()}},
{xtype:"tbspacer"},{xtype:"label",html:"View Item Page"},{xtype:"tbspacer",width:50},{xtype:"button",text:"View Item on eBay",cls:"boldfooterbtn",handler:function(){pageTracker._trackEvent("Navigation","ViewViaViewOnEbayBtnSouthToolbar");bc.commander.activeInstance.launchViewItemPage()}},{xtype:"tbfill"},{xtype:"button",text:"Customize",handler:function(){pageTracker._trackEvent("Navigation","CustomizeClicked");n.getModulesCustomizer().show()}}]})]});u=new Ext.FormPanel({frame:true,defaultType:"textfield",
items:[{fieldLabel:"First Name",name:"fname",allowBlank:false,width:"90%"},{fieldLabel:"Last Name",name:"lname",allowBlank:false,width:"90%"},{fieldLabel:"Email",name:"email",vtype:"email",allowBlank:false,width:"90%"},{fieldLabel:"Password",name:"password",inputType:"password",allowBlank:false,width:"90%",enableKeyEvents:true,listeners:{keydown:function(s,t){t&&t.button==12&&u.buttons[0].handler.call(this)}}}],buttonAlign:"right",buttons:[{text:"Register",formBind:true,handler:v.join}]});w=new Ext.Window({layout:"fit",
width:350,height:205,plain:true,closeAction:"hide",title:"Join",modal:true,scope:this,items:u,listeners:{show:{fn:function(){p.fireEvent(bc.events.JOIN_WINDOW_SHOW)},scope:this},hide:{fn:function(){p.fireEvent(bc.events.JOIN_WINDOW_HIDE)},scope:this}}});l=new Ext.FormPanel({frame:true,defaultType:"textfield",items:[{fieldLabel:"Email",name:"email",allowBlank:false,width:"90%"},{fieldLabel:"Password",name:"password",inputType:"password",allowBlank:false,width:"90%",enableKeyEvents:true,listeners:{keydown:function(s,
t){t&&t.button==12&&l.buttons[0].handler.call(this)}}}],buttonAlign:"right",buttons:[{text:"Login",formBind:true,handler:v.login}]});q=new Ext.Window({layout:"fit",width:350,height:150,plain:true,closeAction:"hide",title:"Login",modal:true,scope:this,items:l,listeners:{show:{fn:function(){var s=q.items.items[0].form.items.items[0];s.focus.defer(100,s);bc.commander.activeInstance.bus.fireEvent(bc.events.LOGIN_WINDOW_SHOW)},scope:this},hide:{fn:function(){bc.commander.activeInstance.bus.fireEvent(bc.events.JOIN_WINDOW_HIDE)},
scope:this}}});n.getDashboardCommandEl=function(){var s=k.items.items[0].items.items;for(var t in s)if(s[t].id=="dashboard_command")return s[t]};n.getModulesCustomizer=function(){if(!n.modulesCustomizer)n.modulesCustomizer=bc.ui.customize.ModulesCustomizer();return n.modulesCustomizer};n.onUserIsLoggedIn=function(){d()};n.renderModules=function(s){for(var t=0;t<o.length;t++){o[t].destroy();delete o[t]}o=[];t=r.getActiveModules();for(var A in t){var B=t[A];B=function(C){var E={w:"width",h:"height"};
for(var D in C){var F=C[D];if(E[D]){delete C[D];C[E[D]]=F}}return C}(B);B.renderTo="panel_center";B.constrain=true;B.id=A;s&&Ext.apply(B,s);B=bc.modules[A](B);B.show();o.push(B)}};n.updateModules=function(s){for(var t=0;t<o.length;t++)o[t].win.updateContent(s)};n.updateModulesWinConfig=function(s){n.renderModules(s)};n.onItemImageWindowShow=function(){var s=Ext.get("ItemImage").dom.style.zIndex;Ext.get("panel_south").setStyle("z-index",1+s)};n.run=function(){g=new Ext.Viewport({layout:"border",items:[h,
m,k]});f();g.doLayout();a();m.on("resize",e);c()};return n};Ext.ns("bc.ui");
bc.ui.UI=function(b){function a(){var g=Ext.getCmp("panel_center"),h=g.getPosition(),m=g.getHeight();g=g.getWidth();return{x:h[0],y:h[1],height:m,width:g}}function d(){f=bc.ui.Dashboard();f.run()}var c={},f,e,n=null;Ext.apply(c,b);c.onLayoutChange=function(g){alert("ui notified of layout change to "+g.data);bc.log("ui notified of layout change to "+g.data)};c.getDashboardCommandEl=function(){return f.getDashboardCommandEl()};c.hideSplash=function(){var g=Ext.get("loading"),h=Ext.get("loading-mask");g&&
h&&setTimeout(function(){g.remove();h.fadeOut({remove:true})},250)};c.showWelcome=function(){if(!n){n=new bc.ui.WelcomeWindow;n.show()}};c.showPopupBlockerWarning=function(){Ext.MessageBox.show({title:"Popup Blocker Warning",msg:"You must disable the pop-up blocker in your browser for 'BuyerCommand.com' to perform this command.  The instructions for disabling the pop-up blocker are at the top of the screen.  You can also click the \"Right Now On eBay\" icon to view the item.",width:300,buttons:Ext.MessageBox.OK})};
c.renderModules=function(){f.renderModules()};c.updateModules=function(g){f.updateModules(g)};c.updateModulesWinConfig=function(g){f.updateModulesWinConfig(g)};c.showLookaheadPanel=function(g){var h=bc.commander.activeInstance.startCliSession();if(e)e.refreshComponent({data:g,centerPanelGeometry:a()});else{e=bc.ui.LookaheadPanel({data:g,centerPanelGeometry:a()});e.showComponent()}h.lookaheadComponentDisplayed(true);h.focusLookaheadSelection(1)};c.destroyLookaheadPanel=function(){e.destroyComponent()};
c.lookaheadData=function(){return e.data()};d();return c};bc.ui.UIManager=function(b){var a={};Ext.apply(a,b);return a};bc.ui.WelcomeWindow=Ext.extend(Ext.Window,{closable:true,width:460,height:550,autoScroll:true,modal:true,autoLoad:{url:"/welcome"},title:"BuyerCommand&trade; - Take Command of Your Buying Experience"});Ext.ns("bc.ui");
bc.ui.LookaheadPanel=function(b){function a(){e=b.data;n=b.centerPanelGeometry}function d(){var h=new Ext.Tip({title:"Category Picker, navigate with Arrow keys, hit Enter to select",layout:"table",layoutConfig:{columns:1},items:c(),defaults:{cellCls:"lookahead-table-cell"}});h.show();var m=h.getHeight();h.destroy();h=Math.ceil(m/n.height);calculatedColumnsTableLayoutTip=new Ext.Tip({title:"Category Picker, navigate with Arrow keys, hit Enter to select",layout:"table",layoutConfig:{columns:h},items:c(),
defaults:{cellCls:"lookahead-table-cell"}});calculatedColumnsTableLayoutTip.show();h={x:calculatedColumnsTableLayoutTip.getPosition()[0],y:calculatedColumnsTableLayoutTip.getPosition()[1],height:calculatedColumnsTableLayoutTip.getHeight(),width:calculatedColumnsTableLayoutTip.getWidth(),columnsNeeded:h};calculatedColumnsTableLayoutTip.destroy();return h}function c(){for(var h=[],m=0,k=e.length;m<k;m++)h.push({html:e[m].categorynamepath,id:"lookahead-selection-"+(m+1)});return h}var f={},e,n,g;a();
f.showComponent=function(){component_geometry=d();var h=Math.floor(n.width/2-component_geometry.width/2),m=n.height+n.y-component_geometry.height;g=new Ext.Tip({title:"Category Picker, navigate with Arrow keys, hit Enter to select",layout:"table",layoutConfig:{columns:component_geometry.columnsNeeded},items:c(),x:h,y:m,defaults:{cellCls:"lookahead-table-cell"}});g.show()};f.refreshComponent=function(h){e=h.data;n=h.centerPanelGeometry;g.destroy();f.showComponent()};f.destroyComponent=function(){g.destroy()};
f.data=function(){return e};return f};Ext.BLANK_IMAGE_URL=bc.STATIC_URL+"/i/s.gif";Ext.chart.Chart.CHART_URL=bc.STATIC_URL+"/js/Frameworks/ext-3.0.0/resources/charts.swf";bc.IMAGE_MISSING_ITEM_PICTURE=bc.STATIC_URL+"/i/nopicture_iframe.jpg";try{bc.log=!bc.isProduction&&console&&!Ext.isSafari?console.log:function(){}}catch(e$$10){bc.log=function(){}};
