Ext.onReady(function(){
Ext.tree.AsyncTreeNode.prototype.loadComplete=Ext.tree.AsyncTreeNode.prototype.loadComplete.createSequence(function(){
this.loaded=false;
});
Ext.override(Ext.Window,{beforeShow:function(){
delete this.el.lastXY;
delete this.el.lastLT;
if(this.x===undefined||this.y===undefined){
var xy=this.el.getAlignToXY(this.container,"c-c");
var _2=this.el.translatePoints(xy[0],xy[1]);
this.x=this.x===undefined?_2.left:this.x;
this.y=this.y===undefined?_2.top:this.y;
}
this.el.setLeftTop(this.x,this.y);
if(this.expandOnShow){
this.expand(false);
}
if(this.modal){
this.container.addClass("x-body-masked");
var _3=Ext.get(document.body).getWidth();
var _4=Ext.get(document.body).getHeight();
var _5=((Ext.isIE)?document.documentElement.clientWidth:window.innerWidth)-SwitchGames.Utility.getScrollbarWidth();
var _6=((Ext.isIE)?document.documentElement.clientHeight:window.innerHeight)-SwitchGames.Utility.getScrollbarWidth();
this.mask.setSize(_3<_5?_5:_3,_4<_6?_6:_4);
this.mask.setLeftTop(Ext.get(document.body).getLeft(),Ext.get(document.body).getTop()).show();
}
},afterHide:function(){
this.proxy.hide();
if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){
Ext.EventManager.removeResizeListener(this.onWindowResize,this);
}
if(this.modal){
this.mask.hide();
this.container.removeClass("x-body-masked");
}
if(this.keyMap){
this.keyMap.disable();
}
this.fireEvent("hide",this);
},onWindowResize:function(){
if(this.maximized){
this.fitContainer();
}
if(this.modal){
this.mask.setSize("100%","100%");
this.mask.setSize(Ext.get(document.body).getWidth(),Ext.get(document.body).getHeight());
}
this.doConstrain();
},onDestroy:Ext.Window.prototype.onDestroy.createInterceptor(function(){
Ext.EventManager.removeResizeListener(this.onWindowResize,this);
})});
Ext.override(Ext.form.ComboBox,{initList:function(){
if(!this.list){
var _7;
if(this.listBaseClass){
_7=this.listBaseClass;
}else{
_7="x-combo-list";
}
this.list=new Ext.Layer({shadow:this.shadow,cls:[_7,this.listClass].join(" "),constrain:false});
var lw=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);
this.list.setWidth(lw);
this.list.swallowEvent("mousewheel");
this.assetHeight=0;
if(this.title){
this.header=this.list.createChild({cls:_7+"-hd",html:this.title});
this.assetHeight+=this.header.getHeight();
}
this.innerList=this.list.createChild({cls:_7+"-inner"});
this.innerList.on("mouseover",this.onViewOver,this);
this.innerList.on("mousemove",this.onViewMove,this);
this.innerList.setWidth(lw-this.list.getFrameWidth("lr"));
if(this.pageSize){
this.footer=this.list.createChild({cls:_7+"-ft"});
this.pageTb=new Ext.PagingToolbar({store:this.store,pageSize:this.pageSize,renderTo:this.footer});
this.assetHeight+=this.footer.getHeight();
}
if(!this.tpl){
this.tpl="<tpl for=\".\"><div class=\""+_7+"-item\">{"+this.displayField+"}</div></tpl>";
}
this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+_7+"-item"});
this.view.on("click",this.onViewClick,this);
this.bindStore(this.store,true);
if(this.resizable){
this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});
this.resizer.on("resize",function(r,w,h){
this.maxHeight=h-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;
this.listWidth=w;
this.innerList.setWidth(w-this.list.getFrameWidth("lr"));
this.restrictHeight();
},this);
this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px");
}
}
},initEvents:function(){
Ext.form.ComboBox.superclass.initEvents.call(this);
this.keyNav=new Ext.KeyNav(this.el,{"up":function(e){
this.inKeyMode=true;
this.selectPrev();
},"down":function(e){
if(!this.isExpanded()){
this.onTriggerClick();
}else{
this.inKeyMode=true;
this.selectNext();
}
},"enter":function(e){
var _f=this.view.getSelectedIndexes();
if(_f.length==0){
return (false);
}
this.onViewClick();
this.delayedCheck=true;
this.unsetDelayCheck.defer(10,this);
},"esc":function(e){
this.collapse();
},"tab":function(e){
var _12=this.view.getSelectedIndexes();
if(_12.length==0){
this.collapse();
return (false);
}
this.onViewClick(false);
return true;
},scope:this,doRelay:function(foo,bar,_15){
if(_15=="down"||this.scope.isExpanded()){
return Ext.KeyNav.prototype.doRelay.apply(this,arguments);
}
return true;
},forceKeyDown:true});
this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);
this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);
if(this.typeAhead){
this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this);
}
if(this.editable!==false){
this.el.on("keyup",this.onKeyUp,this);
}
if(this.forceSelection){
this.on("blur",this.doForce,this);
}
},onLoad:function(){
if(!this.hasFocus){
return;
}
if(this.store.getCount()>0){
this.expand();
this.restrictHeight();
if(this.lastQuery==this.allQuery){
if(this.editable){
}
if(!this.selectByValue(this.value,true)){
}
}else{
if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){
this.taTask.delay(this.typeAheadDelay);
}
}
}else{
this.onEmptyResults();
}
}});
Ext.form.TriggerField.override({afterRender:function(){
Ext.form.TriggerField.superclass.afterRender.call(this);
var y;
if(Ext.isIE&&!this.hideTrigger&&this.el.getY()!=(y=this.trigger.getY())){
this.el.position();
this.el.setY(y);
}
}});
Ext.override(Ext.tree.TreeEventModel,{onCheckboxClick:function(e,t){
}});
Ext.override(Ext.tree.AsyncTreeNode,{reload:function(_19){
this.collapse(false,false);
while(this.firstChild){
this.removeChild(this.firstChild);
}
this.childrenRendered=false;
this.loaded=false;
if(this.isHiddenRoot()){
this.expanded=false;
}
this.expand(false,true,_19);
}});
Ext.override(Ext.QuickTip,{onTargetOver:function(e){
if(this.disabled){
return;
}
this.targetXY=e.getXY();
var t=e.getTarget();
if(!t||t.nodeType!==1||t==document||t==document.body){
return;
}
if(this.activeTarget&&t==this.activeTarget.el){
this.clearTimer("hide");
this.show();
return;
}
if(t&&this.targets[t.id]){
this.activeTarget=this.targets[t.id];
this.activeTarget.el=t;
this.delayShow();
return;
}
var ttp,et=Ext.fly(t),cfg=this.tagConfig;
var ns=cfg.namespace;
if(this.interceptTitles&&t.title){
ttp=t.title;
t.qtip=ttp;
t.removeAttribute("title");
e.preventDefault();
}else{
ttp=t.qtip||et.getAttributeNS(ns,cfg.attribute);
}
if(ttp){
var _20=et.getAttributeNS(ns,cfg.hide);
this.activeTarget={el:t,text:ttp,width:et.getAttributeNS(ns,cfg.width),autoHide:_20!="user"&&_20!=="false",title:et.getAttributeNS(ns,cfg.title),cls:et.getAttributeNS(ns,cfg.cls),align:et.getAttributeNS(ns,cfg.align),dismissDelay:15000};
this.delayShow();
}
}});
Ext.lib.Ajax.isCrossDomain=function(u){
var _22=/(?:(\w*:)\/\/)?([\w\.]*(?::\d*)?)/.exec(u);
if(!_22[1]){
return false;
}
return (_22[1]!=location.protocol)||(_22[2]!=location.host);
};
Ext.override(Ext.data.Connection,{request:function(o){
if(this.fireEvent("beforerequest",this,o)!==false){
var p=o.params;
if(typeof p=="function"){
p=p.call(o.scope||window,o);
}
if(typeof p=="object"){
p=Ext.urlEncode(p);
}
if(this.extraParams){
var _25=Ext.urlEncode(this.extraParams);
p=p?(p+"&"+_25):_25;
}
var url=o.url||this.url;
if(typeof url=="function"){
url=url.call(o.scope||window,o);
}
if(o.form){
var _27=Ext.getDom(o.form);
url=url||_27.action;
var _28=_27.getAttribute("enctype");
if(o.isUpload||(_28&&_28.toLowerCase()=="multipart/form-data")){
return this.doFormUpload(o,p,url);
}
var f=Ext.lib.Ajax.serializeForm(_27);
p=p?(p+"&"+f):f;
}
var hs=o.headers;
if(this.defaultHeaders){
hs=Ext.apply(hs||{},this.defaultHeaders);
if(!o.headers){
o.headers=hs;
}
}
var cb={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:o},timeout:this.timeout};
var _2c=o.method||this.method||(p?"POST":"GET");
if(_2c=="GET"&&(this.disableCaching&&o.disableCaching!==false)||o.disableCaching===true){
url+=(url.indexOf("?")!=-1?"&":"?")+"_dc="+(new Date().getTime());
}
if(typeof o.autoAbort=="boolean"){
if(o.autoAbort){
this.abort();
}
}else{
if(this.autoAbort!==false){
this.abort();
}
}
if((_2c=="GET"&&p)||o.xmlData||o.jsonData){
url+=(url.indexOf("?")!=-1?"&":"?")+p;
p="";
}
if(o.scriptTag||this.scriptTag||Ext.lib.Ajax.isCrossDomain(url)){
this.transId=this.scriptRequest(_2c,url,cb,p,o);
}else{
this.transId=Ext.lib.Ajax.request(_2c,url,cb,p,o);
}
return this.transId;
}else{
Ext.callback(o.callback,o.scope,[o,null,null]);
return null;
}
},scriptRequest:function(_2d,url,cb,_30,_31){
var _32=++Ext.data.ScriptTagProxy.TRANS_ID;
var _33={id:_32,cb:_31.callbackName||"stcCallback"+_32,scriptId:"stcScript"+_32,options:_31};
url+=(url.indexOf("?")!=-1?"&":"?")+_30+String.format("&{0}={1}",_31.callbackParam||this.callbackParam||"callback",_33.cb);
var _34=this;
window[_33.cb]=function(o){
_34.handleScriptResponse(o,_33);
};
_33.timeoutId=this.handleScriptFailure.defer(cb.timeout,this,[_33]);
var _36=document.createElement("script");
_36.setAttribute("src",url);
_36.setAttribute("type","text/javascript");
_36.setAttribute("id",_33.scriptId);
document.getElementsByTagName("head")[0].appendChild(_36);
return _33;
},handleScriptResponse:function(o,_38){
this.transId=false;
this.destroyScriptTrans(_38,true);
var _39=_38.options;
var doc=null;
response={responseObject:o,responseText:(typeof o=="object")?Ext.util.JSON.encode(o):String(o),responseXML:doc,argument:_39.argument};
this.fireEvent("requestcomplete",this,response,_39);
Ext.callback(_39.success,_39.scope,[response,_39]);
Ext.callback(_39.callback,_39.scope,[_39,true,response]);
},handleScriptFailure:function(_3b){
this.transId=false;
this.destroyScriptTrans(_3b,false);
var _3c=_3b.options;
response={argument:_3c.argument,status:500,statusText:"Server failed to respond",responseText:""};
this.fireEvent("requestexception",this,response,_3c,{status:-1,statusText:"communication failure"});
Ext.callback(_3c.failure,_3c.scope,[response,_3c]);
Ext.callback(_3c.callback,_3c.scope,[_3c,false,response]);
},destroyScriptTrans:function(_3d,_3e){
document.getElementsByTagName("head")[0].removeChild(document.getElementById(_3d.scriptId));
clearTimeout(_3d.timeoutId);
if(_3e){
window[_3d.cb]=undefined;
try{
delete window[_3d.cb];
}
catch(e){
}
}else{
window[_3d.cb]=function(){
window[_3d.cb]=undefined;
try{
delete window[_3d.cb];
}
catch(e){
}
};
}
}});
Ext.ux.PersistentTip=Ext.extend(Ext.ToolTip,{initComponent:function(){
Ext.apply(this,{showDelay:500,hideDelay:500,autoHide:false});
Ext.ux.PersistentTip.superclass.initComponent.call(this);
},afterRender:function(){
Ext.ux.PersistentTip.superclass.afterRender.call(this);
this.el.on("mouseout",this.onTargetOut,this);
this.el.on("mouseover",this.onElOver,this);
},checkWithin:function(e){
if(this.el&&e.within(this.el.dom,true)){
return true;
}
if(this.disabled||e.within(this.target.dom,true)){
return true;
}
return false;
},onElOver:function(e){
if(this.checkWithin(e)){
this.clearTimer("hide");
}
},onTargetOver:function(e){
if(this.disabled||e.within(this.target.dom,true)){
return;
}
this.clearTimer("hide");
this.targetXY=e.getXY();
this.delayShow(e);
},delayShow:function(e){
this.showTimer=this.doShow.defer(this.showDelay,this,[e]);
},doShow:function(e){
var xy=e.getXY();
var _45=this.target.getRegion().contains({left:xy[0],right:xy[0],top:xy[1],bottom:xy[1]});
if(_45){
this.show();
}
},onTargetOut:function(e){
if(this.checkWithin(e)){
this.clearTimer("hide");
}else{
if(this.hideTimer){
this.hide();
}else{
this.delayHide();
}
}
}});
Ext.reg("persistenttip",Ext.ux.PersistentTip);
});
Ext.onReady(function(){
Ext.ux.PanPanel=Ext.extend(Ext.Panel,{constructor:function(_47){
_47.autoScroll=false;
Ext.ux.PanPanel.superclass.constructor.apply(this,arguments);
},onRender:function(){
Ext.ux.PanPanel.superclass.onRender.apply(this,arguments);
this.body.appendChild(this.client);
this.client=Ext.get(this.client);
this.client.on("mousedown",this.onMouseDown,this);
this.client.on("load",this.onClientLoad,this);
this.client.setStyle("cursor","move");
},zoomIn:function(){
var _48,_49,_4a,_4b;
_48=this.client.getWidth();
_49=this.client.getHeight();
if(_48>=_49){
_4a=_48+25;
ratio=_4a/_48;
_4b=Math.floor(_49*ratio);
}else{
_4b=_49+25;
ratio=_4b/_49;
_4a=Math.floor(_48*ratio);
}
this.client.setWidth(_4a);
this.client.setHeight(_4b);
},zoomOut:function(){
var _4c,_4d,_4e,_4f,_50;
_4c=this.client.getWidth();
_4d=this.client.getHeight();
if(_4c>=_4d){
if(_4c-25<110){
_4e=110;
}else{
_4e=_4c-25;
}
_50=_4e/_4c;
_4f=Math.floor(_4d*_50);
}else{
if(_4d-25<110){
_4f=110;
}else{
_4f=_4d-25;
}
_50=_4f/_4d;
_4e=Math.floor(_4c*_50);
}
this.client.setWidth(_4e);
this.client.setHeight(_4f);
if(_4e<=110||_4f<=110){
this.body.scrollTo("left",0,false);
this.body.scrollTo("top",0,false);
}
},setClientSrc:function(_51){
this.client.dom.src=_51;
this.client.setStyle("cursor","move");
},onMouseDown:function(e){
e.stopEvent();
this.mouseX=e.getPageX();
this.mouseY=e.getPageY();
Ext.getBody().on("mousemove",this.onMouseMove,this);
Ext.getDoc().on("mouseup",this.onMouseUp,this);
},onClientLoad:function(e){
this.client.setStyle("width","");
this.client.setStyle("height","");
this.client.dom.removeAttribute("width");
this.client.dom.removeAttribute("height");
this.client.setStyle("cursor","move");
this.body.scrollTo("left",0,false);
this.body.scrollTo("top",0,false);
},onMouseMove:function(e){
e.stopEvent();
var x=e.getPageX();
var y=e.getPageY();
var _57=x-this.mouseX;
var _58=y-this.mouseY;
this.body.dom.scrollLeft-=_57;
this.body.dom.scrollTop-=_58;
this.mouseX=x;
this.mouseY=y;
},onMouseUp:function(e){
Ext.getBody().un("mousemove",this.onMouseMove,this);
Ext.getDoc().un("mouseup",this.onMouseUp,this);
}});
});
Ext.onReady(function(){
Ext.namespace("SwitchGames.Components");
SwitchGames.Components.SlidePanel=Ext.extend(Ext.Panel,{layout:"card",autoEl:{cls:"sg-component-slidePanel"},defaultType:"sg-slidePanelItem",initComponent:function(){
SwitchGames.Components.SlidePanel.superclass.initComponent.apply(this,arguments);
this.addEvents("beforeslidein","afterslidein","beforeslideout","afterslideout","stepchanged");
this.on("afterlayout",this.onAfterLayout,this,{single:true});
},onRender:function(_5a){
SwitchGames.Components.SlidePanel.superclass.onRender.apply(this,arguments);
if(!this.layoutTpl){
SwitchGames.Components.SlidePanel.prototype.layoutTpl=new Ext.Template("<div class=\"sg-components-slidePanel-layout\">","<div class=\"sg-components-slidePanel-layout-body-outer\">","<div class=\"sg-components-slidePanel-layout-body\"></div>","{extraBodyMarkup}","</div>","<div class=\"sg-components-slidePanel-layout-col-outer sg-components-slidePanel-layout-leftCol\">","<div class=\"sg-components-slidePanel-layout-col-inner\">","<div class=\"sg-components-slidePanel-slideAction-outer\">","<div class=\"sg-components-slidePanel-slideAction-inner\">","<div class=\"sg-components-slidePanel-slideAction-image\"></div>","<div class=\"sg-components-slidePanel-slideAction-text\"></div>","</div>","</div>","</div>","{extraColumnMarkup}","</div>","<div class=\"sg-components-slidePanel-layout-col-outer sg-components-slidePanel-layout-rightCol\">","<div class=\"sg-components-slidePanel-layout-col-inner\">","<div class=\"sg-components-slidePanel-slideAction-outer\">","<div class=\"sg-components-slidePanel-slideAction-inner\">","<div class=\"sg-components-slidePanel-slideAction-image\"></div>","<div class=\"sg-components-slidePanel-slideAction-text\"></div>","</div>","</div>","</div>","{extraColumnMarkup}","</div>","</div>");
this.layoutTpl.compile();
}
this.layoutTpl.append(this.body.dom,this);
this.slideLeftCol=Ext.get(Ext.DomQuery.selectNode(".sg-components-slidePanel-layout-leftCol",this.body.dom));
this.slideBody=Ext.get(Ext.DomQuery.selectNode(".sg-components-slidePanel-layout-body",this.body.dom));
this.slideRightCol=Ext.get(Ext.DomQuery.selectNode(".sg-components-slidePanel-layout-rightCol",this.body.dom));
this.slideLeftCol.on("click",this.onSlideActionClick,this,{direction:"left",delegate:".sg-components-slidePanel-slideAction-inner"});
this.slideRightCol.on("click",this.onSlideActionClick,this,{direction:"right",delegate:".sg-components-slidePanel-slideAction-inner"});
},onAfterRender:function(_5b){
SwitchGames.Components.SlidePanel.superclass.onAfterRender.apply(this,arguments);
this.items.on("add",this.onItemCollectionChanged,this);
this.items.on("remove",this.onItemCollectionChanged,this);
this.items.on("clear",this.onItemCollectionChanged,this);
},clearActiveItem:function(){
var _5c=this.getLayout();
if(_5c.activeItem){
_5c.activeItem.hide();
}
_5c.activeItem=null;
_5c.layout();
},onAfterLayout:function(){
var _5d=this.getLayout().activeItem;
if(_5d){
this.clearActiveItem();
this.scroll("right",_5d);
}else{
this.hideLeftSlide();
}
},onItemCollectionChanged:function(){
var _5e=this.getLayout().activeItem;
this.fireEvent("stepchanged",this,this.items.indexOf(_5e)+1,this.items.length);
},getLayoutTarget:function(){
return this.slideBody;
},getItemBody:function(_5f){
var _60=this.getComponent(_5f);
return (_60.getEl());
},getLeftSlideImage:function(){
return (this.body.select(".sg-components-slidePanel-layout-leftCol .sg-components-slidePanel-slideAction-image",true).elements[0]);
},getRightSlideImage:function(){
return (this.body.select(".sg-components-slidePanel-layout-rightCol .sg-components-slidePanel-slideAction-image",true).elements[0]);
},onSlideActionClick:function(e,_62,_63){
var col=e.within(this.slideLeftCol.dom)?this.slideLeftCol:this.slideRightCol;
if(!col.first().hasClass("sg-components-slidePanel-disabled")){
this.scroll(_63.direction);
}
},scroll:function(_65,_66,_67){
if(this.scrolling===true){
return;
}
this.scrolling=true;
var _68=this.getLayout();
var _69=_68.activeItem;
var _6a=this.items.indexOf(_69);
if(_67==null){
_67={};
}
_67["targetItem"]=_66;
_67["duration"]=0.5;
_67["easing"]="easeOutStrong";
_67["direction"]=_65;
var _6b=function(){
var _6c=_6a;
_66=_67.targetItem;
if(typeof _66=="string"){
_66=this.getComponent(_66);
_6c=this.items.indexOf(_66);
}else{
if(typeof _66=="number"){
_6c=_66;
_66=this.getComponent(_6c);
}else{
if(typeof _66=="object"){
_6c=this.items.indexOf(_66);
}else{
_6c+=(_65==="left"?-1:1);
_66=this.getComponent(_6c);
}
}
}
if(_6c<0||_66==null){
this.clearActiveItem();
throw new SwitchGames.Utility.Exception("'targetItem' is out of range","slide",this.getXType());
}
_68.setActiveItem(_66);
this.fireEvent("stepchanged",this,_6c+1,this.items.length);
this.showLeftSlide();
this.showRightSlide();
if(_6c==0){
this.hideLeftSlide();
}
if(_6c+1>=this.items.length){
this.hideRightSlide();
}
if(_66.isXType("sg-slidePanelItem")){
if(!_66.fireEvent("beforeslidein",this,_66,_67)){
this.scrolling=false;
return;
}
}
if(!this.fireEvent("beforeslidein",this,_66,_67)){
this.scrolling=false;
return;
}
_66.el.slideIn((_65==="left"?"l":"r"),{duration:_67.duration,easing:_67.easing,useDisplay:false,concurrent:true,scope:this,callback:function(){
if(_66.isXType("sg-slidePanelItem")){
if(!_66.fireEvent("afterslidein",this,_66,_67)){
this.scrolling=false;
return;
}
}
if(!this.fireEvent("afterslidein",this,_66,_67)){
this.scrolling=false;
return;
}
this.scrolling=false;
}});
};
if(_6a>=0&&_69!=null){
if(_69.isXType("sg-slidePanelItem")){
if(!_69.fireEvent("beforeslideout",this,_69,_67)){
this.scrolling=false;
return;
}
}
if(!this.fireEvent("beforeslideout",this,_69,_67)){
this.scrolling=false;
return;
}
_69.el.slideOut((_65==="left"?"r":"l"),{duration:_67.duration,easing:_67.easing,useDisplay:false,concurrent:true,scope:this,callback:function(){
if(_69.isXType("sg-slidePanelItem")){
if(!_69.fireEvent("afterslideout",this,_69,_67)){
this.scrolling=false;
return;
}
}
if(!this.fireEvent("afterslideout",this,_69,_67)){
this.scrolling=false;
return;
}
_6b.call(this);
}});
}else{
_6b.call(this);
}
},disableLeftSlide:function(){
this.slideLeftCol.first().addClass("sg-components-slidePanel-disabled");
},disableRightSlide:function(){
this.slideRightCol.first().addClass("sg-components-slidePanel-disabled");
},enableLeftSlide:function(){
this.slideLeftCol.first().removeClass("sg-components-slidePanel-disabled");
},enableRightSlide:function(){
this.slideRightCol.first().removeClass("sg-components-slidePanel-disabled");
},hideLeftSlide:function(){
this.slideLeftCol.addClass("sg-components-slidePanel-hidden");
},hideRightSlide:function(){
this.slideRightCol.addClass("sg-components-slidePanel-hidden");
},showLeftSlide:function(){
this.slideLeftCol.removeClass("sg-components-slidePanel-hidden");
},showRightSlide:function(){
this.slideRightCol.removeClass("sg-components-slidePanel-hidden");
},setLeftSlideText:function(_6d){
Ext.DomQuery.selectNode(".sg-components-slidePanel-slideAction-text",this.slideLeftCol.dom).innerHTML=_6d;
},setRightSlideText:function(_6e){
Ext.DomQuery.selectNode(".sg-components-slidePanel-slideAction-text",this.slideRightCol.dom).innerHTML=_6e;
}});
SwitchGames.Components.SlidePanelItem=Ext.extend(Ext.Panel,{autoEl:{cls:"sg-component-slidePanel-item"},leftSlideText:"Prev",rightSlideText:"Next",initComponent:function(){
SwitchGames.Components.SlidePanelItem.superclass.initComponent.apply(this,arguments);
this.addEvents("beforeslidein","afterslidein","beforeslideout","afterslideout");
this.on("beforeslidein",function(_6f,_70,_71){
if(this.leftSlideText&&this.leftSlideText.length){
_6f.setLeftSlideText(this.leftSlideText);
}
if(this.rightSlideText&&this.rightSlideText.length){
_6f.setRightSlideText(this.rightSlideText);
}
},this);
}});
Ext.reg("sg-slidePanel",SwitchGames.Components.SlidePanel);
Ext.reg("sg-slidePanelItem",SwitchGames.Components.SlidePanelItem);
SwitchGames.Components.SlidePanelSmall=Ext.extend(SwitchGames.Components.SlidePanel,{autoEl:{cls:"sg-component-slidePanel-small"}});
Ext.reg("sg-slidePanelSmall",SwitchGames.Components.SlidePanelSmall);
});
Ext.namespace("SwitchGames","SwitchGames.TradeOfferDD");
SwitchGames.TradeOfferDD=function(){
var _72,_73;
return {init:function(_74,_75){
_72=[];
_73=[];
},addDragTargets:function(_76){
for(var j=0,_78=_76.length;j<_78;j++){
_72.push(new SwitchGames.TradeOfferDD.MyDragZone(_76[j],{ddGroup:"to-dd-group",scroll:false}));
}
},addDropTargets:function(_79){
for(var j=0,_7b=_79.length;j<_7b;j++){
_73.push(new SwitchGames.TradeOfferDD.MyDropTarget(_79[j],{ddGroup:"to-dd-group",overClass:"to-drop-valid"}));
}
},removeDragTargets:function(_7c){
for(var j=0,_7e=_72.length;j<_7e;j++){
_72[j].unreg();
}
_72=[];
},removeDropTargets:function(_7f){
for(var j=0,_81=_73.length;j<_81;j++){
_73[j].unreg();
}
_73=[];
}};
}();
SwitchGames.TradeOfferDD.MyDragZone=function(el,_83){
_83=_83||{};
Ext.apply(_83,{ddel:document.createElement("div")});
SwitchGames.TradeOfferDD.MyDragZone.superclass.constructor.call(this,el,_83);
};
Ext.extend(SwitchGames.TradeOfferDD.MyDragZone,Ext.dd.DragSource,{startDrag:function(x,y){
var _86=Ext.get(this.getDragEl());
var el=Ext.get(this.getEl());
var _88=el.getStyles();
_86.applyStyles({border:"","z-index":25000});
_86.update(el.dom.innerHTML);
_86.addClass(el.dom.className+" dd-proxy");
},getDragData:function(e){
var _8a=Ext.get(e.getTarget());
if(_8a.hasClass("to-scroll-box-item-wrapper")){
return {ddel:this.ddel,item:_8a};
}else{
var _8b=_8a.findParentNode("div.to-scroll-box-item-wrapper",10,true);
if(_8b){
return ({ddel:this.ddel,item:_8b});
}else{
return (false);
}
}
},getRepairXY:function(e,_8d){
_8d.item.highlight("#5f635d");
return _8d.item.getXY();
}});
SwitchGames.TradeOfferDD.MyDropTarget=function(el,_8f){
SwitchGames.TradeOfferDD.MyDropTarget.superclass.constructor.call(this,el,_8f);
};
Ext.extend(SwitchGames.TradeOfferDD.MyDropTarget,Ext.dd.DropTarget,{notifyDrop:function(dd,e,_92){
this.el.removeClass(this.overClass);
this.el.appendChild(dd.getEl());
this.el.dom.scrollTop=10000;
if(this.el.dom.childNodes.length>2){
Ext.get(this.el.prev().setVisible(true));
Ext.get(this.el.next().setVisible(false));
}
return true;
}});
Ext.namespace("SwitchGames","SwitchGames.SafeTradeOfferDD");
SwitchGames.SafeTradeOfferDD=function(){
var _93,_94;
return {init:function(_95,_96){
_93=[];
_94=[];
},addDragTargets:function(_97){
for(var j=0,_99=_97.length;j<_99;j++){
_93.push(new SwitchGames.SafeTradeOfferDD.MyDragZone(_97[j],{ddGroup:"st-dd-group",scroll:false}));
}
},addDropTargets:function(_9a){
for(var j=0,_9c=_9a.length;j<_9c;j++){
_94.push(new SwitchGames.SafeTradeOfferDD.MyDropTarget(_9a[j],{ddGroup:"st-dd-group",overClass:"to-drop-valid"}));
}
},removeDragTargets:function(_9d){
for(var j=0,_9f=_93.length;j<_9f;j++){
_93[j].unreg();
}
_93=[];
},removeDropTargets:function(_a0){
for(var j=0,_a2=_94.length;j<_a2;j++){
_94[j].unreg();
}
_94=[];
}};
}();
SwitchGames.SafeTradeOfferDD.MyDragZone=function(el,_a4){
_a4=_a4||{};
Ext.apply(_a4,{ddel:document.createElement("div")});
SwitchGames.SafeTradeOfferDD.MyDragZone.superclass.constructor.call(this,el,_a4);
};
Ext.extend(SwitchGames.SafeTradeOfferDD.MyDragZone,Ext.dd.DragSource,{startDrag:function(x,y){
var _a7=Ext.get(this.getDragEl());
var el=Ext.get(this.getEl());
var _a9=el.getStyles();
_a7.applyStyles({border:"","z-index":25000});
_a7.update(el.dom.innerHTML);
_a7.addClass(el.dom.className+" dd-proxy");
},getDragData:function(e){
var _ab=Ext.get(e.getTarget());
if(_ab.hasClass("to-scroll-box-item-wrapper")){
return {ddel:this.ddel,item:_ab};
}else{
var _ac=_ab.findParentNode("div.to-scroll-box-item-wrapper",10,true);
if(_ac){
return ({ddel:this.ddel,item:_ac});
}else{
return (false);
}
}
},getRepairXY:function(e,_ae){
_ae.item.highlight("#5f635d");
return _ae.item.getXY();
}});
SwitchGames.SafeTradeOfferDD.MyDropTarget=function(el,_b0){
SwitchGames.SafeTradeOfferDD.MyDropTarget.superclass.constructor.call(this,el,_b0);
};
Ext.extend(SwitchGames.SafeTradeOfferDD.MyDropTarget,Ext.dd.DropTarget,{notifyDrop:function(dd,e,_b3){
this.el.removeClass(this.overClass);
this.el.appendChild(dd.getEl());
this.el.dom.scrollTop=10000;
if(this.el.dom.childNodes.length>2){
Ext.get(this.el.prev().setVisible(true));
Ext.get(this.el.next().setVisible(false));
}
SwitchGames.TradeOffer.safeTradeDropNotification();
return true;
}});
Ext.onReady(function(){
SwitchGames.SearchTreePlugin=Ext.extend(Object,{init:function(_b4){
if(!_b4.rendered){
_b4.on("render",function(){
this.init(_b4);
},this);
return;
}
this.tree=_b4;
_b4.body.on("click",this.onAddToWishlistClick,this,{delegate:"img[@name=\"game-node-addtowishlist\"]"});
_b4.body.on("click",this.onAddToMyStuffClick,this,{delegate:"img[@name=\"game-node-addtomystuff\"]"});
_b4.body.on("click",this.onRemoveFromWishlistClick,this,{delegate:"img[@name=\"game-node-removefromwishlist\"]"});
_b4.body.on("click",this.onRemoveFromMyStuffClick,this,{delegate:"img[@name=\"game-node-removefrommystuff\"]"});
_b4.body.on("click",this.onEditListingClick,this,{delegate:"img[@name=\"game-node-editlisting\"]"});
_b4.body.on("click",this.onAddToBuddyListClick,this,{delegate:"img[@name=\"offer-node-addtobuddylist\"]"});
_b4.body.on("click",this.onRemoveFromBuddyListClick,this,{delegate:"img[@name=\"offer-node-removefrombuddylist\"]"});
_b4.body.on("click",this.onMessageMemberAboutListingClick,this,{delegate:"img[@name=\"offer-node-messagememberaboutlisting\"]"});
_b4.body.on("click",this.onTransactionButtonClick,this,{delegate:"img[@transaction-type]"});
_b4.body.on("click",this.onInfoPanelLeftButtonClick,this,{delegate:".sg-info-panel-scrollbtn-left"});
_b4.body.on("click",this.onInfoPanelRightButtonClick,this,{delegate:".sg-info-panel-scrollbtn-right"});
_b4.body.on("click",this.onPaginationPrevButtonClick,this,{delegate:"img.sg-search-page-prev-btn"});
_b4.body.on("click",this.onPaginationNextButtonClick,this,{delegate:"img.sg-search-page-next-btn"});
_b4.body.on("click",this.onFilterForTradeClick,this,{delegate:"input.sg-search-fortrade-filter"});
_b4.body.on("click",this.onFilterSafeTradeClick,this,{delegate:"input.sg-search-safetrade-filter"});
_b4.body.on("click",this.onFilterForSaleClick,this,{delegate:"input.sg-search-forsale-filter"});
},onAddToWishlistClick:function(e,t){
if(SwitchGames.loggedIn==false){
SwitchGames.Dialogs.showNotLoggedInDialog();
return;
}
var _b7=this.getTreeNode(t);
var _b8;
if(_b7.attributes.type=="game"){
_b8=_b7.attributes.game_id;
}else{
if(_b7.attributes.type=="platform"){
_b8=_b7.attributes.platform_id;
}else{
if(_b7.attributes.type=="accessory"){
_b8=_b7.attributes.accessory_id;
}
}
}
SwitchGames.TradeTools.add(_b8,"wl",_b7.attributes.type);
},onRemoveFromWishlistClick:function(e,t){
var _bb=this.getTreeNode(t);
var _bc;
if(_bb.attributes.type=="game"){
_bc=_bb.attributes.game_id;
}else{
if(_bb.attributes.type=="platform"){
_bc=_bb.attributes.platform_id;
}else{
if(_bb.attributes.type=="accessory"){
_bc=_bb.attributes.accessory_id;
}
}
}
SwitchGames.TradeTools.remove(_bc,"wl",_bb.attributes.type);
},onAddToMyStuffClick:function(e,t){
if(SwitchGames.loggedIn==false){
SwitchGames.Dialogs.showNotLoggedInDialog();
return;
}
var _bf=this.getTreeNode(t);
var _c0;
if(_bf.attributes.type=="game"){
_c0=_bf.attributes.game_id;
}else{
if(_bf.attributes.type=="platform"){
_c0=_bf.attributes.platform_id;
}else{
if(_bf.attributes.type=="accessory"){
_c0=_bf.attributes.accessory_id;
}
}
}
SwitchGames.Search.addToMyStuff(_c0,_bf.attributes.type,false);
},onEditListingClick:function(e,t){
var _c3=this.getTreeNode(t);
var _c4=_c3.attributes.listing_id;
SwitchGames.Search.addToMyStuff(_c4,_c3.attributes.type,true);
},onRemoveFromMyStuffClick:function(e,t){
var _c7=this.getTreeNode(t);
var _c8;
if(_c7.attributes.type=="game"){
_c8=_c7.attributes.game_id;
}else{
if(_c7.attributes.type=="platform"){
_c8=_c7.attributes.platform_id;
}else{
if(_c7.attributes.type=="accessory"){
_c8=_c7.attributes.accessory_id;
}
}
}
SwitchGames.TradeTools.remove(_c8,"ms",_c7.attributes.type);
},onAddToBuddyListClick:function(e,t){
var _cb=this.getTreeNode(t);
var _cc=_cb.attributes.member_id;
var _cd=_cb.attributes.screen_name;
SwitchGames.Buddy.add(_cc,_cd);
},onRemoveFromBuddyListClick:function(e,t){
var _d0=this.getTreeNode(t);
var _d1=_d0.attributes.member_id;
var _d2=_d0.attributes.screen_name;
SwitchGames.Buddy.remove(_d1,_d2);
},onMessageMemberAboutListingClick:function(e,t){
var _d5=this.getTreeNode(t);
var _d6=_d5.attributes.member_id;
var _d7=_d5.attributes.screen_name;
SwitchGames.Member.messageMember(_d6,_d7,null,null);
},onVisitMemberSiteClick:function(e,t){
var _da=this.getTreeNode(t);
var _db=_da.attributes.screen_name;
SwitchGames.Member.visitMemberSite(_db);
},onTransactionButtonClick:function(e,t){
if(SwitchGames.loggedIn==false){
SwitchGames.Dialogs.showNotLoggedInDialog();
return;
}
var _de=this.getTreeNode(t);
var _df=_de.attributes.listing_id;
var _e0=t.getAttribute("transaction-type");
var _e1=t.getAttribute("itemtype")||false;
switch(_e0){
case "buy":
SwitchGames.Buy.purchaseItem(_df);
break;
case "trade":
if(_e1!="game"){
SwitchGames.TradeOffer.trade(_df);
}else{
SwitchGames.TradeOffer.safeTrade(_df);
}
break;
case "safetrade":
SwitchGames.TradeOffer.safeTrade(_df,null,null,true);
break;
case "switchbottrade":
var _e2=_de.parentNode.attributes.listing_id;
var _e3=_de.parentNode.parentNode.attributes.listing_id;
SwitchGames.TradeOffer.safeTrade(_e2,_e3,true);
break;
case "switchbotsafetrade":
var _e2=_de.parentNode.attributes.listing_id;
var _e3=_de.parentNode.parentNode.attributes.listing_id;
SwitchGames.TradeOffer.safeTrade(_e2,_e3,true,true);
break;
}
},onInfoPanelLeftButtonClick:function(e,t){
var _e6=Ext.get(t).findParentNode(".sg-info-panel-parent");
var _e7=Ext.get(t);
if(_e6){
if(_e6.childNodes.length>3){
var _e8=parseInt(_e6.getAttribute("currentPanel"));
var _e9=parseInt(_e6.getAttribute("totalPanels"));
if(_e8<=0){
return;
}
var _ea=Ext.select(".sg-info-panel-scrollbtn-right",true,_e6);
_ea.setVisible(true,false);
var _eb=Ext.get(_e6.childNodes[_e8+2]);
var _ec=Ext.get(_e6.childNodes[_e8+2-1]);
_eb.addClass("sliding");
_eb.slideOut("r",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_eb.removeClass("sliding");
_ec.addClass("sliding");
_ec.slideIn("l",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_ec.removeClass("sliding");
}});
}});
_e8--;
_e6.setAttribute("currentPanel",_e8);
if(_e8==0){
var _ed=Ext.select(".sg-info-panel-scrollbtn-left",true,_e6);
_ed.setVisible(false,false);
}
}
}
},onInfoPanelRightButtonClick:function(e,t){
var _f0=Ext.get(t).findParentNode(".sg-info-panel-parent");
if(_f0){
if(_f0.childNodes.length>3){
var _f1=parseInt(_f0.getAttribute("currentPanel"));
var _f2=parseInt(_f0.getAttribute("totalPanels"));
if(_f1+1>=_f2){
return;
}
var _f3=Ext.select(".sg-info-panel-scrollbtn-left",true,_f0);
_f3.setVisible(true,false);
var _f4=Ext.get(_f0.childNodes[_f1+2]);
var _f5=Ext.get(_f0.childNodes[_f1+2+1]);
_f4.addClass("sliding");
_f4.slideOut("l",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_f4.removeClass("sliding");
_f5.addClass("sliding");
_f5.slideIn("r",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_f5.removeClass("sliding");
}});
}});
_f1++;
_f0.setAttribute("currentPanel",_f1);
if(_f1+1>=_f2){
var _f6=Ext.select(".sg-info-panel-scrollbtn-right",true,_f0);
_f6.setVisible(false,false);
}
}
}
},onPaginationPrevButtonClick:function(e,t){
var _f9=this.getGameNode(t);
var _fa=parseInt(_f9.attributes.pageNumber);
if(_fa>0){
_f9.attributes.pageNumber=_fa-1;
}
_f9.reload();
},onPaginationNextButtonClick:function(e,t){
var _fd=this.getGameNode(t);
var _fe=parseInt(_fd.attributes.pageNumber);
_fd.attributes.pageNumber=_fe+1;
_fd.reload();
},onFilterForTradeClick:function(e,t){
var _101=this.getGameNode(t);
if(t.checked){
_101.attributes.forTrade=1;
}else{
_101.attributes.forTrade=0;
}
_101.attributes.pageNumber=1;
_101.reload();
},onFilterSafeTradeClick:function(e,t){
var _104=this.getGameNode(t);
if(t.checked){
_104.attributes.safeTrade=1;
}else{
_104.attributes.safeTrade=0;
}
_104.attributes.pageNumber=1;
_104.reload();
},onFilterForSaleClick:function(e,t){
var _107=this.getGameNode(t);
if(t.checked){
_107.attributes.forSale=1;
}else{
_107.attributes.forSale=0;
}
_107.attributes.pageNumber=1;
_107.reload();
},getGameNode:function(el){
var _109=Ext.get(el).findParentNode(".x-tree-node-ct",10,false).previousSibling;
if(_109){
var _10a=_109.getAttribute("ext:tree-node-id");
var _10b=this.tree.getNodeById(_10a);
if(_10b){
return _10b;
}else{
return null;
}
}else{
return null;
}
},getTreeNode:function(el){
var _10d=Ext.get(el).findParentNode(".x-tree-node-el",10,false);
if(_10d){
var _10e=_10d.getAttribute("ext:tree-node-id");
var _10f=this.tree.getNodeById(_10e);
if(_10f){
return _10f;
}else{
return null;
}
}else{
return null;
}
}});
});
Ext.onReady(function(){
Ext.tree.GameNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(n,a,_112,_113){
this.indentMarkup="";
var t=n.getOwnerTree();
var bw=t.borderWidth;
var _116;
var _117;
var _118,_119;
var _11a;
if(this.node.attributes.pageNumber==null){
this.node.attributes.pageNumber=1;
}
this.node.attributes.resultsPerPage=25;
this.node.attributes.forSale=0;
this.node.attributes.forTrade=0;
this.node.attributes.safeTrade=0;
var _11b=this.node.attributes.resultsPerPage;
var _11c=a.widget=="mystuff"?a.wishlist_count:a.listing_count;
var _11d=a.widget=="mystuff"?"none":a.widget.indexOf("shop_")==0?"none":a.type!="game"?"none":"";
var _11e=_11c>0?"":"none";
var _11f=(this.node.attributes.pageNumber*_11b)>=_11c?"none":"";
var _120=this.node.attributes.pageNumber>1?"":"none";
var temp=this.node.attributes.pageNumber*_11b;
var _122=((this.node.attributes.pageNumber-1)*_11b)+1;
var _123=_11c<temp?_11c:temp;
var _124="visible";
if(a.widget.indexOf("shop_")==0){
if(a.from_price==a.to_price){
_124="hidden";
}
_11a="<div style=\"float: left; width: 200px; font-size: 22px; padding-top: 10px; cursor: default;\">"+"<span id=\"shop-from-price\" style=\"color: #ffffff;\">$"+a.from_price+"</span><span id=\"shop-to-price\" style=\"color: #ffffff; visibility: "+_124+";\"> to $"+a.to_price+"</span></div>"+"<div style=\"float: left; width: 230px; padding-top: 15px; cursor: default;\"><img src=\""+SwitchGames.imageUrl+"shop/free_shipping_blue.png\" /></div>";
}
if(a.type=="game"){
_116=["<div class=\"sg-game-panel-text sg-game-panel-title-text\">"+Ext.util.Format.ellipsis(a.game_name,50)+"</div>","<div style=\"padding-top: 5px;\" class=\"sg-game-panel-text sg-game-panel-platform-text\">",SwitchGames.Utility.createStringValue(a.platform_name),"</div>","<div>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">Released:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">",SwitchGames.Utility.createStringValue(a.date_released),"</span>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">Publisher:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">",SwitchGames.Utility.createStringValue(a.publisher),"</span>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">ESRB:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">",SwitchGames.Utility.createStringValue(a.esrb),"</span>","</div>"];
_118=a.game_id;
_119=a.game_name;
}else{
if(a.type=="platform"){
_116=["<div class=\"sg-game-panel-text sg-game-panel-title-text\">",Ext.util.Format.ellipsis(a.platform_name,50),"</div>","<div style=\"padding-top: 5px;\" class=\"sg-game-panel-text sg-game-panel-platform-text\">",a.manufacturer,"</div>","<div>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">Released:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">",a.date_released,"</span>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">Manufacturer:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">",a.manufacturer,"</span>","</div>"];
_118=a.platform_id;
_119=a.platform_name;
}else{
if(a.type=="accessory"){
_116=["<div class=\"sg-game-panel-text sg-game-panel-title-text\">"+Ext.util.Format.ellipsis(a.accessory_name,50)+"</div>","<div style=\"padding-top: 5px;\" class=\"sg-game-panel-text sg-game-panel-platform-text\">"+a.platform_name+"</div>","<div>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">Released:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">",a.date_released,"</span>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">Manufacturer:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">",a.manufacturer,"</span>","</div>"];
_118=a.accessory_id;
_119=a.accessory_name;
}
}
}
_119=escape(decodeURIComponent(_119));
var _125;
var _126;
var _127,_128;
var _129;
var _12a;
if(a.widget=="mystuff"){
_129="<span style=\"color: #ffffff\">"+a.wishlist_count+"</span>";
_12a=" ext:qwidth=\"300\" ext:qtip=\"Click here to see who wants <b>"+unescape(_119).replace(/(")/g,"&quot;")+"</b>\" ";
}else{
if(a.widget=="switchbot"){
_129="<span style=\"color: #ffffff\">"+a.item_count+"</span>";
_12a=" ext:qwidth=\"300\" ext:qtip=\"Click here to see perfect trade matches for <b>"+unescape(_119).replace(/(")/g,"&quot;")+"</b>\" ";
}else{
_129="<span style=\"color: #ffffff\">"+a.listing_count+"</span>";
_12a=" ext:qwidth=\"300\" ext:qtip=\"Click here to see who owns <b>"+unescape(_119).replace(/(")/g,"&quot;")+"</b>\" ";
}
}
var _12b="";
var _12c="";
var _12d="Members who have this:";
var _12e="";
var _12f="";
if(a.member_id!=0){
if(a.widget=="search"||a.widget=="newlistings"||a.widget=="latest"||a.widget=="top25"){
if(a.hasWishlist==null&&a.hasListing==null){
_12b="<img style=\"padding-top: 0px; float: left;\" name=\"game-node-addtowishlist\" ext:qtip=\"Add <b>"+unescape(_119).replace(/(")/g,"&quot;")+"</b> to your wishlist\" ext:qwidth=\"300\" src=\""+SwitchGames.imageUrl+"common/buttons/i-want-it.png\" >";
_12b+="<div style=\"padding-top: 0px; float: left;\">&nbsp;&nbsp;</div>";
_12b+="<img style=\"padding-top: 0px; float: left;\" name=\"game-node-addtomystuff\" ext:qtip=\"Add <b>"+unescape(_119).replace(/(")/g,"&quot;")+"</b> to your stuff\" ext:qwidth=\"300\" src=\""+SwitchGames.imageUrl+"common/buttons/i-own-it.png\" >";
_117="8px";
}else{
_117="20px";
}
}else{
if(a.widget=="wishlist"){
_12b="<img name=\"game-node-removefromwishlist\" ext:qtip=\"Remove <b>"+unescape(_119).replace(/(")/g,"&quot;")+"</b> from your wishlist\" ext:qwidth=\"300\" src=\""+SwitchGames.imageUrl+"common/buttons/remove-from-tradetools-list-large.png\" >";
_117="3px";
}else{
if(a.widget=="mystuff"){
_12b="<img style=\"padding-top: 0px; float: left;\" name=\"game-node-removefrommystuff\" ext:qtip=\"Remove <b>"+unescape(_119).replace(/(")/g,"&quot;")+"</b> from your stuff\" ext:qwidth=\"300\" src=\""+SwitchGames.imageUrl+"common/buttons/remove-from-tradetools-list-large.png\" >";
_12b+="<div style=\"padding-top: 0px; float: left;\">&nbsp;&nbsp;</div>";
_12b+="<img style=\"padding-top: 0px; float: left;\" name=\"game-node-editlisting\" ext:qtip=\"Edit <b>"+unescape(_119).replace(/(")/g,"&quot;")+"</b>\" ext:qwidth=\"300\" src=\""+SwitchGames.imageUrl+"common/buttons/edit-item-bigger.png\" >";
if(a.for_trade!=undefined){
if(a.for_trade==1){
_12e="ENABLED FOR TRADE";
}else{
_12e="NOT ENABLED FOR TRADE";
}
}
if(a.for_sale!=null){
_12e+="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
if(a.for_sale==1&&a.verified_badge==1){
_12e+="ENABLED FOR SALE ($"+a.price+") ";
}else{
if(a.for_sale==1&&a.verified_badge!=1){
_12e+="YOU MUST BE VERIFIED IN ORDER TO SELL YOUR GAMES";
}else{
_12e+="NOT ENABLED FOR SALE";
}
}
}
_12c="<div style=\"float: left; font-size: 15px; padding-top: 15px; padding-left: 15px; color: #ff9300;\"><span style=\"padding: 0px; margin: 0px; font-size: 15px; color: #ff9300;\">"+_12e+"</span></div>";
_12d="Members who want this:";
_117="3px";
}else{
if(a.widget=="switchbot"){
_12b="";
_12d=a.item_count+" TRADE POSSIBILITIES:";
_117="20px";
}else{
_12b="<img name=\"game-node-addtowishlist\" ext:qtip=\"Add <b>"+unescape(_119).replace(/(")/g,"&quot;")+"</b> to your wishlist\" ext:qwidth=\"300\" src=\""+SwitchGames.imageUrl+"common/buttons/add-to-wishlist-large.png\" >";
_117="3px";
}
}
}
}
}else{
_12b="<img style=\"padding-top: 0px; float: left;\" name=\"game-node-addtowishlist\" ext:qtip=\"Add <b>"+unescape(_119).replace(/(")/g,"&quot;")+"</b> to your wishlist\" ext:qwidth=\"300\" src=\""+SwitchGames.imageUrl+"common/buttons/i-want-it.png\" >";
_12b+="<div style=\"padding-top: 0px; float: left;\">&nbsp;&nbsp;</div>";
_12b+="<img style=\"padding-top: 0px; float: left;\" name=\"game-node-addtomystuff\" ext:qtip=\"Add <b>"+unescape(_119).replace(/(")/g,"&quot;")+"</b> to your stuff\" ext:qwidth=\"300\" src=\""+SwitchGames.imageUrl+"common/buttons/i-own-it.png\" >";
_117="8px";
}
var buf=["<li class=\"x-tree-node sg-game-panel-cell\">","<div style=\"overflow: hidden;\" ext:tree-node-id=\"",n.id,"\" class=\"x-tree-node-el sg-game-panel-row",(parseInt(a.index)%2==0?" sg-game-panel-row-even ":" sg-game-panel-row-odd "),a.cls,"\">","<div style=\"float: left;\">",this.indentMarkup,"</div>","<div style=\"float: left;\" "+_12a+">","<div style=\"position: relative; line-height: 14px; left: 25px; top: -25px; text-align: left; font-size: 13px; color: #f0f0f0; font-weight: bold;\">",_129,"</div>","</div>","<img style=\"float: left;\" src=\"",a.icon||this.emptyIcon,"\" class=\"",(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),"\" unselectable=\"on\">","<a hidefocus=\"on\" class=\"x-tree-node-anchor\">","<div>","<div style=\"width: 110px; height: 110px; float: left; padding: 0px; overflow: hidden !important;\">","<img ext:qtip=\"Click for product details and screenshots of <b>"+unescape(_119).replace(/(")/g,"&quot;")+"</b>\" ext:qwidth=\"300\" itemid=\"",_118,"\" itemtype=\"",a.type,"\" onload=\"SwitchGames.Utility.scaleAndCenterImageInParent(this);\" src=\"",SwitchGames.Utility.getCoverValue(a.photo_cover),"\" class=\"has-detail\" style=\"width: 0px; height: 0px;\">","</div>","<div style=\"float: left; padding-top: ",_117,";\">","<div>",_116.join(""),"</div>","<div style=\"height: 40px; width: 740px; clear: both;\">",_11a,"<div style=\"float: left; height: 40px; padding: 5px 0px 0px 0px;\">",_12b,"</div>",_12c,"</div>","</div>","</div>","</a>","</div>","<ul class=\"x-tree-node-ct\" style=\"display:none; width: 100%;\">","<li>","<div class=\"sg-search-panel-child-header\">","<div class=\"sg-search-panel-child-header-inner-left\">",_12d,"</div>","<div class=\"sg-search-panel-child-header-inner-right\">","<div id=\"sg-",a.widget,"-game-node-pagination-container-",_118,"\" style=\"display: ",_11e,";\">","<img id=\"sg-",a.widget,"-game-node-prev-btn-",_118,"\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-pagination-left.png\" class=\"sg-search-page-prev-btn\" style=\"cursor: pointer; display: ",_120,";\" /> &#160;","<span id=\"sg-",a.widget,"-game-node-page-info-",_118,"\">",_122," - ",_123," &#160;of&#160; ",_11c,"</span>","&#160; <img id=\"sg-",a.widget,"-game-node-next-btn-",_118,"\"src=\""+SwitchGames.imageUrl+"common/buttons/btn-pagination-right.png\" class=\"sg-search-page-next-btn\" style=\"cursor: pointer; display: ",_11f,";\" />","<span id=\"sg-",a.widget,"-game-node-trade-filter-",_118,"\" style=\"margin-left: 20px; display: ",_11d,"\"><input class=\"sg-search-fortrade-filter\" type=\"checkbox\" />&#160;For Trade</span>","<span id=\"sg-",a.widget,"-game-node-sale-filter-",_118,"\" style=\"margin-left: 15px; display: ",_11d,"\"><input class=\"sg-search-forsale-filter\" type=\"checkbox\" />&#160;For Sale</span>","<span id=\"sg-",a.widget,"-game-node-safetrade-filter-",_118,"\" style=\"margin-left: 15px; margin-right: 15px; display: ",_11d,"\"><input class=\"sg-search-safetrade-filter\" type=\"checkbox\" />&#160;SafeTrade only</span>","</div>","</div>","</div>","</li>","</ul>","</li>"];
if(_113!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){
this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(""));
}else{
this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_112,buf.join(""));
}
this.elNode=this.wrap.childNodes[0];
this.ctNode=this.wrap.childNodes[1];
var cs=this.elNode.childNodes;
this.indentNode=cs[0];
this.ecNode=cs[1];
this.iconNode=cs[2];
this.anchor=cs[3];
this.textNode=cs[3].firstChild;
}});
Ext.tree.WishlistGameNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(n,a,_134,_135){
this.indentMarkup="";
var t=n.getOwnerTree();
var bw=t.borderWidth;
var _138;
var _139,_13a;
if(a.type=="game"){
_138=["<div class=\"sg-game-panel-text sg-game-panel-title-text\">"+Ext.util.Format.ellipsis(a.game_name,50)+"</div>","<div style=\"padding-top: 5px;\" class=\"sg-game-panel-text sg-game-panel-platform-text\">"+SwitchGames.Utility.createStringValue(a.platform_name)+"</div>","<div>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">Released:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">"+SwitchGames.Utility.createStringValue(a.date_released),"</span>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">Publisher:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">",SwitchGames.Utility.createStringValue(a.publisher),"</span>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">ESRB:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">"+SwitchGames.Utility.createStringValue(a.esrb),"</span>","</div>"];
_139=a.game_id;
_13a=a.game_name;
}else{
if(a.type=="platform"){
_138=["<div class=\"sg-game-panel-text sg-game-panel-title-text\">"+Ext.util.Format.ellipsis(a.platform_name,50)+"</div>","<div style=\"padding-top: 5px;\" class=\"sg-game-panel-text sg-game-panel-platform-text\">"+SwitchGames.Utility.createStringValue(a.manufacturer)+"</div>","<div>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">Released:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">"+a.date_released,"</span>","</div>"];
_139=a.platform_id;
_13a=a.platform_name;
}else{
if(a.type=="accessory"){
_138=["<div class=\"sg-game-panel-text sg-game-panel-title-text\">"+Ext.util.Format.ellipsis(a.accessory_name,50)+"</div>","<div style=\"padding-top: 5px;\" class=\"sg-game-panel-text sg-game-panel-platform-text\">"+SwitchGames.Utility.createStringValue(a.platform_name)+"</div>","<div>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">Released:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">"+a.date_released,"</span>","</div>"];
_139=a.accessory_id;
_13a=a.accessory_name;
}
}
}
var _13b="";
var _13c="Members who have this:";
if(a.widget=="search"){
_13b="<img name=\"game-node-addtowishlist\" ext:qtip=\"Add <b>"+decodeURIComponent(_13a)+"</b> to your wishlist\" ext:qwidth=\"300\" src=\""+SwitchGames.imageUrl+"common/buttons/add-to-wishlist-large.png\" >";
}else{
if(a.widget=="wishlist"){
_13b="<img name=\"game-node-removefromwishlist\" ext:qtip=\"Remove <b>"+decodeURIComponent(_13a)+"</b> from your wishlist\" ext:qwidth=\"300\" src=\""+SwitchGames.imageUrl+"common/buttons/remove-from-tradetools-list-large.png\" >";
}else{
if(a.widget=="mystuff"){
_13b="<img name=\"game-node-removefrommystuff\" ext:qtip=\"Remove <b>"+decodeURIComponent(_13a)+"</b> from your stuff\" ext:qwidth=\"300\" src=\""+SwitchGames.imageUrl+"common/buttons/remove-from-tradetools-list-large.png\" >";
_13c="Members who want this:";
}else{
_13b="<img name=\"game-node-addtowishlist\" ext:qtip=\"Add <b>"+decodeURIComponent(_13a)+"</b> to your wishlist\" ext:qwidth=\"300\" src=\""+SwitchGames.imageUrl+"common/buttons/add-to-wishlist-large.png\" >";
}
}
}
var buf=["<li class=\"x-tree-node sg-game-panel-cell\">","<div style=\"overflow: hidden; height: auto;\" ext:tree-node-id=\"",n.id,"\" class=\"x-tree-node-el sg-game-panel-row",(parseInt(a.index)%2==0?" sg-game-panel-row-even ":" sg-game-panel-row-odd "),a.cls,"\">","<div style=\"float: left; display: none;\">",this.indentMarkup,"</div>","<img style=\"float: left; display: none;\" src=\"",this.emptyIcon,"\">","<img style=\"float: left; display: none;\" src=\"",a.icon||this.emptyIcon,"\" class=\"",(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),"\" unselectable=\"on\">","<a hidefocus=\"on\" class=\"x-tree-node-anchor\">","<div style=\"padding-left: 40px; padding-top: 5px;\">","<div style=\"width: 86px; height: 100px; float: left; padding: 5px 10px; overflow: hidden !important;\">","<img itemid=\"",_139,"\" itemtype=\"",a.type,"\" onload=\"SwitchGames.Utility.scaleAndCenterImageInParent(this);\" src=\"",SwitchGames.Utility.getCoverValue(a.photo_cover),"\" class=\"has-detail\" style=\"width: 0px; height: 0px;\">","</div>","<div style=\"float: left;\">","<div class=\"sg-game-panel-text sg-game-panel-title-text\">"+Ext.util.Format.ellipsis(a.game_name,50)+"</div>","<div style=\"padding-top: 5px;\" class=\"sg-game-panel-text sg-game-panel-platform-text\">"+SwitchGames.Utility.createStringValue(a.platform_name)+"</div>","<div>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">Released:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">"+a.date_released,"</span>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">Publisher:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">",a.publisher,"</span>","<span class=\"sg-game-panel-text sg-game-panel-other-label\">ESRB:</span><span class=\"sg-game-panel-text sg-game-panel-other-value\">"+a.esrb,"</span>","</div>","<div class=\"sg-offer-panel-price sg-offer-panel-text-trade\">","<img transaction-type=\"trade\" ext:qwidth=\"200\" ext:qheight=\"150\" style=\"padding-right: 2px;\" src=\""+SwitchGames.imageUrl+"common/buttons/transactions-trade.png\"","ext:qtip=\"Trade for <b>"+a.game_name+"</b>\"",">","<br />","<b>FREE</b>","</div>","<div class=\"sg-offer-panel-price sg-offer-panel-text-safetrade\">","<img transaction-type=\"safetrade\" ext:qwidth=\"200\" ext:qheight=\"150\" style=\"padding-right: 6px;\" src=\""+SwitchGames.imageUrl+"common/buttons/transactions-safetrade.png\"","ext:qtip=\"SafeTrade guarantees full coverage in the event your game is lost or stolen in a trade.  $5.95 fee (only paid if your offer is accepted) includes a pre-paid USPS shipping label with free online package tracking.\"",">","<br />","<b>$5.95</b>","</div>","</div>","</div>","</a>","</div>","<ul class=\"x-tree-node-ct\" style=\"display:none;\">","<li>","<div id=\"sg-game-node-"+_139+"\" class=\"sg-search-panel-child-header\">","<div class=\"sg-search-panel-child-header-inner-left\">",_13c,"</div>","<div class=\"sg-search-panel-child-header-inner-right\">","</div>","</div>","</li>","</ul>","</li>"];
if(_135!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){
this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(""));
}else{
this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_134,buf.join(""));
}
this.elNode=this.wrap.childNodes[0];
this.ctNode=this.wrap.childNodes[1];
var cs=this.elNode.childNodes;
this.indentNode=cs[0];
this.ecNode=cs[1];
this.iconNode=cs[2];
this.anchor=cs[3];
this.textNode=cs[3].firstChild;
}});
Ext.tree.OfferNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(n,a,_141,_142){
if(a.total_count!=null){
n.parentNode.attributes.total_count=a.total_count;
n.parentNode.attributes.page_count=a.page_count;
n.parentNode.attributes.page_start=a.page_start;
n.parentNode.fireEvent("afterchildrenrendered",n.parentNode);
}
var _143=n.parentNode.childNodes.indexOf(n);
this.indentMarkup="";
var t=n.getOwnerTree();
var bw=t.borderWidth;
var _146=[];
var _147,_148;
if(a.widget!="mystuff"){
if(a.type=="game"){
_146=["<span class=\"sg-offer-panel-text sg-offer-panel-game-name-text\">",SwitchGames.Utility.printTruncatedString(a.game_name,40),"</span>","<span class=\"sg-offer-panel-text sg-offer-panel-platform-name-text\">",SwitchGames.Utility.createStringValue(a.platform_name),"</span>"];
_147=a.game_id;
_148=a.game_name;
}else{
if(a.type=="platform"){
_146=["<span class=\"sg-offer-panel-text sg-offer-panel-game-name-text\">",SwitchGames.Utility.printTruncatedString(a.platform_name,40),"</span>","<span class=\"sg-offer-panel-text sg-offer-panel-platform-name-text\">",SwitchGames.Utility.createStringValue(a.manufacturer),"</span>"];
_147=a.platform_id;
_148=a.platform_name;
}else{
if(a.type=="accessory"){
_146=["<span class=\"sg-offer-panel-text sg-offer-panel-game-name-text\">",SwitchGames.Utility.printTruncatedString(a.accessory_name,40),"</span>","<span class=\"sg-offer-panel-text sg-offer-panel-platform-name-text\">",SwitchGames.Utility.createStringValue(a.manufacturer),"</span>"];
_147=a.accessory_id;
_148=a.accessory_name;
}
}
}
}
var _149=[];
var _14a=["buy","trade","safetrade"];
var _14b=[" ext:qtip=\"Buy this item now, you pay nothing for shipping. The price you see is what you pay!\" "," ext:qtip=\"Trade for this item\" "," ext:qtip=\"SafeTrade guarantees full coverage in the event your game is lost or stolen in a trade.  $5.95 fee (only paid if your offer is accepted) includes a pre-paid USPS shipping label with free online package tracking.\" "];
var _14c="<b><br/><br/>You must log in or register to use this feature.</b>";
var _14d=[" ext:qtip=\"Buy this item now."+_14c+"\" "," ext:qtip=\"Trade for this item."+_14c+"\" "," ext:qtip=\"SafeTrade guarantees full coverage in the event your game is lost or stolen in a trade.  $5.95 fee (only paid if your offer is accepted) includes a pre-paid USPS shipping label with free online package tracking."+_14c+"\" "];
if(parseFloat(a.price)>3&&a.for_sale=="1"&&a.verified_badge=="1"){
a["buy"]="$"+a.price+" </b>- FREE Shipping<b>";
}
if(a.for_trade=="1"){
a["safetrade"]="$5.95";
}
if(a.require_safetrade=="1"||a.for_trade!=1){
a["trade"]=null;
}
if(a.my_member_id!=a.member_id&&a.widget!="mystuff"){
for(var i=0,iLen=_14a.length;i<iLen;i++){
if(a[_14a[i]]){
_149.push("<div class=\"sg-offer-panel-price sg-offer-panel-text-"+_14a[i]+"\">","<img transaction-type=\"",_14a[i],"\" itemtype=\"",a.type,"\" ext:qwidth=\"200\" ext:qheight=\"150\" style=\"padding-right: 6px;\" src=\""+SwitchGames.imageUrl+"common/buttons/transactions-",_14a[i],".png\"",_14b[i],">","<br />","<b>",a[_14a[i]],"</b>","</div>");
}
}
}else{
_149=[];
}
var _150="sg-offer-panel-badge-tenure-"+a.tenure_badge;
var _151=SwitchGames.Utility.getTenureTooltip(a.tenure_badge);
var _152="sg-offer-panel-badge-transactions-"+a.transaction_badge;
var _153=SwitchGames.Utility.getTransactionTooltip(a.transaction_badge);
var _154="sg-offer-panel-badge-rating-"+a.ratings_star_badge;
var _155=SwitchGames.Utility.getRatingsStarTooltip(a.ratings_star_badge);
var _156="sg-offer-panel-badge-plus-member-"+a.plus_badge;
var _157=SwitchGames.Utility.getPlusTooltip(a.plus_badge);
var _158="sg-offer-panel-badge-verified-"+a.verified_badge;
var _159=" name=\"verified-badge\" verified=\""+a.verified_badge+"\" memberVerified=\""+a.member_verified+"\" ";
var _15a="sg-offer-panel-badge-philanthropy-"+a.philanthropy_badge;
var _15b=SwitchGames.Utility.getPhilanthropyTooltip(a.philanthropy_badge);
var _15c;
if(a.my_member_id==0){
_15c=["<a href=\""+SwitchGames.Utility.getGamerURL(a.screen_name)+"\" target=\"_blank\"><img name=\"offer-node-visitmembersite\" ext:qtip=\"Visit <b>",a.screen_name,"</b>'s site\" ext:qwidth=\"200\" ext:qheight=\"150\" src=\""+SwitchGames.imageUrl+"common/buttons/view-gamer-page-large.png\" alt=\"View Gamer Page\"></a>"].join("");
}else{
var _15d;
var _15e;
if(a.my_member_id==a.member_id){
_15d="";
_15e="";
}else{
if(a.isBuddy){
_15d="<img name=\"offer-node-removefrombuddylist\" ext:qtip=\"Remove <b>"+a.screen_name+"</b> from your buddy list\" ext:qwidth=\"200\" ext:qheight=\"150\" src=\""+SwitchGames.imageUrl+"common/buttons/remove-from-buddy-list-small.png\">";
}else{
_15d="<img name=\"offer-node-addtobuddylist\" ext:qtip=\"Add <b>"+a.screen_name+"</b> to your buddy list\" ext:qwidth=\"200\" ext:qheight=\"150\" src=\""+SwitchGames.imageUrl+"common/buttons/add-to-buddy-list-large.png\">";
}
_15e="<img name=\"offer-node-messagememberaboutlisting\" ext:qtip=\"Send a message to <b>"+a.screen_name+"</b> about this item\" ext:qwidth=\"200\" ext:qheight=\"150\" src=\""+SwitchGames.imageUrl+"common/buttons/message-user-large.png\">";
}
_15c=[_15d,_15e,"<a href=\""+SwitchGames.Utility.getGamerURL(a.screen_name)+"\" target=\"_blank\"><img name=\"offer-node-visitmembersite\" ext:qtip=\"Visit <b>",a.screen_name,"</b>'s site\" ext:qwidth=\"200\" ext:qheight=\"150\" src=\""+SwitchGames.imageUrl+"common/buttons/view-gamer-page-large.png\"></a>"].join("");
}
var buf=["<li class=\"x-tree-node sg-offer-panel-cell\" style=\"margin-bottom: 2px!important;\">","<div ext:tree-node-id=\"",n.id,"\" class=\"x-tree-node-el sg-offer-panel-row",(_143%2==0?" sg-offer-panel-row-even ":" sg-offer-panel-row-odd "),a.cls,"\">","<div style=\"float: left; width: 0px;\"></div>","<img style=\"float: left; ",(a.widget=="mystuff")?"width: 0px; height: 0px;":"","\" src=\"",this.emptyIcon,"\">","<img style=\"float: left;\" src=\"",a.icon||this.emptyIcon,"\" class=\"",(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),"\" unselectable=\"on\">","<div hidefocus=\"on\" class=\"x-tree-node-anchor\">","<div class=\"sg-offer-panel-cell-layout\">","<div class=\"sg-offer-panel-cell-avatar-wrapper\">","<a href=\"",SwitchGames.Utility.getGamerURL(a.screen_name),"\" target=\"_blank\"><img name=\"offer-node-visitmembersite\"",SwitchGames.Utility.getMemberSiteTooltip(a.screen_name)," style=\"cursor: pointer;\" src=\"",(a.avatar==null)?SwitchGames.imageUrl+"avatars/no_user_image.png":SwitchGames.Utility.getAvatarValue(a.avatar),"\" class=\"sg-offer-panel-image\" alt=\"Avatar Image\"/></a>","</div>","<div class=\"sg-offer-panel-left-side-content-wrapper\">","<div class=\"sg-offer-panel-ratings-wrapper\">","<div class=\"sg-offer-panel-ratings-wrapper-inner-top\">","<img src=\"",SwitchGames.imageUrl+"verified_member_display.png","\" style=\"visibility: ",a.verified_badge==1?"visible":"hidden","\" />","</div>","<div class=\"sg-offer-panel-ratings-wrapper-inner-middle\">","<span class=\"sg-offer-panel-ratings-pos\">","+",a.ratings_positive,"</span>","<span class=\"sg-offer-panel-ratings-neg\">","-",a.ratings_negative,"</span>","<span style=\"padding-left: 30px; color: #ffffff; font-size: 14px;\">State: ",a.member_state,"</span>","</div>","<div class=\"sg-offer-panel-ratings-wrapper-inner-bottom\">","<span class=\"sg-offer-panel-text sg-offer-panel-screen-name-text\">",a.screen_name,"</span>","</div>","</div>","<div class=\"sg-offer-panel-user-action-icon-wrapper\">",_15c,"</div>","<div class=\"sg-offer-panel-badge-wrapper\">","<div class=\"",_150,"\"",_151,"></div>","<div class=\"",_152,"\"",_153,"></div>","<div class=\"",_15a,"\"",_15b,"></div>","<br/>","<div class=\"",_154,"\"",_155,"></div>","<div class=\"",_156,"\"",_157,"></div>","<div class=\"",_158,"\"",_159,"></div>","</div>","<div class=\"sg-offer-panel-trade-area-wrapper\" >",_146.join(""),"<div>",_149.join(""),"</div>","</div>","</div>","</div>","</div>","</div>","<ul class=\"x-tree-node-ct\" style=\"display:none;\"></ul>","</li>"];
if(_142!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){
this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(""));
}else{
this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_141,buf.join(""));
}
this.elNode=this.wrap.childNodes[0];
this.ctNode=this.wrap.childNodes[1];
var cs=this.elNode.childNodes;
this.indentNode=cs[0];
this.ecNode=cs[1];
this.iconNode=cs[2];
this.anchor=cs[3];
this.textNode=cs[3].firstChild;
},onClick:function(e){
return;
}});
Ext.tree.EmptyOfferNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(n,a,_164,_165){
var _166=a.loader.baseParams.id;
var _167=a.loader.baseParams.querywidget;
Ext.get("sg-"+_167+"-game-node-page-info-"+_166).setStyle("display","none");
Ext.get("sg-"+_167+"-game-node-prev-btn-"+_166).setStyle("display","none");
Ext.get("sg-"+_167+"-game-node-next-btn-"+_166).setStyle("display","none");
this.indentMarkup="";
var t=n.getOwnerTree();
var bw=t.borderWidth;
var buf=["<li class=\"x-tree-node sg-offer-panel-cell\" style=\"margin-bottom: 2px!important;\">","<div ext:tree-node-id=\"",n.id,"\" class=\"x-tree-node-el sg-offer-panel-row",(parseInt(a.index)%2==0?" sg-offer-panel-row-even ":" sg-offer-panel-row-odd "),a.cls,"\">","<div style=\"float: left; width: 0px;\"></div>","<img style=\"float: left;\" src=\"",this.emptyIcon,"\">","<img style=\"float: left;\" src=\"",a.icon||this.emptyIcon,"\" class=\"",(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),"\" unselectable=\"on\">","<a hidefocus=\"on\" class=\"x-tree-node-anchor\">","<div style=\"font-size: 18px; color: #fff; width: 807px; height: 59px; display: table-cell; vertical-align: middle; text-align: center\" class=\"sg-offer-panel-cell-layout\">","No Listings Found","</div>","</a>","</div>","<ul class=\"x-tree-node-ct\" style=\"display:none;\"></ul>","</li>"];
if(_165!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){
this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(""));
}else{
this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_164,buf.join(""));
}
this.elNode=this.wrap.childNodes[0];
this.ctNode=this.wrap.childNodes[1];
var cs=this.elNode.childNodes;
this.indentNode=cs[0];
this.ecNode=cs[1];
this.iconNode=cs[2];
this.anchor=cs[3];
this.textNode=cs[3].firstChild;
}});
Ext.tree.InfoNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(n,a,_16e,_16f){
this.indentMarkup="";
var t=n.getOwnerTree();
var bw=t.borderWidth;
var i,j,iLen,jLen;
var _176=new Ext.XTemplate("<span class=\"sg-info-panel-item-recent-feedback-date\">{[SwitchGames.Utility.createVisibleDate(values.date_rated)]}</span>","<span class=\"sg-info-panel-item-recent-feedback-rating {[values.rating == 0 ?\" sg-info-panel-item-recent-feedback-negative\":\" sg-info-panel-item-recent-feedback-positive\"]}\">{[values.rating == 0 ? \"Negative\" : \"Positive\"]}</span>","<div class=\"sg-info-panel-item-recent-feedback-content\">{[Ext.util.Format.ellipsis(SwitchGames.Utility.createStringValue(values.comment, \"No comment provided by \" + values.giving_member_name), 180)]}","</div>","<span class=\"sg-info-panel-item-recent-feedback-content-user-name\">&nbsp; &nbsp; - {giving_member_name}</span>");
var _177=new Ext.XTemplate("<div style=\"font-size: 14px; font-weight: normal; color: #ffffff; padding-top: 36px; text-align: center;\">No Ratings Found</div>");
var _178=n.parentNode.attributes.index;
var _179={};
var _17a=["item_details","recent_feedback","member_profile"];
var _17b=["<dl class=\"sg-info-panel-item-details-body-list\">","<div>","<dl class=\"sg-info-panel-item-member-profile-stats\">"];
var _17c=["<dl style=\"display: none;\" class=\"sg-info-panel-item-details-body-list\">","<div style=\"display: none;\">","<dl style=\"display: none;\" class=\"sg-info-panel-item-member-profile-stats\">"];
var _17d=["</dl>","</div>","</dl>"];
for(j=0,jLen=_17a.length;j<jLen;j++){
_179[_17a[j]]={};
var _17e=_179[_17a[j]];
var _17f=[];
var _180=0;
if(a[_17a[j]]){
var _181=a[_17a[j]];
if(_181.length==0&&_17a[j]=="recent_feedback"){
_17f.push(_177.apply({}));
_17e.totalPanels=1;
_17e.parentTags=" currentPanel=\"0\" totalPanels=\""+_17e.totalPanels+"\" ";
_17e.html=_17f.join("");
continue;
}
if(_17a[j]=="item_details"||_17a[j]=="member_profile"){
_17e.totalPanels=Math.floor((_181.length/5)+1);
}else{
_17e.totalPanels=_181.length;
}
for(i=0,iLen=_181.length;i<iLen;i++){
if(_17a[j]=="item_details"||_17a[j]=="member_profile"){
if(i%5==0){
if(i>0){
_17f.push(_17d[j]);
_17f.push(_17c[j]);
}else{
_17f.push(_17b[j]);
}
}
}else{
if(i>0){
_17f.push(_17d[j]);
_17f.push(_17c[j]);
}else{
_17f.push(_17b[j]);
}
}
if(_17a[j]=="item_details"){
_17f.push("<dt>",Ext.util.Format.ellipsis(_181[i],35),"</dt>");
}else{
if(_17a[j]=="recent_feedback"){
_17f.push(_176.apply(_181[i]));
}else{
if(_17a[j]=="member_profile"){
var keys=[];
var _183=[];
for(key in _181[i]){
keys.push(key);
if(key=="Member Since"||key=="Last Login"){
_183.push(SwitchGames.Utility.createVisibleDate(_181[i][key]));
}else{
_183.push(_181[i][key]);
}
}
_17f.push("<dt><span>");
_17f.push(keys[0]);
_17f.push(":&nbsp;</span>");
_17f.push(_183[0]);
_17f.push("</dt>");
}
}
}
}
_17f.push(_17d[j]);
}else{
_17f.push(_17b[j],_17d[j]);
_17e.totalPanels=0;
}
_17e.parentTags=" currentPanel=\"0\" totalPanels=\""+_17e.totalPanels+"\" ";
_17e.html=_17f.join("");
}
var buf=["<li style=\"clear: both;\" class=\"x-tree-node sg-info-panel-cell \" style=\"margin-bottom: 0px;\">","<div style=\"clear: both; height: 150px;\" ext:tree-node-id=\"",n.id,"\" class=\"x-tree-node-el sg-offer-panel-row",(parseInt(_178)%2==0?" sg-offer-panel-row-even ":" sg-offer-panel-row-odd  "),a.cls,"\">","<div style=\"float: left; width: 0px; height: 0px;\" class=\"x-tree-node-indent\">",this.indentMarkup,"</div>","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",this.emptyIcon,"\">","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",a.icon||this.emptyIcon,"\" class=\"",(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),"\" unselectable=\"on\">","<a hidefocus=\"on\" class=\"x-tree-node-anchor\">","<div class=\"sg-info-panel-cell-content-wrapper\">","<div class=\"sg-info-panel-item-details-wrapper\">","<div class=\"sg-info-panel-item-details-header\"><div class=\"sg-info-panel-item-details-header-inner\"> Item Details</div></div>","<div class=\"sg-info-panel-item-details-body\">","<div class=\"sg-info-panel-item-details-body-inner sg-info-panel-parent\"",_179.item_details.parentTags,">","<img src=\""+SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-left-small.png\" style=\"left: -8px; top: 33px;\" class=\"sg-info-panel-scrollbtn-left\"/>","<img src=\""+SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-right-small.png\" style=\"left: 193px; top: 33px;\" class=\"sg-info-panel-scrollbtn-right\"/>",_179.item_details.html,"</div>","</div>","<div class=\"sg-info-panel-item-details-footer\">","<div class=\"sg-info-panel-item-details-footer-inner\">","</div>","</div>","</div>","<div class=\"sg-info-panel-item-recent-feedback-wrapper\">","<div class=\"sg-info-panel-item-recent-feedback-header\"><div class=\"sg-info-panel-item-recent-feedback-header-inner\">Recent Ratings</div></div>","<div class=\"sg-info-panel-item-recent-feedback-body\">","<div class=\"sg-info-panel-item-recent-feedback-body-inner sg-info-panel-parent\"",_179.recent_feedback.parentTags,">","<img src=\""+SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-left-small.png\" style=\"left: -8px; top: 65px;\" class=\"sg-info-panel-scrollbtn-left\"/>","<img src=\""+SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-right-small.png\" style=\"left: 310px; top: 65px;\" class=\"sg-info-panel-scrollbtn-right\"/>",_179.recent_feedback.html,"</div>","</div>","<div class=\"sg-info-panel-item-recent-feedback-footer\">","<div class=\"sg-info-panel-item-recent-feedback-footer-inner\"></div>","</div>","</div>","<div class=\"sg-info-panel-item-member-profile-wrapper\">","<div class=\"sg-info-panel-item-member-profile-header\"><div class=\"sg-info-panel-item-member-profile-header-inner\">Member Profile</div></div>","<div class=\"sg-info-panel-item-member-profile-body\"><div class=\"sg-info-panel-item-member-profile-body-inner sg-info-panel-parent\"",_179.member_profile.parentTags,">",_179.member_profile.html,"</div></div>","<div class=\"sg-info-panel-item-member-profile-footer\"><div class=\"sg-info-panel-item-member-profile-footer-inner\"></div></div>","</div>","</div>","</a>","</div>","<ul class=\"x-tree-node-ct\" style=\"display:none;\"></ul>","</li>"];
if(_16f!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){
this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(""));
}else{
this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_16e,buf.join(""));
}
this.elNode=this.wrap.childNodes[0];
this.ctNode=this.wrap.childNodes[1];
var cs=this.elNode.childNodes;
this.indentNode=cs[0];
this.ecNode=cs[1];
this.iconNode=cs[2];
this.anchor=cs[3];
this.textNode=cs[3].firstChild;
var _186=Ext.select(".sg-info-panel-scrollbtn-left",true,this.textNode);
_186.setVisible(false,false);
var _187=Ext.select(".sg-info-panel-scrollbtn-right",true,this.textNode);
if(_179.item_details.totalPanels<2){
_187.elements[0].setVisible(false,false);
}
if(_179.recent_feedback.totalPanels<2){
_187.elements[1].setVisible(false,false);
}
if(_179.member_profile.totalPanels<2){
_187.elements[2].setVisible(false,false);
}
}});
Ext.tree.SwitchbotGameUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(n,a,_18a,_18b){
this.indentMarkup="";
var t=n.getOwnerTree();
var bw=t.borderWidth;
var _18e=n.parentNode.attributes.index;
var buf=["<li style=\"clear: both;\" class=\"x-tree-node sg-offer-panel-cell \" style=\"margin-bottom: 0px;\">","<div style=\"clear: both; height: 76px;\" ext:tree-node-id=\"",n.id,"\" class=\"x-tree-node-el sg-offer-panel-row",(parseInt(a.index)%2==0?" sg-offer-panel-row-even ":" sg-offer-panel-row-odd  "),a.cls,"\">","<div style=\"float: left; width: 0px;\"></div>","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",this.emptyIcon,"\">","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",a.icon||this.emptyIcon,"\" class=\"",(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),"\" unselectable=\"on\">","<a style=\"float: left; width: 850px;\" hidefocus=\"on\" class=\"x-tree-node-anchor\">","<div class=\"sg-sb-game\">","<div class=\"sg-sb-game-image-wrapper\">","<img onload=\"SwitchGames.Utility.scaleAndCenterImageInParent(this);\" src=\"",SwitchGames.Utility.getCoverValue(a.photo_cover),"\" alt=\"Game Box\"/>","</div>","<div class=\"sg-sb-game-text-wrapper\">","<div class=\"sg-sb-game-name-text\">",SwitchGames.Utility.createStringValue(a.game_name),"</div>","<div class=\"sg-sb-game-platform-text\">",SwitchGames.Utility.createStringValue(a.platform_name),"</div>","<div class=\"sg-sb-game-other-text\">Released: ",a.date_released,"&nbsp;Publisher: ",SwitchGames.Utility.createStringValue(a.publisher),"&nbsp; ESRB: ",SwitchGames.Utility.createStringValue(a.esrb),"</div>","</div>","</div>","</a>","</div>","<ul class=\"x-tree-node-ct\" style=\"display:none;\"></ul>","</li>"];
if(_18b!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){
this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(""));
}else{
this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_18a,buf.join(""));
}
this.elNode=this.wrap.childNodes[0];
this.ctNode=this.wrap.childNodes[1];
var cs=this.elNode.childNodes;
this.indentNode=cs[0];
this.ecNode=cs[1];
this.iconNode=cs[2];
this.anchor=cs[3];
this.textNode=cs[3].firstChild;
}});
Ext.tree.SwitchbotListingDetailUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(n,a,_193,_194){
this.indentMarkup="";
var t=n.getOwnerTree();
var bw=t.borderWidth;
var _197=n.parentNode.attributes.index;
var _198;
var _199;
var _19a;
var _19b=a.require_safetrade?"":"<img transaction-type=\"switchbottrade\" style=\"padding-top: 20px;\" name=\"sb-tradeoffer\" src=\""+SwitchGames.imageUrl+"common/buttons/make-this-trade-offer.png\" ><br/>";
if(a.is_buddy){
_199="<img name=\"offer-node-removefrombuddylist\" ext:qtip=\"Remove <b>"+a.screen_name+"</b> from your buddy list\" ext:qwidth=\"200\" ext:qheight=\"150\" src=\""+SwitchGames.imageUrl+"common/buttons/remove-from-buddy-list-small.png\">";
}else{
_199="<img name=\"offer-node-addtobuddylist\" ext:qtip=\"Add <b>"+a.screen_name+"</b> to your buddy list\" ext:qwidth=\"200\" ext:qheight=\"150\" src=\""+SwitchGames.imageUrl+"common/buttons/add-to-buddy-list-large.png\">";
}
_19a="<img name=\"offer-node-messagememberaboutlisting\" ext:qtip=\"Send a message to <b>"+a.screen_name+"</b> about this item\" ext:qwidth=\"200\" ext:qheight=\"150\" src=\""+SwitchGames.imageUrl+"common/buttons/message-user-large.png\">";
_198=[_199,_19a,"<a href=\""+SwitchGames.Utility.getGamerURL(a.screen_name)+"\" target=\"_blank\"><img name=\"offer-node-visitmembersite\" ext:qtip=\"Visit <b>",a.screen_name,"</b>'s site\" ext:qwidth=\"200\" ext:qheight=\"150\" src=\""+SwitchGames.imageUrl+"common/buttons/view-gamer-page-large.png\"></a>"].join("");
var _19c={};
var _19d=["item_details"];
var _19e=["<dl class=\"sg-info-panel-item-details-body-list\">"];
var _19f=["<dl style=\"display: none;\" class=\"sg-info-panel-item-details-body-list\">"];
var _1a0=["</dl>"];
var _1a1=[];
switch(a.condition){
case "1":
_1a1.push("Perfect Condition");
break;
case "2":
_1a1.push("Very Good Condition");
break;
case "3":
_1a1.push("Good Condition");
break;
case "4":
_1a1.push("Bad Condition");
break;
default:
_1a1.push("Unknown Condition");
break;
}
if(a.brand_new==1){
_1a1.push("Brand New");
}else{
_1a1.push("Used");
}
if(a.scratches==1){
_1a1.push("Has Scratches");
}else{
_1a1.push("No Scratches");
}
if(a.original_box==1){
_1a1.push("Has Original Packaging");
}else{
_1a1.push("No Original Packaging");
}
a.item_details=_1a1;
for(j=0,jLen=_19d.length;j<jLen;j++){
_19c[_19d[j]]={};
var _1a2=_19c[_19d[j]];
var _1a3=[];
var _1a4=0;
if(a[_19d[j]]){
var _1a5=a[_19d[j]];
if(_19d[j]=="item_details"){
_1a2.totalPanels=Math.floor(((_1a5.length-1)/4)+1);
}else{
_1a2.totalPanels=_1a5.length;
}
for(i=0,iLen=_1a5.length;i<iLen;i++){
if(_19d[j]=="item_details"){
if(i%4==0){
if(i>0){
_1a3.push(_1a0[j]);
_1a3.push(_19f[j]);
}else{
_1a3.push(_19e[j]);
}
}
}else{
if(i>0){
_1a3.push(_1a0[j]);
_1a3.push(_19f[j]);
}else{
_1a3.push(_19e[j]);
}
}
if(_19d[j]=="item_details"){
_1a3.push("<dt>",Ext.util.Format.ellipsis(_1a5[i],35),"</dt>");
}
}
_1a3.push(_1a0[j]);
}else{
_1a3.push(_19e[j],_1a0[j]);
_1a2.totalPanels=0;
}
_1a2.parentTags=" currentPanel=\"0\" totalPanels=\""+_1a2.totalPanels+"\" ";
_1a2.html=_1a3.join("");
}
var buf=["<li style=\"clear: both;\" class=\"x-tree-node sg-sb-detail-panel \" style=\"margin-bottom: 0px;\">","<div style=\"clear: both; height: 130px;\" ext:tree-node-id=\"",n.id,"\" class=\"x-tree-node-el sg-offer-panel-row",(parseInt(_197)%2==0?" sg-offer-panel-row-even ":" sg-offer-panel-row-odd  "),a.cls,"\">","<div style=\"float: left; width: 0px; height: 0px;\" class=\"x-tree-node-indent\">",this.indentMarkup,"</div>","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",this.emptyIcon,"\">","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",a.icon||this.emptyIcon,"\" class=\"",(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),"\" unselectable=\"on\">","<div hidefocus=\"on\" class=\"x-tree-node-anchor\">","<div class=\"sg-sb-detail-content-wrapper\">","<div class=\"sg-sb-detail-item-details-wrapper\">","<div class=\"sg-sb-detail-item-details-header\"><div class=\"sg-sb-detail-item-details-header-inner\"> Item Details</div></div>","<div class=\"sg-sb-detail-item-details-body\">","<div class=\"sg-sb-detail-item-details-body-inner sg-info-panel-parent\"",_19c.item_details.parentTags,">","<img src=\""+SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-left-small.png\" style=\"left: -8px; top: 33px;\" class=\"sg-info-panel-scrollbtn-left\"/>","<img src=\""+SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-right-small.png\" style=\"left: 193px; top: 33px;\" class=\"sg-info-panel-scrollbtn-right\"/>",_19c.item_details.html,"</div>","</div>","<div class=\"sg-sb-detail-item-details-footer\">","<div class=\"sg-sb-detail-item-details-footer-inner\">","</div>","</div>","</div>","<div class=\"sg-sb-detail-member-wrapper\">","<div class=\"sg-sb-detail-member-header\"><div class=\"sg-sb-detail-member-header-inner\">Owned By</div></div>","<div class=\"sg-sb-detail-member-body\">","<div class=\"sg-sb-detail-member-body-inner sg-info-panel-parent\">","<div class=\"sg-sb-game-image-wrapper\">","<a href=\"",SwitchGames.Utility.getGamerURL(a.screen_name),"\" target=\"_blank\"><img name=\"offer-node-visitmembersite\"",SwitchGames.Utility.getMemberSiteTooltip(a.screen_name)," style=\"cursor: pointer;\" onload=\"SwitchGames.Utility.scaleAndCenterImageInParent(this, this.parentNode.parentNode);\" src=\"",SwitchGames.Utility.getAvatarValue(a.avatar),"\" alt=\"Member Avatar\"/></a>","</div>","<div class=\"sg-sb-detail-member-text-wrapper\">","<div class=\"sg-sb-detail-member-content\">","<span class=\"sg-sb-detail-member-rating sg-sb-detail-member-positive\">+",a.ratings_positive,"</span>","&nbsp;&nbsp;&nbsp;","<span class=\"sg-sb-detail-member-rating sg-sb-detail-member-negative\">-",a.ratings_negative,"</span>","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;","<span font-size: 14px; style=\"color: #ffffff;\">State: ",a.member_state,"</span>","</div>","<div class=\"sg-sb-detail-member-content\">","<span class=\"sg-sb-detail-member-date sg-sb-detail-member-date-label\">Member Since: </span>","<span class=\"sg-sb-detail-member-date\">",SwitchGames.Utility.createVisibleDate(a.date_signup),"</span>","&nbsp;&nbsp;","<span class=\"sg-sb-detail-member-date sg-sb-detail-member-date-label\">Last Login: </span>","<span class=\"sg-sb-detail-member-date\">",SwitchGames.Utility.createVisibleDate(a.date_last_login),"</span>","</div>","<div class=\"sg-sb-detail-member-content\" style=\"padding-top: 3px;\">","<div class=\"sg-sb-detail-member-user-name-wrapper\">","<div class=\"sg-sb-detail-member-user-name\">",a.screen_name,"</div>","</div>","<div style=\"float: right;\">",_198,"</div>","</div>","</div>","</div>","</div>","<div class=\"sg-sb-detail-member-footer\">","<div class=\"sg-sb-detail-member-footer-inner\"></div>","</div>","</div>","<div class=\"sg-sb-detail-button-wrapper\">",_19b,"<img transaction-type=\"switchbotsafetrade\" style=\"padding-top: 5px;\" name=\"sb-safetradeoffer\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-switchbot-make-safetrade.png\" ext:qwidth=\"200\" ext:qheight=\"150\" ext:qtip=\"SafeTrade guarantees full coverage in the event your game is lost or stolen in a trade.  $5.95 fee (only paid if your offer is accepted) includes a pre-paid USPS shipping label with free online package tracking.\">","</div>","</div>","</div>","</div>","<ul class=\"x-tree-node-ct\" style=\"display:none;\"></ul>","</li>"];
if(_194!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){
this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(""));
}else{
this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_193,buf.join(""));
}
this.elNode=this.wrap.childNodes[0];
this.ctNode=this.wrap.childNodes[1];
var cs=this.elNode.childNodes;
this.indentNode=cs[0];
this.ecNode=cs[1];
this.iconNode=cs[2];
this.anchor=cs[3];
this.textNode=cs[3].firstChild;
var _1a8=Ext.select(".sg-info-panel-scrollbtn-left",true,this.textNode);
_1a8.setVisible(false,false);
var _1a9=Ext.select(".sg-info-panel-scrollbtn-right",true,this.textNode);
if(_19c.item_details.totalPanels<2){
_1a9.elements[0].setVisible(false,false);
}
}});
Ext.tree.ErrorNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(n,a,_1ac,_1ad){
this.indentMarkup="";
var t=n.getOwnerTree();
var bw=t.borderWidth;
var _1b0=n.parentNode.attributes.index;
var buf=["<li style=\"clear: both;\" class=\"x-tree-node sg-offer-panel-cell \" style=\"margin-bottom: 0px;\">","<div style=\"clear: both; height: 150px;\" ext:tree-node-id=\"",n.id,"\" class=\"x-tree-node-el sg-offer-panel-row",(parseInt(_1b0)%2==0?" sg-offer-panel-row-even ":" sg-offer-panel-row-odd  "),a.cls,"\">","<div style=\"float: left; width: 0px; height: 0px;\" class=\"x-tree-node-indent\">",this.indentMarkup,"</div>","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",this.emptyIcon,"\">","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",a.icon||this.emptyIcon,"\" class=\"",(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),"\" unselectable=\"on\">","<a hidefocus=\"on\" class=\"x-tree-node-anchor\">","<div class=\"sg-offer-panel-cell-layout\">","<div class=\"sg-offer-panel-cell-avatar-wrapper\">","Error from backend","</div>","</div>","</a>","</div>","<ul class=\"x-tree-node-ct\" style=\"display:none;\"></ul>","</li>"];
if(_1ad!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){
this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(""));
}else{
this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_1ac,buf.join(""));
}
this.elNode=this.wrap.childNodes[0];
this.ctNode=this.wrap.childNodes[1];
var cs=this.elNode.childNodes;
this.indentNode=cs[0];
this.ecNode=cs[1];
this.iconNode=cs[2];
this.anchor=cs[3];
this.textNode=cs[3].firstChild;
}});
Ext.tree.EmptySwitchbotNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(n,a,_1b5,_1b6){
this.indentMarkup="";
var t=n.getOwnerTree();
var bw=t.borderWidth;
var _1b9=n.parentNode.attributes.index;
var buf=["<li style=\"clear: both;\" class=\"x-tree-node sg-offer-panel-cell \" style=\"margin-bottom: 0px;\">","<div style=\"clear: both; background-color: #000000; height: 505px;\" ext:tree-node-id=\"",n.id,"\" class=\"x-tree-node-el ",a.cls,"\">","<div style=\"float: left; width: 0px; height: 0px;\" class=\"x-tree-node-indent\">",this.indentMarkup,"</div>","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",this.emptyIcon,"\">","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",a.icon||this.emptyIcon,"\" class=\"",(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),"\" unselectable=\"on\">","<a hidefocus=\"on\" class=\"x-tree-node-anchor\">","<div style=\"height: 505px; color: #ffffff; font-size: 16px; text-align: center;\">","<div style=\"padding-top: 236px;\">","SwitchBot says there are no perfect trade matches for you right now.  Head on over to","</div>","<div style=\"padding: 0px;\">","<span onclick=\"SwitchGames.TradeTools.tabs.activate(SwitchGames.TradeTools.tabs.getItem('wl-panel'));\" style=\"color: #5eaa3c; cursor: pointer; font-weight: bold;\">Wishlist</span>"," to add the games you want and ","<span onclick=\"SwitchGames.TradeTools.tabs.activate(SwitchGames.TradeTools.tabs.getItem('ms-panel'));\" style=\"color: #5eaa3c; cursor: pointer; font-weight: bold;\">My Stuff</span>"," to add stuff you want to trade.","</div>","</div>","</a>","</div>","<ul class=\"x-tree-node-ct\" style=\"display:none;\"></ul>","</li>"];
if(_1b6!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){
this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(""));
}else{
this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_1b5,buf.join(""));
}
this.elNode=this.wrap.childNodes[0];
this.ctNode=this.wrap.childNodes[1];
var cs=this.elNode.childNodes;
this.indentNode=cs[0];
this.ecNode=cs[1];
this.iconNode=cs[2];
this.anchor=cs[3];
this.textNode=cs[3].firstChild;
}});
Ext.tree.EmptyMyStuffNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(n,a,_1be,_1bf){
this.indentMarkup="";
var t=n.getOwnerTree();
var bw=t.borderWidth;
var _1c2=n.parentNode.attributes.index;
var buf=["<li style=\"clear: both;\" class=\"x-tree-node sg-offer-panel-cell \" style=\"margin-bottom: 0px;\">","<div style=\"clear: both; background-color: #000000; height: 444px;\" ext:tree-node-id=\"",n.id,"\" class=\"x-tree-node-el ",a.cls,"\">","<div style=\"float: left; width: 0px; height: 0px;\" class=\"x-tree-node-indent\">",this.indentMarkup,"</div>","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",this.emptyIcon,"\">","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",a.icon||this.emptyIcon,"\" class=\"",(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),"\" unselectable=\"on\">","<a hidefocus=\"on\" class=\"x-tree-node-anchor\">","<div style=\"height: 444px; color: #ffffff; font-size: 16px; text-align: center;\">","<div style=\"padding-top: 236px;\">","You currently have no items listed.  If you add some items,","</div>","<div style=\"padding: 0px;\">","other members can trade with you.","</div>","</div>","</a>","</div>","<ul class=\"x-tree-node-ct\" style=\"display:none;\"></ul>","</li>"];
if(_1bf!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){
this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(""));
}else{
this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_1be,buf.join(""));
}
this.elNode=this.wrap.childNodes[0];
this.ctNode=this.wrap.childNodes[1];
var cs=this.elNode.childNodes;
this.indentNode=cs[0];
this.ecNode=cs[1];
this.iconNode=cs[2];
this.anchor=cs[3];
this.textNode=cs[3].firstChild;
}});
Ext.tree.EmptyWishlistNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(n,a,_1c7,_1c8){
this.indentMarkup="";
var t=n.getOwnerTree();
var bw=t.borderWidth;
var _1cb=n.parentNode.attributes.index;
var buf=["<li style=\"clear: both;\" class=\"x-tree-node sg-offer-panel-cell \" style=\"margin-bottom: 0px;\">","<div style=\"clear: both; background-color: #000000; height: 444px;\" ext:tree-node-id=\"",n.id,"\" class=\"x-tree-node-el ",a.cls,"\">","<div style=\"float: left; width: 0px; height: 0px;\" class=\"x-tree-node-indent\">",this.indentMarkup,"</div>","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",this.emptyIcon,"\">","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",a.icon||this.emptyIcon,"\" class=\"",(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),"\" unselectable=\"on\">","<a hidefocus=\"on\" class=\"x-tree-node-anchor\">","<div style=\"height: 444px; color: #ffffff; font-size: 16px; text-align: center;\">","<div style=\"padding-top: 236px;\">","You currently have no wishlist items.  By adding items to your wishlist,","</div>","<div style=\"padding: 0px;\">","SwitchBot can help you automatically find trades.","</div>","</div>","</a>","</div>","<ul class=\"x-tree-node-ct\" style=\"display:none;\"></ul>","</li>"];
if(_1c8!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){
this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(""));
}else{
this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_1c7,buf.join(""));
}
this.elNode=this.wrap.childNodes[0];
this.ctNode=this.wrap.childNodes[1];
var cs=this.elNode.childNodes;
this.indentNode=cs[0];
this.ecNode=cs[1];
this.iconNode=cs[2];
this.anchor=cs[3];
this.textNode=cs[3].firstChild;
}});
Ext.tree.EmptyGameNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(n,a,_1d0,_1d1){
this.indentMarkup="";
var t=n.getOwnerTree();
var bw=t.borderWidth;
var _1d4=n.parentNode.attributes.index;
var buf=["<li style=\"clear: both;\" class=\"x-tree-node sg-offer-panel-cell \" style=\"margin-bottom: 0px;\">","<div style=\"clear: both; background-color: #000000; height: 210px;\" ext:tree-node-id=\"",n.id,"\" class=\"x-tree-node-el ",a.cls,"\">","<div style=\"float: left; width: 0px; height: 0px;\" class=\"x-tree-node-indent\">",this.indentMarkup,"</div>","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",this.emptyIcon,"\">","<img style=\"float: left; width: 0px; height: 0px;\" src=\"",a.icon||this.emptyIcon,"\" class=\"",(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),"\" unselectable=\"on\">","<a hidefocus=\"on\" class=\"x-tree-node-anchor\">","<div style=\"height: 200px; color: #ffffff; font-size: 26px; text-align: center;\">","<div style=\"padding-top: 136px; font-weight: bold;\">","No results found.","</div>","</div>","</a>","</div>","<ul class=\"x-tree-node-ct\" style=\"display:none;\"></ul>","</li>"];
if(_1d1!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){
this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(""));
}else{
this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_1d0,buf.join(""));
}
this.elNode=this.wrap.childNodes[0];
this.ctNode=this.wrap.childNodes[1];
var cs=this.elNode.childNodes;
this.indentNode=cs[0];
this.ecNode=cs[1];
this.iconNode=cs[2];
this.anchor=cs[3];
this.textNode=cs[3].firstChild;
}});
});
String.prototype.br2nl=function(){
return this.replace(/<br\s*\/?>/mg,"\n");
};
String.prototype.nl2br=function(){
return this.replace(/([^>]?)\n/g,"$1<br />\n");
};
String.prototype.trim=function(){
return this.replace(/^\s+|\s+$/g,"");
};
Array.prototype.shuffle=function(){
function _1d7(){
return (Math.round(Math.random())-0.5);
};
this.sort(_1d7);
};
replaceDefault=function(_1d8,_1d9){
if(_1d8.value==_1d9){
_1d8.value="";
}
_1d8.style.color="#000000";
_1d8.onblur=function(){
if(""==_1d8.value){
_1d8.style.color="#868C71";
_1d8.value=_1d9;
}
};
};
if(!window.SwitchGames){
window.SwitchGames={};
}
if(!SwitchGames.Utility){
SwitchGames.Utility={};
}
if(window.location.hostname=="www.switchgames.com"||window.location.hostname=="switchgames.com"||window.location.hostname.match("thegamersmarketplace")!=null){
SwitchGames.flaUrl="http://cdnec.switchgames.com/fla/";
SwitchGames.imageUrl="http://cdnec.switchgames.com/images/";
SwitchGames.jsonUrl="http://cdnec.switchgames.com/json/";
SwitchGames.scriptUrl="http://cdnec.switchgames.com/js/";
}else{
if(window.location.hostname=="beta.switchgames.com"){
SwitchGames.flaUrl="fla/";
SwitchGames.imageUrl="http://cdnec.switchgames.com/images/";
SwitchGames.jsonUrl="json/";
SwitchGames.scriptUrl="js/";
}else{
SwitchGames.flaUrl="fla/";
SwitchGames.imageUrl="http://cdnec.switchgames.com/images/";
if(window.location.hostname=="dev.switchgames.com"){
SwitchGames.imageUrl="images/";
}
SwitchGames.jsonUrl="json/";
SwitchGames.scriptUrl="js/";
}
}
SwitchGames.imageCoverDir=SwitchGames.imageUrl+"covers/";
SwitchGames.screenShotDir=SwitchGames.imageUrl+"screens/";
SwitchGames.labelDir="images/labels/";
Ext.onReady(function(){
Ext.enableListenerCollection=true;
SwitchGames.Utility.genreList=["Action","Adventure","Educational","Fighting","Puzzle","Racing","Role-playing","Shooter","Simulation","Sports","Strategy","Traditional"];
SwitchGames.Utility.platformList={};
SwitchGames.Utility.platformList.consoles=[{name:"Wii",id:105},{name:"Xbox 360",id:100},{name:"PlayStation 3",id:104},{name:"Nintendo GameCube",id:91},{name:"Xbox",id:90},{name:"PlayStation 2",id:87}];
SwitchGames.Utility.platformList.handhelds=[{name:"Nintendo DS",id:97},{name:"PlayStation Portable",id:98},{name:"Game Boy Advance",id:89},{name:"Gizmondo",id:99},{name:"N-Gage",id:94}];
SwitchGames.Utility.platformList.computers=[{name:"Macintosh",id:57},{name:"IBM PC Compatible",id:49},{name:"Hybrid Windows/Mac",id:13}];
SwitchGames.Utility.platformList.vintage=[{name:"3DO",id:73},{name:"Acorn Electron",id:1},{name:"Adventure Vision",id:50},{name:"Amstrad CPC",id:2},{name:"Apple II",id:42},{name:"Arcade",id:40},{name:"Arcadia 2001",id:3},{name:"Atari 400/800/XL/XE",id:47},{name:"Atari 5200",id:51},{name:"Atari 7800",id:4},{name:"Atari Jaguar",id:74},{name:"Atari Jaguar CD",id:5},{name:"Atari Lynx",id:62},{name:"Atari ST",id:6},{name:"Atari Video Computer System",id:43},{name:"Bally Professional Arcade",id:44},{name:"BD Video",id:101},{name:"Camputers Lynx",id:7},{name:"ColecoVision",id:53},{name:"Commodore 64/128",id:54},{name:"Commodore Amiga",id:59},{name:"Commodore Amiga CD32",id:8},{name:"Commodore CDTV",id:67},{name:"Commodore PET",id:41},{name:"Commodore VIC-20",id:48},{name:"Cybiko",id:9},{name:"Dreamcast",id:85},{name:"Fairchild Video Entertainment System",id:11},{name:"Famicom Disk System",id:61},{name:"Game Boy",id:63},{name:"Game Boy Color",id:84},{name:"game.com",id:83},{name:"GamePark 32",id:12},{name:"HyperScan",id:103},{name:"Intellivision",id:46},{name:"Jupiter Ace",id:14},{name:"JVC X'Eye",id:15},{name:"Mattel Aquarius",id:55},{name:"Milton Bradley Microvision",id:16},{name:"MSX Series PC",id:56},{name:"Neo Geo Advanced Entertainment System",id:66},{name:"Neo Geo CD",id:75},{name:"NeoGeo Pocket",id:18},{name:"NeoGeo Pocket Color",id:19},{name:"Nintendo 64",id:80},{name:"Nintendo 64DD",id:86},{name:"Nintendo Entertainment System",id:58},{name:"Nintendo Virtual Boy",id:78},{name:"Nuon",id:20},{name:"Odyssey",id:21},{name:"Odyssey 2",id:45},{name:"PC-FX",id:22},{name:"Pioneer LaserActive",id:23},{name:"Pippin",id:81},{name:"PlayStation",id:79},{name:"Pokémon Mini",id:25},{name:"RCA Studio II",id:26},{name:"Sega CD",id:72},{name:"Sega Game Gear",id:69},{name:"Sega Genesis",id:64},{name:"Sega Genesis 32X",id:76},{name:"Sega Genesis 32X CD",id:27},{name:"Sega Genesis CDX",id:28},{name:"Sega Genesis Nomad",id:29},{name:"Sega Master System",id:60},{name:"Sega Pico",id:30},{name:"Sega Saturn",id:77},{name:"Sinclair ZX Spectrum",id:31},{name:"Super Nintendo Entertainment System",id:70},{name:"SuperGrafx",id:32},{name:"Supervision",id:71},{name:"Swan Crystal",id:92},{name:"Texas Instruments TI-99",id:33},{name:"Timex Sinclair",id:52},{name:"TRS-80",id:34},{name:"TurboDuo",id:35},{name:"TurboGrafx-16",id:65},{name:"TurboGrafx-16 CD",id:36},{name:"TurboGrafx-16 TurboExpress",id:37},{name:"Vectrex",id:38},{name:"WonderSwan",id:39},{name:"WonderSwan Color",id:88},{name:"XaviXPORT",id:96},{name:"Zodiac",id:95}];
Ext.QuickTips.init();
Ext.apply(Ext.QuickTips.getQuickTip(),{maxWidth:200,minWidth:100,showDelay:50,trackMouse:true});
if(!window.SwitchGames){
window.SwitchGames={};
}
if(SwitchGames.Utility==undefined||SwitchGames.Utility==null){
SwitchGames.Utility={};
}
SwitchGames.Utility.addSelectOptionsFromArray=function(id,data,_1dc){
var el=Ext.get(id);
var _1de=[];
for(var i=0,len=data.length;i<len;i++){
var opt=document.createElement("option");
opt.innerHTML=data[i];
opt.value=data[i];
if(_1dc==data[i]){
opt.selected=true;
}else{
opt.selected=false;
}
el.dom.appendChild(opt);
}
};
SwitchGames.Utility.creditCardNumberValidation=function(_1e2,_1e3){
var _1e4=new Array();
_1e4[0]={name:"Visa",length:"13,16",prefixes:"4",checkdigit:true};
_1e4[1]={name:"MasterCard",length:"16",prefixes:"51,52,53,54,55",checkdigit:true};
_1e4[2]={name:"DinersClub",length:"14,16",prefixes:"36,54,55",checkdigit:true};
_1e4[3]={name:"CarteBlanche",length:"14",prefixes:"300,301,302,303,304,305",checkdigit:true};
_1e4[4]={name:"AmEx",length:"15",prefixes:"34,37",checkdigit:true};
_1e4[5]={name:"Discover",length:"16",prefixes:"6011,622,64,65",checkdigit:true};
_1e4[6]={name:"JCB",length:"16",prefixes:"35",checkdigit:true};
_1e4[7]={name:"enRoute",length:"15",prefixes:"2014,2149",checkdigit:true};
_1e4[8]={name:"Solo",length:"16,18,19",prefixes:"6334, 6767",checkdigit:true};
_1e4[9]={name:"Switch",length:"16,18,19",prefixes:"4903,4905,4911,4936,564182,633110,6333,6759",checkdigit:true};
_1e4[10]={name:"Maestro",length:"12,13,14,15,16,18,19",prefixes:"5018,5020,5038,6304,6759,6761",checkdigit:true};
_1e4[11]={name:"VisaElectron",length:"16",prefixes:"417500,4917,4913,4508,4844",checkdigit:true};
var _1e5=-1;
for(var i=0;i<_1e4.length;i++){
if(_1e3.toLowerCase()==_1e4[i].name.toLowerCase()){
_1e5=i;
break;
}
}
if(_1e5==-1){
ccErrorNo=0;
return false;
}
if(_1e2.length==0){
ccErrorNo=1;
return false;
}
_1e2=_1e2.replace(/\s/g,"");
var _1e7=_1e2;
var _1e8=/^[0-9]{13,19}$/;
if(!_1e8.exec(_1e7)){
ccErrorNo=2;
return false;
}
if(_1e4[_1e5].checkdigit){
var _1e9=0;
var _1ea="";
var j=1;
var calc;
for(i=_1e7.length-1;i>=0;i--){
calc=Number(_1e7.charAt(i))*j;
if(calc>9){
_1e9=_1e9+1;
calc=calc-10;
}
_1e9=_1e9+calc;
if(j==1){
j=2;
}else{
j=1;
}
}
if(_1e9%10!=0){
ccErrorNo=3;
return false;
}
}
var _1ed=false;
var _1ee=false;
var _1ef;
var _1f0=new Array();
var _1f1=new Array();
_1f0=_1e4[_1e5].prefixes.split(",");
for(i=0;i<_1f0.length;i++){
var exp=new RegExp("^"+_1f0[i]);
if(exp.test(_1e7)){
_1ee=true;
}
}
if(!_1ee){
ccErrorNo=3;
return false;
}
_1f1=_1e4[_1e5].length.split(",");
for(j=0;j<_1f1.length;j++){
if(_1e7.length==_1f1[j]){
_1ed=true;
}
}
if(!_1ed){
ccErrorNo=4;
return false;
}
return true;
};
SwitchGames.Utility.scaleAndCenterImageInParent=function(el,_1f4){
var _1f5=Ext.get(el);
var _1f6;
if(_1f5==null){
return;
}
if(_1f4==undefined||_1f4==null){
_1f6=_1f5.parent();
}else{
_1f6=Ext.get(_1f4);
}
if(_1f6==null){
return;
}
if(Ext.isIE){
_1f5.dom.style.cssText="";
}
_1f5.setStyle("width","");
_1f5.setStyle("height","");
var _1f7=_1f5.getWidth();
var _1f8=_1f5.getHeight();
var _1f9=_1f6.getWidth();
var _1fa=_1f6.getHeight();
var _1fb,_1fc;
var _1fd,_1fe;
var _1ff,_200;
var _201;
var _202;
_1ff=_1f5.getPadding("l");
_200=_1f5.getPadding("t");
_202=_1f5.getMargins("lrtb");
_1f5.setStyle("marginLeft","0px");
_1f5.setStyle("marginTop","0px");
_1f9-=_1f5.getOffsetsTo(_1f6)[0];
_1fa-=_1f5.getOffsetsTo(_1f6)[1];
_1fb=_1f7;
_1fc=_1f8;
var _203;
var _204;
if(_1f7<=_1f9){
_203=0;
}else{
_203=Math.floor(Math.abs(_1f9-_1f7));
}
if(_1f8<=_1fa){
_204=0;
}else{
_204=Math.floor(Math.abs(_1fa-_1f8));
}
if(_203>_204){
if(_1f7>_1f9){
_1fb=_1f9-12;
_201=_1fb/_1f7;
_1fc=Math.floor(_1f8*_201);
}
}else{
if(_1f8>_1fa){
_1fc=_1fa-12;
_201=_1fc/_1f8;
_1fb=Math.floor(_1f7*_201);
}
}
_1fd=Math.floor((_1f9-_1fb)/2);
_1fe=Math.floor((_1fa-_1fc)/2);
_1f5.setStyle("width",_1fb+"px");
_1f5.setStyle("height",_1fc+"px");
_1f5.setStyle("marginLeft",_1fd+"px");
_1f5.setStyle("marginTop",_1fe+"px");
_1f5.dom.setAttribute("scaled","1");
};
SwitchGames.Utility.scaleAndCenterImage=function(el,_206,_207){
var _208,_209;
if(isIE){
el.setStyle("width","");
el.setStyle("height","");
_208=parseInt(el.getWidth());
_209=parseInt(el.getHeight());
}else{
_208=parseInt(el.dom.naturalWidth);
_209=parseInt(el.dom.naturalHeight);
}
var _20a=_206;
var _20b=_207;
var _20c=_20a/_208;
var _20d=parseInt(_209*_20c);
if(_20d>_20b){
_20c=_20b/_209;
_20d=parseInt(_209*_20c);
}
var _20e=parseInt(_208*_20c);
var _20f=parseInt((_20b-_20d)/2);
var _210=parseInt((_20a-_20e)/2);
el.setStyle("width",_20e+"px");
el.setStyle("height",_20d+"px");
el.setStyle("margin-top",_20f+"px");
el.setStyle("margin-left",_210+"px");
};
SwitchGames.Utility.scaleImage=function(lid){
var _212=Ext.get(Ext.DomQuery.selectNode("img[@lid="+lid+"]"));
if(_212==null||_212.dom.naturalWidth==0){
return;
}
if(Ext.isIE){
_212.dom.style.cssText="";
}
_212.setStyle("width","50");
_212.setStyle("height","50");
_212.setStyle("border","1px solid yellow");
var _213=_212.parent();
var _214=_212.dom.naturalWidth;
var _215=_212.dom.naturalHeight;
var _216=parseInt(_213.getStyle("width"));
var _217=parseInt(_213.getStyle("height"));
var _218=_216/_214;
var _219=_214*_218;
var _21a=_215*_218;
if(_21a>_217){
_218=_217/_215;
_219=_214*_218;
_21a=_215*_218;
}
_212.setStyle("height",_21a);
_212.setStyle("width",_219);
};
Ext.namespace("SwitchGames","SwitchGames.Validation");
SwitchGames.Validation.ccTypeValidation=function(_21b,_21c){
if(_21b==""){
return "You must select a credit card type";
}else{
return true;
}
};
SwitchGames.Validation.ccNumberValidation=function(_21d,_21e,_21f){
if(_21f==""){
return ("You must select a credit card type first");
}
if(_21d==""){
return ("You must enter a credit card number");
}else{
if(SwitchGames.Utility.creditCardNumberValidation(_21d,_21f)==false){
return ("Invalid card type/number");
}else{
return (true);
}
}
};
SwitchGames.Validation.simpleFieldValidation=function(_220,type,_222,name){
var _224=new RegExp(/(^\d{3}$)|(^\d{4}$)/);
var _225=new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
var _226=new RegExp(/(^\d{3}$)/);
var _227=new RegExp(/(^\d{4}$)/);
var _228=new RegExp(/(^\d+$)/);
if(_220.length==0){
return ("You must enter a "+name);
}
if(type=="cid"&&!_224.test(_220)){
return ("Invalid "+name);
}
if((type=="areacode"||type=="prefix")&&!_226.test(_220)){
return ("Invalid "+name);
}
if(type=="suffix"&&!_227.test(_220)){
return ("Invalid "+name);
}
if(type=="zip"&&!_225.test(_220)){
return ("Invalid "+name);
}
if(type=="numeric"&&!_228.test(_220)){
return ("Invalid "+name);
}
return (true);
};
SwitchGames.Utility.setupFormValidation=function(_229,_22a,_22b,_22c){
var _22a=Ext.get(_22a);
var fl=_229;
var _22e=_22b;
var _22f=_22c;
function _230(_231,id){
for(var i=0,_234=_231.length;i<_234;i++){
if(_231[i].id==id){
return (i);
}
}
return (-1);
};
for(var i=0,_236=_229.length;i<_236;i++){
_229[i].modified=false;
}
if(window.addEventListener){
_22a.dom.addEventListener("change",function(e){
var t=e.target;
var _239=_230(fl,t.id);
if(_239==-1){
return;
}
var _23a=fl[_239];
if(_23a.validationFn==null){
return;
}
_23a.modified=true;
var _23b=null;
if(_23a.refField!=null){
_23b=Ext.get(_23a.refField).getValue();
}
var _23c=Ext.get(t).getValue();
var _23d=_23a.validationFn(_23c,_23a.valueType,_23b,_23a.name);
if(_23d==true){
this.validated=true;
this.value=_23c;
_22e(true);
_22f(SwitchGames.Utility.validateForm(fl));
}else{
_22e(_23d);
}
},true);
_22a.dom.addEventListener("blur",function(e){
var t=e.target;
var _240=_230(fl,t.id);
if(_240==-1){
return;
}
var _241=fl[_240];
if(_241.validationFn==null){
return;
}
_241.modified=true;
var _242=null;
if(_241.refField!=null){
_242=Ext.get(_241.refField).getValue();
}
var _243=Ext.get(t).getValue();
var _244=_241.validationFn(_243,_241.valueType,_242,_241.name);
if(_244==true){
this.validated=true;
this.value=_243;
_22e(true);
_22f(SwitchGames.Utility.validateForm(fl));
}else{
_22e(_244);
}
},true);
}else{
if(window.attachEvent){
_22a.on("change",function(e,t){
var _247=_230(fl,t.id);
var _248=fl[_247];
if(_248.validationFn==null){
return;
}
_248.modified=true;
var _249=null;
if(_248.refField!=null){
_249=Ext.get(_248.refField).getValue();
}
var _24a=Ext.get(t).getValue();
var _24b=_248.validationFn(_24a,_248.valueType,_249,_248.name);
if(_24b==true){
this.validated=true;
this.value=_24a;
_22e(true);
_22f(SwitchGames.Utility.validateForm(fl));
}else{
_22e(_24b);
}
},true);
_22a.on("focusout",function(e,t){
var _24e=_230(fl,t.id);
var _24f=fl[_24e];
if(_24f.validationFn==null){
return;
}
_24f.modified=true;
var _250=null;
if(_24f.refField!=null){
_250=Ext.get(_24f.refField).getValue();
}
var _251=Ext.get(t).getValue();
var _252=_24f.validationFn(_251,_24f.valueType,_250,_24f.name);
if(_252==true){
this.validated=true;
this.value=_251;
_22e(true);
_22f(SwitchGames.Utility.validateForm(fl));
}else{
_22e(_252);
}
},true);
}
}
_22f(SwitchGames.Utility.validateForm(fl));
};
SwitchGames.Utility.validateForm=function(_253){
var _254=true;
var _255;
for(var i=0,_257=_253.length;i<_257;i++){
if(_253[i].validated==false){
var _258=null;
if(_253[i].refField!=null){
_258=Ext.get(_253[i].refField).getValue();
}
var _259=Ext.get(_253[i].id).getValue();
_255=_253[i].validationFn(_259,_253[i].valueType,_258,_253[i].name);
if(_255==true){
_253[i].validated=true;
}else{
_254=false;
break;
}
}
}
return (_254);
};
SwitchGames.Utility.sendSecureRequest=function(url,_25b,_25c,_25d){
var _25e=SwitchGames.Utility.getSitePrefix();
_25e=_25e.replace(/http:/,"https:");
_25e=_25e.replace(/https:\/\/switchgames\.com/,"https://www.switchgames.com");
_25e=_25e.replace(/https:\/\/thegamersmarketplace\.com/,"https://www.switchgames.com");
_25e=_25e.replace(/https:\/\/www\.thegamersmarketplace\.com/,"https://www.switchgames.com");
var _25f,_260;
if(url.match("http:")==null&&url.match("https:")==null){
_25f=_25e+url;
}else{
_25f=url;
}
var _261=Ext.Ajax.request({url:_25f,params:_25b,scriptTag:true,method:"GET",success:_25c,failure:_25d});
return (_261);
};
SwitchGames.Utility.doLogin=function(e){
var evt=window.event?event:e;
var _264=evt.target?evt.target:evt.srcElement;
if(evt.keyCode==13){
document.login.submit();
}
};
SwitchGames.Utility.markDescriptionTags=function(_265){
var _265=_265;
var _266=/\{[\~\\\*\#\@\$\%\!]([a-zA-Z0-9].+?)\}/g;
return (_265.replace(_266,"<i>$1</i>"));
};
SwitchGames.Utility.createSystemCheckboxList=function(id,_268){
var out=[];
var _26a=SwitchGames.Utility.platformList.consoles;
var _26b=SwitchGames.Utility.platformList.handhelds;
var _26c=SwitchGames.Utility.platformList.computers;
var _26d=SwitchGames.Utility.platformList.vintage;
var _26e=[];
if(_268){
_26e=_268.split(",");
}
var i,j,len,_272;
out.push("<tr><td><b>CONSOLE</b></td></tr>");
for(i=0,len=_26a.length;i<len;i++){
var _273="";
_272=false;
if(_26e.length>0){
for(j=0;j<_26e.length;j++){
if(_26a[i].id==parseInt(_26e[j])){
_272=true;
break;
}
}
}
if(_272){
_273=" checked ";
}
out.push("<tr><td><input name=\"system\" platformid=\""+_26a[i].id+"\" class=\"system\" type=\"checkbox\" "+_273+" />&nbsp;&nbsp;");
out.push(_26a[i].name);
out.push("</td></tr>");
}
out.push("<tr><td style=\"padding-bottom: 10px; padding-top: 15px;\"><b>HANDHELD</b></td></tr>");
for(i=0,len=_26b.length;i<len;i++){
var _273="";
_272=false;
if(_26e.length>0){
for(j=0;j<_26e.length;j++){
if(_26b[i].id==parseInt(_26e[j])){
_272=true;
break;
}
}
}
if(_272){
_273=" checked ";
}
out.push("<tr><td><input name=\"system\" platformid=\""+_26b[i].id+"\" class=\"system\" type=\"checkbox\" "+_273+" />&nbsp;&nbsp;");
out.push(_26b[i].name);
out.push("</td></tr>");
}
out.push("<tr><td style=\"padding-bottom: 10px; padding-top: 15px;\"><b>COMPUTER</b></td></tr>");
for(i=0,len=_26c.length;i<len;i++){
var _273="";
_272=false;
if(_26e.length>0){
for(j=0;j<_26e.length;j++){
if(_26c[i].id==parseInt(_26e[j])){
_272=true;
break;
}
}
}
if(_272){
_273=" checked ";
}
out.push("<tr><td><input name=\"system\" platformid=\""+_26c[i].id+"\" class=\"system\" type=\"checkbox\" "+_273+" />&nbsp;&nbsp;");
out.push(_26c[i].name);
out.push("</td></tr>");
}
out.push("<tr><td style=\"padding-bottom: 10px; padding-top: 15px;\"><b>VINTAGE &amp; OTHER</b></td></tr>");
for(i=0,len=_26d.length;i<len;i++){
var _273="";
_272=false;
if(_26e.length>0){
for(j=0;j<_26e.length;j++){
if(_26d[i].id==parseInt(_26e[j])){
_272=true;
break;
}
}
}
if(_272){
_273=" checked ";
}
out.push("<tr><td><input name=\"system\" platformid=\""+_26d[i].id+"\" class=\"system\" type=\"checkbox\" "+_273+" />&nbsp;&nbsp;");
out.push(_26d[i].name);
out.push("</td></tr>");
}
Ext.get(id).insertHtml("beforeEnd",out.join(""));
};
SwitchGames.Utility.getScrollbarWidth=function(){
var _274=document.createElement("p");
_274.style.width="100%";
_274.style.height="200px";
var _275=document.createElement("div");
_275.style.position="absolute";
_275.style.top="0px";
_275.style.left="0px";
_275.style.visibility="hidden";
_275.style.width="200px";
_275.style.height="150px";
_275.style.overflow="hidden";
_275.appendChild(_274);
document.body.appendChild(_275);
var w1=_274.offsetWidth;
_275.style.overflow="scroll";
var w2=_274.offsetWidth;
if(w1==w2){
w2=_275.clientWidth;
}
document.body.removeChild(_275);
return (w1-w2);
};
SwitchGames.Utility.getUrlParam=function(name){
name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
var _279="[\\?&]"+name+"=([^&#]*)";
var _27a=new RegExp(_279);
var _27b=_27a.exec(window.location.href);
if(_27b==null){
return "";
}else{
return _27b[1];
}
};
SwitchGames.Utility.limitTextFieldLength=function(e){
var evt=window.event?event:e;
var _27e=evt.target?evt.target:evt.srcElement;
var _27f=_27e.getAttribute?parseInt(_27e.getAttribute("maxlength")):"";
var _280=_27e.value.length;
var key=evt.keyCode;
if(key==8||(key>=33&&key<=46)){
return (true);
}
if(_27e.value.length>=_27f){
return (false);
}else{
return (true);
}
};
SwitchGames.Utility.setNavClass=function(){
var _282={"switch_center":"sg-nav-btn-switch-center","trade_tools":"sg-nav-btn-trade-tools","community":"sg-nav-btn-community","post_office":"sg-nav-btn-post-office","account":"sg-nav-btn-my-account","shop":"sg-nav-btn-shop"};
var _283=location.pathname.split("/");
var _284=_283.length;
var path=_283[_284-1];
var name=path.split(".")[0];
var el=Ext.fly(_282[name]);
if(el){
Ext.fly(_282[name]).removeClass("sg-nav-unselected");
Ext.fly(_282[name]).addClass("sg-nav-selected");
}
};
SwitchGames.Utility.getSitePrefix=function(){
var _288=location.href.lastIndexOf("/");
if(_288==-1){
return (location.href);
}else{
return (location.href.substring(0,_288+1));
}
};
SwitchGames.Utility.setNavClass();
SwitchGames.Utility.nl2br=function(text){
breakTag="<br />";
if(typeof is_xhtml!="undefined"&&!is_xhtml){
breakTag="<br>";
}
return (str+"").replace(/([^>]?)\n/g,"$1"+breakTag+"\n");
};
SwitchGames.Utility.deepCopy=function(obj){
var _28b=[];
var _28c=[];
var f=function(_28e){
var _28f=_28b.indexOf(_28e);
if(_28f==-1){
switch(Ext.type(_28e)){
case "object":
_28b.push(_28e);
var _290={};
_28c.push(_290);
for(var p in _28e){
_290[p]=f(_28e[p]);
}
_290.constructor=_28e.constructor;
return _290;
case "array":
_28b.push(_28e);
var _292=[];
_28c.push(_292);
for(var i=0,len=_28e.length;i<len;i++){
_292.push(f(_28e[i]));
}
return _292;
default:
return _28e;
}
}else{
return _28c[_28f];
}
};
return f(obj);
};
SwitchGames.Utility.getAvatarValue=function(_295){
if(_295==null||_295=="null"){
return SwitchGames.imageUrl+"avatars/no_user_image.png";
}else{
return SwitchGames.imageUrl+"avatars/"+_295;
}
};
SwitchGames.Utility.createGreyRoundBox=function(_296,_297,_298,_299){
var data={title:_296,content:_297};
var _29b=new Ext.XTemplate("<div style=\"width:",_298,"px; height: ",_299,"px;\" class=\"sg-grey-round-box-wrapper\">","<div class=\"sg-grey-round-box-header\">","<div class=\"sg-grey-round-box-header-inner\">","{title}","</div>","</div>","<div class=\"sg-grey-round-box-body\">","<div class=\"sg-grey-round-box-body-inner\">","{content}","</div>","</div>","<div class=\"sg-grey-round-box-footer\">","<div class=\"sg-grey-round-box-footer-inner\">","</div>","</div>","</div>");
var _29c=_29b.applyTemplate(data);
return (_29c);
};
SwitchGames.Utility.formatWithCommas=function(nStr){
nStr+="";
x=nStr.split(".");
x1=x[0];
x2=x.length>1?"."+x[1]:"";
var rgx=/(\d+)(\d{3})/;
while(rgx.test(x1)){
x1=x1.replace(rgx,"$1"+","+"$2");
}
return x1+x2;
};
SwitchGames.Utility.createVisibleDate=function(date){
if(date==undefined||date==null||date=="null"){
return ("");
}else{
var _2a0=SwitchGames.Utility.mysqlTimeStampToDate(date);
return (_2a0.format("m.d.Y"));
}
};
SwitchGames.Utility.createStringValue=function(_2a1,_2a2){
if(_2a1==undefined||_2a1==null||_2a1=="null"){
if(_2a2==undefined||_2a2==null){
return ("");
}else{
return (_2a2);
}
}else{
return (_2a1);
}
};
SwitchGames.Utility.mysqlTimeStampToDate=function(_2a3){
var _2a4=/^([0-9]{2,4})-([0-1][0-9])-([0-3][0-9]) (?:([0-2][0-9]):([0-5][0-9]):([0-5][0-9]))?$/;
var _2a5=_2a3.replace(_2a4,"$1 $2 $3 $4 $5 $6").split(" ");
var _2a6=new Date(Date.UTC(_2a5[0],_2a5[1]-1,_2a5[2],_2a5[3],_2a5[4],_2a5[5]));
return _2a6;
};
SwitchGames.Utility.createVisibleTime=function(date){
if(date==undefined||date==null||date=="null"){
return ("");
}else{
var _2a8=SwitchGames.Utility.mysqlTimeStampToDate(date);
}
return (_2a8.format("g:i A"));
};
SwitchGames.Utility.getBuddyIcon=function(_2a9,_2aa){
if(_2a9==null||_2a9=="null"){
if(_2aa){
return (SwitchGames.imageUrl+"common/buttons/add-to-buddy-list-large.png");
}else{
return (SwitchGames.imageUrl+"common/buttons/add-to-buddy-list-small.gif");
}
}else{
if(_2aa){
return (SwitchGames.imageUrl+"common/buttons/remove-from-buddy-list-large.png");
}else{
return (SwitchGames.imageUrl+"common/buttons/remove-from-buddy-list-small.png");
}
}
};
SwitchGames.Utility.getGamerURL=function(_2ab){
var SN=_2ab.toLowerCase();
var url="gamer/"+SN;
return url;
};
SwitchGames.Utility.getTenureTooltip=function(_2ae){
var _2af;
if(_2ae>0){
_2af=" ext:qtip=\"Tenure Badge:  This member has belonged for at least "+_2ae+" years.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}else{
_2af=" ext:qtip=\"Tenure Badge (not yet earned): Members must belong for at least one year before earning the first of these badges.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}
return (_2af);
};
SwitchGames.Utility.getTransactionTooltip=function(_2b0){
var _2b1;
if(_2b0>=100){
_2b1=" ext:qtip=\"Transaction Badge:  This member has completed at least 100 transactions.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}else{
if(_2b0>=50){
_2b1=" ext:qtip=\"Transaction Badge:  This member has completed at least 50 transactions.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}else{
if(_2b0>=25){
_2b1=" ext:qtip=\"Transaction Badge:  This member has completed at least 25 transactions.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}else{
if(_2b0>=10){
_2b1=" ext:qtip=\"Transaction Badge:  This member has completed at least 10 transactions.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}else{
if(_2b0>=5){
_2b1=" ext:qtip=\"Transaction Badge:  This member has completed at least 5 transactions.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}else{
_2b1=" ext:qtip=\"Transaction Badge (not yet earned): Members need to complete 5 positive transactions to earn this badge.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}
}
}
}
}
return (_2b1);
};
SwitchGames.Utility.getRatingsStarTooltip=function(_2b2){
var _2b3;
if(_2b2==1){
_2b3=" ext:qtip=\"Ratings Star Badge: This member has 100% positive feedback on all transactions.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}else{
_2b3=" ext:qtip=\"Ratings Star Badge (not yet earned): Members with 100% positive feedback and several transactions earn this badge.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}
return (_2b3);
};
SwitchGames.Utility.getPlusTooltip=function(_2b4){
var _2b5;
if(_2b4==1){
_2b5=" ext:qtip=\"Plus Membership: This member is a power user of SwitchGames.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}else{
_2b5=" ext:qtip=\"Plus Membership (not yet earned): This badge signifies a member as power user of SwitchGames.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}
return (_2b5);
};
SwitchGames.Utility.getVerifiedTooltip=function(_2b6){
var _2b7;
if(_2b6==1){
_2b7=" ext:qtip=\"Verified Badge: This member has paid a processing fee to verify their shipping and billing address.  96% of SwitchGames members prefer doing business with verified members.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}else{
_2b7=" ext:qtip=\"Verified Badge (not yet earned): Members receive this badge after successfully validating their shipping and billing address.  96% of SwitchGames members prefer doing business with verified members.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}
return (_2b7);
};
SwitchGames.Utility.createVerifiedBadgeTooltips=function(_2b8,_2b9,_2ba){
var _2bb,_2bc,_2bd,_2be;
if(SwitchGames.badgeContainers==undefined||SwitchGames.badgeContainers==null){
SwitchGames.badgeContainers=[];
}
if(_2b9==undefined||_2b9==null){
return;
}
var _2bf=new Ext.XTemplate("<div>","<div style=\"width: 29px; height: 29px; background-image: url("+SwitchGames.imageUrl+"common/badges/badge-verified.png); float: left;\"></div>","<div style=\"float: left; padding-left: 20px; text-align: center;\">","<div style=\"font-size: 18px; font-weight: bold; padding-top: 5px;\">Verified Membership Badge</div>","</div>","<div style=\"height: 10px; clear: both;\"></div>","<div style=\"font-size: 14px; font-weight: normal;\">This member has paid $4.95 to verify their shipping and billing address.  96% of SwitchGames members prefer doing business with verified members.</div>","<div style=\"height: 10px; clear: both;\"></div>","<tpl if=\"verified == 0\">","<div style=\"font-size: 14px; font-weight: normal; text-align: center; color: #990000;\">You are not verified</div>","<div style=\"font-size: 14px; font-weight: normal; text-align: center; color: #5e773c;padding-top: 3px; cursor: pointer;\" onclick=\"SwitchGames.Account.VerifyMember("+_2ba+");\">Get Verified Now!</div>","</tpl>","<tpl if=\"verified == 1\">","<div style=\"font-size: 14px; font-weight: normal; text-align: center; color: #009900;\">You are a verified member.</div>","</tpl>","<tpl if=\"verified == -1\">","<div style=\"font-size: 14px; font-weight: normal; text-align: center; color: #009900;\"></div>","</tpl>","</div>");
var _2c0=new Ext.XTemplate("<div>","<div style=\"width: 29px; height: 29px; background-image: url("+SwitchGames.imageUrl+"common/badges/badge-verified.png); float: left;\"></div>","<div style=\"float: left; padding-left: 20px; text-align: center;\">","<div style=\"font-size: 18px; font-weight: bold; height: 20px; padding-top: 5px;\">Verified Membership Badge</div>","<div style=\"font-size: 18px; font-weight: bold; height: 20px;\">(Not Yet Earned)</div>","</div>","<div style=\"height: 10px; clear: both;\"></div>","<div style=\"font-size: 14px; font-weight: normal;\">Members receive this badge after successfully validating their shipping and billing address.  96% of SwitchGames members prefer doing business with verified members.</div>","<div style=\"height: 10px; clear: both;\"></div>","<tpl if=\"verified == 0\">","<div style=\"font-size: 14px; font-weight: normal; text-align: center; color: #990000;\">You are not verified</div>","<div style=\"font-size: 14px; font-weight: normal; text-align: center; color: #5e773c;padding-top: 3px; cursor: pointer;\" onclick=\"SwitchGames.Account.VerifyMember("+_2ba+");\">Get Verified Now!</div>","</tpl>","<tpl if=\"verified == 1\">","<div style=\"font-size: 14px; font-weight: normal; text-align: center; color: #009900;\">You are a verified member.</div>","</tpl>","<tpl if=\"verified == -1\">","<div style=\"font-size: 14px; font-weight: normal; text-align: center; color: #009900;\"></div>","</tpl>","</div>");
var _2c1=_2b8.select("div[@name=\"verified-badge\"]",true,_2b8);
if(_2b9.badges==undefined){
_2b9.badges=[];
}
var i,_2c3;
for(i=0,_2c3=_2c1.elements.length;i<_2c3;i++){
var _2c4="";
var _2c5=_2c1.elements[i].dom.getAttribute("verified");
var _2c6=_2c1.elements[i].dom.getAttribute("memberverified");
var _2c7={verified:_2c6};
if(_2c5==1){
_2c4=_2bf.apply(_2c7);
}else{
_2c4=_2c0.apply(_2c7);
}
_2b9.badges.push(new Ext.ux.PersistentTip({target:_2c1.elements[i],width:350,height:400,html:_2c4,dismissDelay:5000}));
}
var _2c8=false;
for(var i=0,_2c3=SwitchGames.badgeContainers.length;i<_2c3;i++){
if(_2b9===SwitchGames.badgeContainers[i].container){
_2c8=true;
break;
}
}
if(_2c8==false){
var _2c9={};
_2c9.container=_2b9;
_2c9.element=_2b8;
_2c9.callback=_2ba;
SwitchGames.badgeContainers.push(_2c9);
}
};
SwitchGames.Utility.removeVerifiedTooltips=function(_2ca){
if(_2ca==undefined||_2ca==null||_2ca.badges==undefined||_2ca.badges==null){
return;
}
if(_2ca.badges!=null){
for(var i=0,_2cc=_2ca.badges.length;i<_2cc;i++){
Ext.destroy(_2ca.badges[i]);
}
delete _2ca.badges;
}
};
SwitchGames.Utility.updateVerifiedMemberElements=function(){
var _2cd=Ext.select("div[@name=\"verified-badge\"]",true,Ext.get(document.body).dom);
var i,_2cf;
for(i=0,_2cf=_2cd.elements.length;i<_2cf;i++){
var el=_2cd.elements[i].dom;
_2cd.elements[i].dom.setAttribute("memberverified","1");
}
for(i=0,_2cf=SwitchGames.badgeContainers.length;i<_2cf;i++){
SwitchGames.Utility.removeVerifiedTooltips(SwitchGames.badgeContainers[i].container);
SwitchGames.Utility.createVerifiedBadgeTooltips(SwitchGames.badgeContainers[i].element,SwitchGames.badgeContainers[i].container,SwitchGames.badgeContainers[i].callback);
}
};
SwitchGames.Utility.verifiedMemberCallback=function(_2d1){
if(_2d1){
SwitchGames.Utility.updateVerifiedMemberElements();
}
};
SwitchGames.Utility.getPhilanthropyTooltip=function(_2d2){
var _2d3;
if(_2d2==1){
_2d3=" ext:qtip=\"Philanthropy Badge: This member has given back to the SwitchGames Community and has earned this badge.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}else{
_2d3=" ext:qtip=\"Philanthropy Badge (not yet earned): Members who help the SwitchGames Community can earn this badge.\" ext:qwidth=\"200\" ext:qheight=\"150\" ";
}
return (_2d3);
};
SwitchGames.Utility.getMemberSiteTooltip=function(_2d4){
return (" ext:qtip=\"Visit <b>"+_2d4+"'s</b> Gamer Page\" ext:qwidth=\"200\" ext:qheight=\"150\" ");
};
SwitchGames.Utility.getBuddyLink=function(_2d5){
if(_2d5==null||_2d5=="null"||_2d5==0){
return (" name=\"messages-addtobuddylist\" ");
}else{
return (" name=\"messages-removefrombuddylist\" ");
}
};
SwitchGames.Utility.getBuddyTooltip=function(_2d6,_2d7){
if(_2d6==null||_2d6=="null"||_2d6==0){
return ("Add <b>"+decodeURIComponent(_2d7)+"</b> to your buddy list");
}else{
return ("Remove <b>"+decodeURIComponent(_2d7)+"</b> from your buddy list");
}
};
SwitchGames.Utility.getMessageUserTooltip=function(_2d8,_2d9){
return ("Send <b>"+decodeURIComponent(_2d9)+"</b> a message");
};
SwitchGames.Utility.getSSLTooltip=function(){
sslTooltip=["SwitchGames uses a trusted SSL connection to the server for all transactions requiring privacy, to protect your personal information.  We run the main pages through over regular web protocols to make ","sure you get the best performance possible on the site.  All of the data elements that require privacy are done so through methods we use that allows those transactions to be secured without "," requiring everything to go through SSL"];
return (sslTooltip.join(""));
};
SwitchGames.Utility.getGameCondition=function(_2da){
var _2db="";
_2da=_2da*1;
switch(_2da){
case 1:
_2db="perfect";
break;
case 2:
_2db="very good";
break;
case 3:
_2db="good";
break;
case 4:
_2db="bad";
break;
default:
_2db="unknown";
break;
}
return (_2db);
};
SwitchGames.Utility.getBrandNew=function(_2dc){
if(_2dc==0){
return ("Item is opened");
}else{
if(_2dc==1){
return ("Item is brand new");
}
}
};
SwitchGames.Utility.getScratches=function(_2dd){
if(_2dd==0){
return ("There are no scratches");
}else{
return ("Item has scratches");
}
};
SwitchGames.Utility.getHasManual=function(_2de){
if(_2de==0){
return ("No manual");
}else{
return ("Manual included");
}
};
SwitchGames.Utility.getOriginalBox=function(_2df){
if(_2df==0){
return ("Not in original box");
}else{
return ("Includes original packaging");
}
};
SwitchGames.Utility.getPanelDisplay=function(_2e0){
if(_2e0==1){
return ("");
}else{
return (" style=\"display: none;\" ");
}
};
SwitchGames.Utility.getNumPanelsMarkup=function(_2e1){
return (" currentpanel=\"0\" totalpanels=\""+_2e1+"\" ");
};
SwitchGames.Utility.checklistFontStrike=function(date){
if(date=="null"||date==null){
return ("");
}else{
return (" class=\"font-strike\" ");
}
};
SwitchGames.Utility.checklistCheckbox=function(date){
if(date=="null"||date==null){
return ("");
}else{
return (" checked ");
}
};
SwitchGames.Utility.theirChecklistItemClass=function(date){
if(date=="null"||date==null){
return ("");
}else{
return (" class=\"sg-live-transactions-transaction-status-highlighted\" ");
}
};
SwitchGames.Utility.theirChecklistItemValue=function(date){
if(date=="null"||date==null){
return (" not ");
}else{
return (" ");
}
};
SwitchGames.Utility.printTransactionState=function(_2e6,_2e7,_2e8,type){
var _2ea="";
if(type=="trade"){
_2ea="Trade";
}else{
if(type=="safetrade"){
_2ea="SafeTrade";
}else{
if(type=="buy"&&_2e7==true){
_2ea="Sale";
}else{
if(type=="buy"&&_2e7==false){
_2ea="Purchase";
}
}
}
}
if(_2e6=="proposal"){
if(_2e7){
return (_2ea+" offer from "+_2e8.toUpperCase());
}else{
return (_2ea+" offer to "+_2e8.toUpperCase());
}
}else{
if(type=="buy"){
if(_2e7){
return (_2ea+" to "+_2e8.toUpperCase());
}else{
return (_2ea+" from "+_2e8.toUpperCase());
}
}else{
if(_2e6=="in_progress"){
return (_2ea+" with "+_2e8.toUpperCase());
}else{
if(_2e6=="complete"){
return (_2ea+" with "+_2e8.toUpperCase());
}else{
if(_2e6=="rejected"){
if(_2e7){
return (_2ea+" offer from "+_2e8.toUpperCase());
}else{
return (_2ea+" offer to "+_2e8.toUpperCase());
}
}else{
if(_2e6=="canceled"){
if(_2e7){
return (_2ea+" offer from "+_2e8.toUpperCase());
}else{
return (_2ea+" offer to "+_2e8.toUpperCase());
}
}else{
if(_2e6=="expired"){
if(_2e7){
return (_2ea+" offer from "+_2e8.toUpperCase());
}else{
return (_2ea+" offer to "+_2e8.toUpperCase());
}
}else{
if(_2e6=="admin"){
if(_2e7){
return (_2ea+" offer from "+_2e8.toUpperCase());
}else{
return (_2ea+" offer to "+_2e8.toUpperCase());
}
}else{
if(_2e6=="incomplete"){
return (_2ea+" with "+_2e8.toUpperCase());
}
}
}
}
}
}
}
}
}
};
SwitchGames.Utility.getAddressField=function(_2eb,_2ec){
var _2ed="";
if(_2eb=="null"||_2eb==null||_2eb==""){
return ("");
}else{
if(_2eb=="United States of America"){
_2ed+="USA";
}else{
_2ed+=_2eb;
}
}
if(_2ec){
_2ed+="<br />";
}
return (_2ed);
};
SwitchGames.Utility.printTruncatedString=function(val,_2ef){
return (Ext.util.Format.ellipsis(val,_2ef));
};
SwitchGames.Utility.getDownArrowVisibility=function(_2f0){
if(_2f0<3){
return (" style=\"visibility: hidden\" ");
}else{
return ("");
}
};
SwitchGames.Utility.getCheckedValue=function(_2f1){
if(_2f1=="null"||_2f1==null){
return ("");
}else{
if(_2f1==1||_2f1=="1"){
return (" checked ");
}else{
return ("");
}
}
};
SwitchGames.Utility.getScrollerItemDisplay=function(_2f2){
if(_2f2>1){
return (" style=\"display: none;\" ");
}else{
return ("");
}
};
SwitchGames.Utility.getCoverValue=function(_2f3){
if(_2f3==null||_2f3=="null"){
return (SwitchGames.imageUrl+"null_covers/null_cover_generic.jpg");
}else{
if(_2f3.match("sg-cover")){
return (SwitchGames.imageUrl+"cover-overrides/"+_2f3+".jpg");
}else{
return (SwitchGames.imageCoverDir+"drg"+_2f3.slice(1,2)+"00/"+_2f3.slice(0,4)+"/"+_2f3+".jpg");
}
}
};
SwitchGames.Utility.getScreenShotValue=function(_2f4,_2f5){
if(_2f4==null||_2f4=="null"){
return ("");
}else{
if(_2f5){
return (SwitchGames.screenShotDir+"/screen250/dr"+_2f4.slice(0,2)+"00/"+_2f4.slice(0,4)+"/"+_2f4+".jpg");
}else{
return (SwitchGames.screenShotDir+"/screen110/dr"+_2f4.slice(0,2)+"00/"+_2f4.slice(0,4)+"/"+_2f4+".jpg");
}
}
};
SwitchGames.Utility.fireClick=function(oElm){
var _2f7;
if(Ext.isIE){
_2f7=document.createEventObject();
_2f7.cancelBubble=true;
_2f7.clientX=0;
_2f7.clientY=0;
_2f7.detail=0;
_2f7.screenX=0;
_2f7.screenY=0;
_2f7.ctrlKey=false;
_2f7.altKey=false;
_2f7.shiftKey=true;
_2f7.metaKey=false;
_2f7.button=0;
_2f7.complete=true;
_2f7.relatedTarget=oElm;
oElm.fireEvent("onclick",_2f7);
return _2f7;
}else{
var _2f8="Event";
_2f8="MouseEvent";
_2f7=document.createEvent(_2f8);
_2f7.initMouseEvent("click",true,true,null,0,0,0,0,0,false,false,false,false,0,null);
oElm.dispatchEvent(_2f7);
return _2f7;
}
};
SwitchGames.Utility.setupLeftRightScrolling=function(_2f9,_2fa,_2fb,_2fc,_2fd,_2fe,_2ff,_300,_301){
SwitchGames.Utility.leftRightScrollingActive=false;
var _302=_2f9.dom.getAttribute("totalpanels")*1;
var _303=_2f9.dom.getAttribute("currentpanel")*1;
var _304=false;
var _305,_306,_307;
_2fa.setStyle("cursor","pointer");
_2fb.setStyle("cursor","pointer");
if(_2ff!=undefined&&_2ff!=null){
_305=_2ff;
}else{
_305=null;
}
if(_2fe!=undefined&&_2fe!=null){
_306=_2fe;
}else{
_306=null;
}
if(_300!=undefined&&_300!=null){
_307=_300;
}else{
_307=null;
}
var _301=_301;
if(_301!=undefined&&_301!=null){
_301=_301;
}else{
_301=null;
}
if(_2fd==undefined||_2fd==null||!_2fd){
_304=false;
}else{
_304=_2fd;
}
var _308=(_2fc==null)?"fade":_2fc;
if(_302==1){
_2fa.setVisible(false);
_2fb.setVisible(false);
}else{
if(_303==0){
_2fa.setVisible(false);
_2fb.setVisible(true);
}
}
_2fa.on("click",function(e,t){
if(SwitchGames.Utility.leftRightScrollingActive==true){
return;
}
var _30b=Ext.get(t).findParent("[@name=\"panel-scroller-left-arrow\"]",5,true);
if(!_30b||!_30b.isVisible()||e.cancelled||_30b.hasClass("sg-disabled")){
return;
}
var _30c=_30b.findParent("div[@name=\"panel-scroller-root\"]",10,true);
var _30d=_30c.select("div[@name=\"panel-scroller-content-root\"]",true).elements[0];
var _30e=parseInt(_30d.dom.getAttribute("currentpanel"));
var _30f=parseInt(_30d.dom.getAttribute("totalpanels"));
var _310=_30c.select("[@name=\"panel-scroller-right-arrow\"]",true).elements[0];
if(_30f>1){
var _311=Ext.select("div[@name=\"panel-scroller-content\"]",true,_30d.dom);
if(_306){
if(!_306(_311.elements[_30e],_30b,_310,_30e,_30e-1)){
return;
}
}
if(_30e<=0){
return;
}
SwitchGames.Utility.scrollPanelLeft(_30c,_30e,_30e-1,_308,_304,_307,_301);
}
});
_2fb.on("click",function(e,t){
if(SwitchGames.Utility.leftRightScrollingActive==true){
return;
}
var _314=Ext.get(t).findParent("[@name=\"panel-scroller-right-arrow\"]",5,true);
if(!_314||!_314.isVisible()||e.cancelled||_314.hasClass("sg-disabled")){
return;
}
var _315=_314.findParent("div[@name=\"panel-scroller-root\"]",10,true);
var _316=_315.select("div[@name=\"panel-scroller-content-root\"]",true).elements[0];
var _317=parseInt(_316.dom.getAttribute("currentpanel"));
var _318=parseInt(_316.dom.getAttribute("totalpanels"));
var _319=_315.select("[@name=\"panel-scroller-left-arrow\"]",true).elements[0];
if(_318>1){
var _31a=Ext.select("div[@name=\"panel-scroller-content\"]",true,_316.dom);
if(_305){
if(_305(_31a.elements[_317],_319,_314,_317,_317+1)==false){
return;
}
}
if(_317+1>=_318){
return;
}
SwitchGames.Utility.scrollPanelRight(_315,_317,_317+1,_308,_304,_307,_301);
}
});
};
SwitchGames.Utility.scrollPanelLeft=function(_31b,_31c,_31d,_31e,_31f,_320,_321){
SwitchGames.Utility.leftRightScrollingActive=true;
var _322=Ext.get(_31b.query("[@name=\"panel-scroller-left-arrow\"]")[0]);
var _323=Ext.get(_31b.query("[@name=\"panel-scroller-right-arrow\"]")[0]);
var _324=Ext.get(_31b.query("div[@name=\"panel-scroller-content-root\"]")[0]);
var _325;
if(_321!=undefined&&_321!=null){
_325=_321;
}else{
_325=_31b.parent().query("[@name=\"element-counter\"]")[0];
}
var _326=false;
var _320=_320;
var _327=_31c;
var _328=_31d;
var _329=parseInt(_324.dom.getAttribute("totalpanels"));
if(_325!=null){
if(_325.getAttribute("element-counter")!=null){
_326=true;
}
}
if(_329>1){
var _32a=Ext.select("div[@name=\"panel-scroller-content\"]",true,_324.dom);
if(_31d+1<_329){
_323.setVisible(true);
}
var _32b=_32a.elements[_31c];
if(_32b.hasActiveFx()){
return;
}
var _32c=_32a.elements[_31d];
if(_32c.hasActiveFx()){
return;
}
if(_31e==null||_31e=="fade"){
_32b.fadeOut({duration:0.5,useDisplay:true,callback:function(){
_32c.fadeIn({duration:0.5,useDisplay:true});
SwitchGames.Utility.leftRightScrollingActive=false;
}});
}else{
if(_31e=="slide"){
_32b.addClass("sliding");
_32b.slideOut("r",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_32b.removeClass("sliding");
_32c.addClass("sliding");
_32c.slideIn("l",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_32c.removeClass("sliding");
SwitchGames.Utility.leftRightScrollingActive=false;
if(_320){
_320(_32c);
}
}});
}});
}
}
_324.dom.setAttribute("currentpanel",_31d);
if(_325){
_325.innerHTML="("+(_31d+1)+" of "+_329+" items)";
}
if(_31d>=_329){
_323.setVisible(false,false);
if(_31f){
_322.setVisible(false,false);
}
}
if(_31d==0){
_322.setVisible(false,false);
}
}
};
SwitchGames.Utility.scrollPanelRight=function(_32d,_32e,_32f,_330,_331,_332,_333){
SwitchGames.Utility.leftRightScrollingActive=true;
var _334=Ext.get(_32d.query("[@name=\"panel-scroller-left-arrow\"]")[0]);
var _335=Ext.get(_32d.query("[@name=\"panel-scroller-right-arrow\"]")[0]);
var _336=Ext.get(_32d.query("div[@name=\"panel-scroller-content-root\"]")[0]);
var _337;
if(_333!=undefined&&_333!=null){
_337=_333;
}else{
_337=_32d.parent().query("[@name=\"element-counter\"]")[0];
}
var _338=_32e;
var _339=_32f;
var _33a=parseInt(_336.dom.getAttribute("totalpanels"));
var _33b=false;
var _332=_332;
if(_337!=null){
if(_337.getAttribute("element-counter")!=null){
_33b=true;
}
}
if(_33a>1){
var _33c=Ext.select("div[@name=\"panel-scroller-content\"]",true,_336.dom);
if(_32f>0){
_334.setVisible(true);
}
var _33d=_33c.elements[_32e];
if(_33d.hasActiveFx()){
return;
}
var _33e=_33c.elements[_32f];
if(_33e.hasActiveFx()){
return;
}
if(_330==null||_330=="fade"){
_33d.fadeOut({duration:0.5,useDisplay:true,callback:function(){
_33e.fadeIn({duration:0.5,useDisplay:true});
SwitchGames.Utility.leftRightScrollingActive=false;
}});
}else{
if(_330=="slide"){
_33d.addClass("sliding");
_33d.slideOut("l",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_33d.removeClass("sliding");
_33e.addClass("sliding");
_33e.slideIn("r",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_33e.removeClass("sliding");
SwitchGames.Utility.leftRightScrollingActive=false;
if(_332){
_332(_33e);
}
}});
}});
}
}
_338=_32f;
_336.dom.setAttribute("currentpanel",_32f);
if(_337){
_337.innerHTML="("+(_32f+1)+" of "+_33a+" items)";
}
if(_32f+1>=_33a){
_335.setVisible(false,false);
if(_331){
_334.setVisible(false,false);
}
}
if(_32f==0){
_334.setVisible(false,false);
}
}
};
SwitchGames.Utility.resetPassword=function(){
var _33f=new Ext.XTemplate("<div id=\"sg-reset-password-main\" class=\"sg-reset-password\">","<div id=\"sg-reset-password-error\" style=\"text-align: center; height: 20px; font-size: 14px; color: #df2229; font-weight: bold; font-family: arial,verdana,helvetica,sans-serif;\">&#160;</div>","<div style=\"padding-left: 6px; padding-bottom: 15px; padding-top: 5px;\">","<span style=\"padding-right: 10px;\">EMail:</span>","<input class=\"input-text-wh\" onkeypress=\"document.getElementById('sg-reset-password-error').innerHTML = '';\" id=\"sg-reset-password-email\" type=\"text\" style=\"width: 300px;\" name=\"email\" maxlength=\"100\">","</div>","<div style=\"text-align: center;\">","<img id=\"sg-reset-password-send-btn\" class=\"sg-reset-password-send-btn\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-send.png\" /></div>","</div>","</div>","<div id=\"sg-reset-password-finish\" style=\"display: none;\" class=\"sg-reset-password-finish\">","<div style=\"padding-top: 25px; text-align: center; font-size: 14px; color: #ffffff; font-weight: normal; font-family: arial,verdana,helvetica,sans-serif;\" class=\"sg-reset-password-text\">Your password has been reset.</div>","<div style=\"padding-top: 5px; text-align: center; font-size: 14px; color: #ffffff; font-weight: normal; font-family: arial,verdana,helvetica,sans-serif;\" class=\"sg-reset-password-text\">Please check your email.</div>","</div>");
if(SwitchGames.Utility.resetPasswordDialog==undefined||SwitchGames.Utility.resetPasswordDialog==null){
SwitchGames.Utility.resetPasswordDialog=SwitchGames.Dialogs.createDialog("","sg-reset-password-dlg","New Password Request",400,140,"sg-window");
}
_33f.overwrite(SwitchGames.Utility.resetPasswordDialog.body);
Ext.fly("sg-reset-password-send-btn").on("click",function(e,t){
var _342=Ext.get("sg-reset-password-email").dom.value;
if(_342.length==0){
Ext.fly("sg-reset-password-error").dom.innerHTML="Please enter an email address";
return;
}
if(!Ext.form.VTypes.email(_342)){
Ext.fly("sg-reset-password-error").dom.innerHTML="Invalid email address";
return;
}
var _343={};
_343.email=_342;
_343.pane="password_reset";
Ext.Ajax.request({url:"data/common/utilities.php",params:_343,success:function(_344,_345){
var data=Ext.util.JSON.decode(_344.responseText);
if(data.error!=undefined&&data.error!=null){
Ext.fly("sg-reset-password-error").dom.innerHTML=data.error;
}else{
var _347=Ext.get("sg-reset-password-main");
var _348=Ext.get("sg-reset-password-finish");
_347.slideOut("l",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_348.slideIn("r",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false});
}});
}
},failure:function(_349,_34a){
SwitchGames.Dialogs.showErrorDialog("Error contacting server.  Try again later");
}});
});
SwitchGames.Utility.resetPasswordDialog.show();
};
SwitchGames.Utility.formatCurrency=function(_34b){
if(isNaN(_34b)){
return "0";
}
var _34c=2;
var _34d=1;
_34d=Math.pow(10,_34c);
_34b=Math.round(parseFloat(_34b)*_34d)/_34d;
_34b=""+_34b;
if(_34b.indexOf(".")==0){
_34b="0"+_34b;
}
if(_34b.indexOf(".")==-1){
_34b=_34b+".";
}
while((_34b.indexOf(".")+1)>(_34b.length-_34c)){
_34b=_34b+"0";
}
return _34b;
};
SwitchGames.Dialogs={};
SwitchGames.Dialogs.tradeOfferDialog=null;
SwitchGames.Dialogs.createDialog=function(_34e,el,_350,_351,_352,_353,_354){
var win=new Ext.Window({applyTo:el,layout:"fit",width:(_351==null)?"auto":_351,height:(_352==null)?"auto":_352,closable:_354!=undefined?_354:true,closeAction:"hide",plain:true,title:_350,html:_34e,border:false,buttonAlign:"center",resizable:false,modal:true,shadow:false,shim:true,baseCls:_353});
win.addButton({text:"Close",handler:function(){
win.hide();
}});
win.on("show",function(_356){
_356.center();
});
return win;
};
if(SwitchGames.Dialogs.standardErrorDialog==undefined||SwitchGames.Dialogs.standardErrorDialog==null){
SwitchGames.Dialogs.standardErrorDialog=SwitchGames.Dialogs.createDialog("<div style=\"text-align: center; vertical-align: middle; height: 100%; width: 100%; display: table;\"><div style=\"display: table-cell; vertical-align: middle; height: 100%;\"></div></div>","sg-error-dlg","Error...",400,300,"sg-window");
}
SwitchGames.Dialogs.showErrorDialog=function(_357){
SwitchGames.Dialogs.standardErrorDialog.body.first().first().dom.innerHTML=_357;
SwitchGames.Dialogs.standardErrorDialog.show();
};
if(SwitchGames.Dialogs.messageDialog==undefined||SwitchGames.Dialogs.messageDialog==null){
SwitchGames.Dialogs.messageDialog=SwitchGames.Dialogs.createDialog("<div style=\"text-align: center; width: 100%;\"><div style=\"margin: 20px 0 20px 0;\" class=\"sg-message-dlg-message\"></div></div>","sg-message-dlg","",400,null,"sg-window");
}
SwitchGames.Dialogs.messageBox=function(_358,_359,_35a,_35b){
SwitchGames.Dialogs.messageDialog.setTitle(_358);
SwitchGames.Ads.AdManager.removeAds(SwitchGames.Dialogs.messageDialog.body.dom);
if(_35a!=null&&_35b!=null){
SwitchGames.Ads.AdManager.appendAd(SwitchGames.Dialogs.messageDialog.body.first().dom,_35a,_35b);
}
Ext.query(".sg-message-dlg-message",SwitchGames.Dialogs.messageDialog.body.dom)[0].innerHTML=_359;
SwitchGames.Dialogs.messageDialog.show();
};
SwitchGames.Dialogs.showNotLoggedInDialog=function(){
var _35c=new Ext.XTemplate("<div style=\"text-align: center; font-color: #ffffff;\">","<div style=\"padding-top: 10px; font-size: 20px; font-weight: normal; font-family: Arial,Verdana,Helvetica,sans-serif;\">You must be logged in to do this.</div>","<div class=\"not-logged-in-banner-join\">","<div style=\"float: left; padding-left: 30px; padding-top: 15px; font-size: 22px; font-weight: bold; font-family: Arial,Verdana,Helvetica,sans-serif;\">Not a Member?&nbsp;&nbsp;</div><a href=\"account_creation_slider.php\"></a>","</div>","</div>");
if(SwitchGames.Dialogs.notLoggedInDialog==undefined||SwitchGames.Dialogs.notLoggedInDialog==null){
SwitchGames.Dialogs.notLoggedInDialog=SwitchGames.Dialogs.createDialog("","sg-not-logged-in-dlg","Not Logged In",370,140,"sg-window");
_35c.overwrite(SwitchGames.Dialogs.notLoggedInDialog.body,{});
}
SwitchGames.Dialogs.notLoggedInDialog.show();
};
SwitchGames.Dialogs.confirmationCallback=null;
if(SwitchGames.Dialogs.confirmationDialog==undefined||SwitchGames.Dialogs.confirmationDialog==null){
var _35d=["<div style=\"text-align: center;\">","<div id=\"sg-confirmation-message\">","</div>","<div>&#160;</div>","<div>","<img name=\"sg-confirmation-btn\" id=\"sg-confirmation-yes-btn\" style=\"cursor: pointer;\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-yes.png\" />&#160;&#160;&#160;","<img name=\"sg-confirmation-btn\" id=\"sg-confirmation-no-btn\"  style=\"cursor: pointer;\"  src=\""+SwitchGames.imageUrl+"common/buttons/btn-no.png\" />","</div>","</div>"];
SwitchGames.Dialogs.confirmationDialog=SwitchGames.Dialogs.createDialog(_35d.join(""),"sg-confirmation-dlg","",400,120,"sg-window");
Ext.select("img[@name=\"sg-confirmation-btn\"]").on("click",function(e,t){
SwitchGames.Dialogs.confirmationDialog.hide();
if(t.id=="sg-confirmation-yes-btn"){
SwitchGames.Dialogs.confirmationCallback(true);
}else{
SwitchGames.Dialogs.confirmationCallback(false);
}
});
}
SwitchGames.Dialogs.confirmationMessage=function(_360,_361,_362,_363,_364){
if(_362==undefined||_362==null){
return;
}else{
SwitchGames.Dialogs.confirmationCallback=_362;
SwitchGames.Dialogs.confirmationDialog.setTitle(_360);
if(_363!=null){
SwitchGames.Dialogs.confirmationDialog.setWidth(_363);
}
if(_364!=null){
SwitchGames.Dialogs.confirmationDialog.setHeight(_364);
}
Ext.fly("sg-confirmation-message").dom.innerHTML=_361;
SwitchGames.Dialogs.confirmationDialog.show();
}
};
if(SwitchGames.Dialogs.itemDetailDialog==undefined||SwitchGames.Dialogs.itemDetailDialog==null){
SwitchGames.Dialogs.itemDetailDialog=SwitchGames.Dialogs.createDialog("","sg-item-detail-dlg","Item Detail",580,430,"sg-window");
}
SwitchGames.Dialogs.showItemDetailDialog=function(_365,type){
var _367=new Ext.XTemplate("<div class=\"gd-rnd-box-wrapper\" style=\"width:520px;\">","<div class=\"gd-rnd-box-top\"><div></div></div>","<div class=\"gd-rnd-box-body\">","<div style=\"width: 118px; height: 200px;\" class=\"gd-gamebox\">","<img style=\"border: 1px solid #999999;\" onload=\"SwitchGames.Utility.scaleAndCenterImageInParent(this);\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\" alt=\"\" />","</div>","<div class=\"gd-game-info\">","<tpl for=\"game\">","<div class=\"gd-game-name\">{game_name}</div>","<div class=\"gd-game-console\">{platform_name}</div>","<div class=\"gd-game-publish-info\">ESRB:&nbsp;<span>{esrb}</span>&nbsp;&nbsp;Publisher:&nbsp;<span>{publisher}</span><br/>Released:&nbsp;<span>{date_released}</span>&nbsp;&nbsp;Genre:&nbsp;<span>{genre}/{subgenre}</div>","<div class=\"gd-desc\">","{[SwitchGames.Utility.markDescriptionTags(values.description).nl2br()]}","</div>","</tpl>","<tpl for=\"platform\">","<div class=\"gd-game-name\">{platform_name}</div>","<div class=\"gd-game-publish-info\">Released:&nbsp;<span>{date_released}</span></div>","<div class=\"gd-desc\">","{[SwitchGames.Utility.markDescriptionTags(values.description).nl2br()]}","</div>","</tpl>","<tpl for=\"accessory\">","<div class=\"gd-game-name\">{accessory_name}</div>","<div class=\"gd-game-console\">{platform_name}</div>","<div class=\"gd-game-publish-info\">Released:&nbsp;<span>{date_released}</span></div>","<div class=\"gd-desc\">","{[SwitchGames.Utility.markDescriptionTags(values.description).nl2br()]}","</div>","</tpl>","</div>","<div class=\"clear\"></div>","<div class=\"gd-grey-divider\"></div>","<div id=\"gd-screenshots\"></div>","</div>","<div class=\"gd-rnd-box-bottom\"><div></div></div>","</div>");
var _368=new Ext.XTemplate("<div style=\"width: 496px; height: 70px; text-align: center; margin-top: 50px;\">","<div style=\"color: #ffffff; font-face: Verdana,Arial,Helvetica,sans-serif; font-size: 14px; text-transform: none;\">No Screenshots</div>","</div>");
var _369=new Ext.XTemplate("<div name=\"panel-scroller-root\" class=\"gd-scrolling-item-wrapper\">","<div class=\"gd-scrolling-items-left-col\">","<img name=\"panel-scroller-left-arrow\" id=\"gd-left-arrow\" src=\""+SwitchGames.imageUrl+"common/arrows/btn-arrow-left-sm.gif\" height=\"21\" width=\"21\" alt=\"Scroll Left\" class=\"gd-scrolling-left-arrow\"/>","</div>","<div id=\"gd-screenshot-panel\" name=\"panel-scroller-content-root\" totalpanels=\"{[values.length]}\" currentpanel=\"0\" class=\"gd-scrolling-items-center-col\">","<tpl for=\".\">","<div name=\"panel-scroller-content\" {[SwitchGames.Utility.getScrollerItemDisplay(xindex)]} class=\"gd-scrolling-items-center-col-inner\">","<img src=\"{[SwitchGames.Utility.getScreenShotValue(values.screenshot1)]}\" width=\"110\" height=\"97\" alt=\"\"/>&nbsp;&nbsp;&nbsp;","<img src=\"{[SwitchGames.Utility.getScreenShotValue(values.screenshot2)]}\" width=\"110\" height=\"97\" alt=\"\"/>&nbsp;&nbsp;&nbsp;","<img src=\"{[SwitchGames.Utility.getScreenShotValue(values.screenshot3)]}\" width=\"110\" height=\"97\" alt=\"\"/>","</div>","</tpl>","</div>","<div class=\"gd-scrolling-items-right-col\">","<img name=\"panel-scroller-right-arrow\" id=\"gd-right-arrow\" src=\""+SwitchGames.imageUrl+"common/arrows/btn-arrow-right-sm.gif\" height=\"21\" width=\"21\" alt=\"Scroll Right\" class=\"gd-scrolling-right-arrow\"/>","</div>","</div>");
var _36a={};
_36a.type=type;
_36a.itemid=_365;
_36a.pane="get_item_detail";
Ext.Ajax.request({url:"data/common/utilities.php",params:_36a,success:function(_36b,_36c){
var data=Ext.util.JSON.decode(_36b.responseText);
if(data.error!=undefined&&data.error!=null){
SwitchGames.Dialogs.itemDetailDialog.hide();
SwitchGames.Dialogs.showErrorDialog(data.error);
}else{
_367.overwrite(SwitchGames.Dialogs.itemDetailDialog.body,data);
if(data.screenshots==undefined||data.screenshots==null||data.screenshots.length==0){
_368.overwrite(Ext.get("gd-screenshots"),{});
}else{
_369.overwrite(Ext.get("gd-screenshots"),data.screenshots);
SwitchGames.Utility.setupLeftRightScrolling(Ext.get("gd-screenshot-panel"),Ext.get("gd-left-arrow"),Ext.get("gd-right-arrow"),"slide",false,null,null,null);
}
SwitchGames.Dialogs.itemDetailDialog.show();
}
},failure:function(_36e,_36f){
SwitchGames.Dialogs.showErrorDialog("Error contacting server.  Try again later");
}});
};
if(SwitchGames.Dialogs.tradeOfferItemDetailDialog==undefined||SwitchGames.Dialogs.tradeOfferItemDetailDialog==null){
SwitchGames.Dialogs.tradeOfferItemDetailDialog=SwitchGames.Dialogs.createDialog("","sg-trade-offer-item-detail-dlg","Item Detail",580,560,"sg-window");
}
SwitchGames.Dialogs.showTradeOfferItemDetailDialog=function(_370,type,_372){
var _373=new Ext.XTemplate("<div class=\"gd-rnd-box-wrapper\" style=\"width:520px;\">","<div class=\"gd-rnd-box-top\"><div></div></div>","<div class=\"gd-rnd-box-body\">","<div class=\"rb-box-ltg\">","<div class=\"rb-box-ltg-top\"><div></div></div>","<div class=\"rb-box-ltg-content\">","<div class=\"to-gd-game-condition\">","<span style=\"text-transform: uppercase; font-size: 14px;\">{screen_name}</span><span> says:</span>","<ul>","<li>Item is in {[SwitchGames.Utility.getGameCondition(values.condition)]} condition</li>","<li>{[SwitchGames.Utility.getBrandNew(values.brand_new)]}</li>","<li>{[SwitchGames.Utility.getScratches(values.scratches)]}</li>","<li>{[SwitchGames.Utility.getHasManual(values.has_manual)]}</li>","<li>{[SwitchGames.Utility.getOriginalBox(values.original_box)]}</li>","</ul>","</div>","<div class=\"to-gd-game-notes\">","<span>Item notes from <span style=\"text-transform: uppercase; font-size: 14px;\">{screen_name}</span>:</span>","<div class=\"to-gd-game-notes-scroller\">{notes}</div>","</div>","<div class=\"clear\"></div>","</div>","<div class=\"rb-box-ltg-bottom\"><div></div></div>","</div>","<div style=\"height: 10px;\"></div>","<div style=\"width: 118px; height: 200px;\" class=\"gd-gamebox\">","<img style=\"border: 1px solid #999999;\" onload=\"SwitchGames.Utility.scaleAndCenterImageInParent(this);\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\" alt=\"\" />","</div>","<div class=\"gd-game-info\">","<tpl for=\"game\">","<div class=\"gd-game-name\">{game_name}</div>","<div class=\"gd-game-console\">{platform_name}</div>","<div class=\"gd-game-publish-info\">ESRB:&nbsp;<span>{esrb}</span>&nbsp;&nbsp;Publisher:&nbsp;<span>{publisher}</span><br/>Released:&nbsp;<span>{date_released}</span>&nbsp;&nbsp;Genre:&nbsp;<span>{genre}/{subgenre}</div>","<div class=\"gd-desc\">","{[SwitchGames.Utility.markDescriptionTags(values.description).nl2br()]}","</div>","</tpl>","<tpl for=\"platform\">","<div class=\"gd-game-name\">{platform_name}</div>","<div class=\"gd-game-publish-info\">Released:&nbsp;<span>{date_released}</span></div>","<div class=\"gd-desc\">","{[SwitchGames.Utility.markDescriptionTags(values.description).nl2br()]}","</div>","</tpl>","<tpl for=\"accessory\">","<div class=\"gd-game-name\">{accessory_name}</div>","<div class=\"gd-game-console\">{platform_name}</div>","<div class=\"gd-game-publish-info\">Released:&nbsp;<span>{date_released}</span></div>","<div class=\"gd-desc\">","{[SwitchGames.Utility.markDescriptionTags(values.description).nl2br()]}","</div>","</tpl>","</div>","<div class=\"clear\"></div>","<div class=\"gd-grey-divider\"></div>","<div id=\"to-gd-screenshots\"></div>","</div>","<div class=\"gd-rnd-box-bottom\"><div></div></div>","</div>");
var _374=new Ext.XTemplate("<div style=\"width: 496px; height: 100px; text-align: center; margin-top: 50px;\">","<div style=\"color: #ffffff; font-face: Verdana,Arial,Helvetica,sans-serif; font-size: 14px; text-transform: none;\">No Screenshots</div>","</div>");
var _375=new Ext.XTemplate("<div name=\"panel-scroller-root\" class=\"gd-scrolling-item-wrapper\">","<div class=\"to-gd-scrolling-items-left-col\">","<img name=\"panel-scroller-left-arrow\" id=\"to-gd-left-arrow\" src=\""+SwitchGames.imageUrl+"common/arrows/btn-arrow-left-sm.gif\" height=\"21\" width=\"21\" alt=\"Scroll Left\" class=\"gd-scrolling-left-arrow\"/>","</div>","<div id=\"to-gd-screenshot-panel\" name=\"panel-scroller-content-root\" totalpanels=\"{[values.length]}\" currentpanel=\"0\" class=\"gd-scrolling-items-center-col\">","<tpl for=\".\">","<div name=\"panel-scroller-content\" {[SwitchGames.Utility.getScrollerItemDisplay(xindex)]} class=\"gd-scrolling-items-center-col-inner\">","<img src=\"{[SwitchGames.Utility.getScreenShotValue(values.screenshot1)]}\" width=\"110\" height=\"97\" alt=\"\"/>&nbsp;&nbsp;&nbsp;","<img src=\"{[SwitchGames.Utility.getScreenShotValue(values.screenshot2)]}\" width=\"110\" height=\"97\" alt=\"\"/>&nbsp;&nbsp;&nbsp;","<img src=\"{[SwitchGames.Utility.getScreenShotValue(values.screenshot3)]}\" width=\"110\" height=\"97\" alt=\"\"/>","</div>","</tpl>","</div>","<div class=\"gd-scrolling-items-right-col\">","<img name=\"panel-scroller-right-arrow\" id=\"to-gd-right-arrow\" src=\""+SwitchGames.imageUrl+"common/arrows/btn-arrow-right-sm.gif\" height=\"21\" width=\"21\" alt=\"Scroll Right\" class=\"gd-scrolling-right-arrow\"/>","</div>","</div>");
var _376={};
_376.type=type;
_376.itemid=_370;
_376.listingid=_372;
_376.pane="get_item_detail";
Ext.Ajax.request({url:"data/common/utilities.php",params:_376,success:function(_377,_378){
var data=Ext.util.JSON.decode(_377.responseText);
if(data.error!=undefined&&data.error!=null){
SwitchGames.Dialogs.tradeOfferItemDetailDialog.hide();
SwitchGames.Dialogs.showErrorDialog(data.error);
}else{
_373.overwrite(SwitchGames.Dialogs.tradeOfferItemDetailDialog.body,data);
if(data.screenshots==undefined||data.screenshots==null||data.screenshots.length==0){
_374.overwrite(Ext.get("to-gd-screenshots"),{});
}else{
_375.overwrite(Ext.get("to-gd-screenshots"),data.screenshots);
SwitchGames.Utility.setupLeftRightScrolling(Ext.get("to-gd-screenshot-panel"),Ext.get("to-gd-left-arrow"),Ext.get("to-gd-right-arrow"),"slide",false,null,null,null);
}
SwitchGames.Dialogs.tradeOfferItemDetailDialog.show();
}
},failure:function(_37a,_37b){
SwitchGames.Dialogs.showErrorDialog("Error contacting server.  Try again later");
}});
};
SwitchGames.Buddy={};
SwitchGames.Buddy.add=function(_37c,_37d){
var _37c=_37c;
var _37d=_37d;
var _37e=new Ext.XTemplate("<div id=\"sg-buddy-add-main\" buddyid=\"{buddyId}\" style=\"text-align: center;\">","<div>","Send request to {screen_name}?","</div>","<div>&#160;</div>","<div>","<img name=\"buddy-yes\" id=\"sg-buddy-add-yes-btn\" class=\"sg-buddy-add-yes-btn\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-yes.png\" />&#160;&#160;&#160;","<img name=\"buddy-no\" id=\"sg-buddy-add-no-btn\"  class=\"sg-buddy-add-no-btn\"  src=\""+SwitchGames.imageUrl+"common/buttons/btn-no.png\" />","</div>","</div>","<div id=\"sg-buddy-add-finish\" class=\"sg-buddy-add-finish\" style=\"display: none; margin-top: 25px !important; padding: 0px; text-align: center;\"><div style=\"margin: 20px 0;\" class=\"sg-rate-user-text\">Buddy request has been sent.</div></div>");
if(SwitchGames.Buddy.addBuddyDialog==undefined||SwitchGames.Buddy.addBuddyDialog==null){
SwitchGames.Buddy.addBuddyDialog=SwitchGames.Dialogs.createDialog("","sg-buddy-add-dlg","Buddy Request",330,120,"sg-window");
SwitchGames.Buddy.addBuddyDialog.body.on("click",function(e,t){
SwitchGames.Buddy.addBuddyDialog.hide();
},this,{delegate:"img[@name=\"buddy-no\"]"});
SwitchGames.Buddy.addBuddyDialog.body.on("click",function(e,t){
var _383={};
_383.subject="New Buddy Request";
_383.body="I would like to be your buddy!";
_383.pane="send_message";
_383.member_id=Ext.get("sg-buddy-add-main").dom.getAttribute("buddyid");
_383.msg_type="buddy_request";
_383.thread_state="open";
_383.thread_id=null;
Ext.Ajax.request({url:"data/community/messages.php",params:_383,success:function(_384,_385){
var data=Ext.util.JSON.decode(_384.responseText);
if(data.error!=undefined&&data.error!=null){
SwitchGames.Buddy.addBuddyDialog.hide();
SwitchGames.Dialogs.showErrorDialog(data.error);
}else{
var _387=Ext.get("sg-buddy-add-main");
var _388=Ext.get("sg-buddy-add-finish");
_387.slideOut("l",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_388.slideIn("r",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
var _389=SwitchGames.Buddy.addBuddyDialog.body.getHeight();
var _38a=310;
var _38b=_38a-_389;
var newY=SwitchGames.Buddy.addBuddyDialog.el.getTop()-(Math.floor(_38b/2));
SwitchGames.Buddy.addBuddyDialog.el.shift({y:newY,duration:0.5,easing:"backBoth",concurrent:true});
SwitchGames.Buddy.addBuddyDialog.body.shift({height:_38a,duration:0.5,easing:"backBoth",concurrent:true,callback:function(){
SwitchGames.Ads.AdManager.appendAd(_388,"transactional","buddyrequestsent");
}});
}});
}});
if(SwitchGames.Messages){
SwitchGames.Messages.load();
}
}
},failure:function(_38d,_38e){
SwitchGames.Dialogs.showErrorDialog("Error contacting server.  Try again later");
}});
},this,{delegate:"img[@name=\"buddy-yes\"]"});
}
var _38f={screen_name:_37d,buddyId:_37c};
var _390=_37e.apply(_38f);
SwitchGames.Buddy.addBuddyDialog.syncSize();
SwitchGames.Buddy.addBuddyDialog.setHeight(120);
SwitchGames.Buddy.addBuddyDialog.body.dom.innerHTML=_390;
SwitchGames.Buddy.addBuddyDialog.show();
};
SwitchGames.Buddy.remove=function(_391,_392){
var _391=_391;
var _392=_392;
var _393=new Ext.XTemplate("<div id=\"sg-buddy-remove-main\" buddyid=\"{buddyId}\" style=\"text-align: center;\">","<div>","Remove {screen_name} from your Buddy List?","</div>","<div>&#160;</div>","<div>","<img name=\"remove-buddy-yes\" id=\"sg-buddy-remove-yes-btn\" class=\"sg-buddy-remove-yes-btn\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-yes.png\" />&#160;&#160;&#160;","<img name=\"remove-buddy-no\" id=\"sg-buddy-remove-no-btn\"  class=\"sg-buddy-remove-no-btn\"  src=\""+SwitchGames.imageUrl+"common/buttons/btn-no.png\" />","</div>","</div>","<div id=\"sg-buddy-remove-finish\" style=\"display: none;\tmargin-top: 25px; padding: 0px; text-align: center!important;\">Buddy removed.</div>");
if(SwitchGames.Buddy.removeBuddyDialog==undefined||SwitchGames.Buddy.removeBuddyDialog==null){
SwitchGames.Buddy.removeBuddyDialog=SwitchGames.Dialogs.createDialog("","sg-buddy-remove-dlg","Delete Buddy",400,120,"sg-window");
SwitchGames.Buddy.removeBuddyDialog.body.on("click",function(e,t){
SwitchGames.Buddy.removeBuddyDialog.hide();
},this,{delegate:"img[@name=\"remove-buddy-no\"]"});
SwitchGames.Buddy.removeBuddyDialog.body.on("click",function(e,t){
var _398={};
_398.pane="remove_buddy";
_398.buddy_id=Ext.get("sg-buddy-remove-main").dom.getAttribute("buddyid");
Ext.Ajax.request({url:"data/community/buddy_list.php",params:_398,success:function(_399,_39a){
var data=Ext.util.JSON.decode(_399.responseText);
if(data.error!=undefined&&data.error!=null){
SwitchGames.Dialogs.showErrorDialog(data.error);
}else{
var _39c=Ext.get("sg-buddy-remove-main");
var _39d=Ext.get("sg-buddy-remove-finish");
_39c.slideOut("l",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_39d.slideIn("r",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false});
}});
if(SwitchGames.BuddyList){
SwitchGames.BuddyList.load();
}
if(SwitchGames.Messages){
SwitchGames.Messages.load();
}
if(SwitchGames.LiveTransactions){
SwitchGames.LiveTransactions.load();
}
if(SwitchGames.TransactionHistory){
SwitchGames.TransactionHistory.load();
}
}
},failure:function(_39e,_39f){
SwitchGames.Dialogs.showErrorDialog("Error connecting to server.  Try again later");
}});
},this,{delegate:"img[@name=\"remove-buddy-yes\"]"});
}
var _3a0={screen_name:_392,buddyId:_391};
var _3a1=_393.apply(_3a0);
SwitchGames.Buddy.removeBuddyDialog.body.dom.innerHTML=_3a1;
SwitchGames.Buddy.removeBuddyDialog.show();
};
SwitchGames.Member={};
SwitchGames.Member.visitMemberSite=function(_3a2){
window.open("gamer/"+_3a2,"gamer_window","location=yes,toolbar=yes,menubar=yes,directories=yes,status=yes,resizable=yes,scrollbars=yes,height=undefined,width=undefined",false);
};
SwitchGames.Member.rateMember=function(_3a3,_3a4,_3a5,_3a6){
var _3a7=new Ext.XTemplate("<div id=\"sg-rate-user-main\" class=\"sg-rate-user\">","<div class=\"sg-rate-user-blank\">&#160;</div>","<div class=\"sg-rate-user-text\">Doing business with {screen_name} was:</div>","<div class=\"sg-rate-user-blank\">&#160;</div>","<div class=\"sg-rate-user-text\">","<input id=\"sg-rate-user-rating-positive\" class=\"sg-rate-user-radio\" type=\"radio\" name=\"sg-rate-user-rating\" value=\"Positive\" />&#160;<span class=\"sg-rate-user-positive\">Positive</span>&#160;&#160;&#160;&#160;","<input id=\"sg-rate-user-rating-negative\" class=\"sg-rate-user-radio\" type=\"radio\" name=\"sg-rate-user-rating\" value=\"Negative\" />&#160;<span class=\"sg-rate-user-negative\">Negative</span>","</div>","<div class=\"sg-rate-user-blank\">&#160;</div>","<div class=\"sg-rate-user-text\">Comment on the transaction (optional):</div>","<textarea wrap=\"virtual\" id=\"sg-rate-user-comment\" maxlength=\"255\" onkeydown='return SwitchGames.Utility.limitTextFieldLength(event);' class=\"sg-rate-user-comment\" name=\"sg-rate-user-comment\"></textarea>","<div class=\"sg-rate-user-blank\">&#160;</div>","<div class=\"sg-rate-user-blank\">","<img id=\"sg-rate-user-submit-btn\" class=\"sg-rate-user-submit-btn\" src=\""+SwitchGames.imageUrl+"common/buttons/submit-button.png\" />","<span style=\"line-height: 24px; display: none;\"><img style=\"vertical-align: middle;\" src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" /><span> Rating {screen_name}...</span></span>","</div>","</div>","<div id=\"sg-rate-user-finish\" style=\"display: none;\" class=\"sg-rate-user-finish\"><div class=\"sg-rate-user-text\">Rating Complete</div></div>");
if(SwitchGames.Member.rateUserDialog==undefined||SwitchGames.Member.rateUserDialog==null){
SwitchGames.Member.rateUserDialog=SwitchGames.Dialogs.createDialog("","sg-rate-user-dlg","Rate Member",380,420,"sg-window");
}
var _3a8={screen_name:_3a5};
_3a7.overwrite(SwitchGames.Member.rateUserDialog.body,_3a8);
var _3a3=_3a3;
var _3a6=_3a6;
var _3a4=_3a4;
Ext.fly("sg-rate-user-submit-btn").on("click",function(e,t){
var _3ab=Ext.fly("sg-rate-user-comment").dom.value;
var _3ac=Ext.fly("sg-rate-user-rating-positive").dom.checked;
var _3ad=Ext.fly("sg-rate-user-rating-negative").dom.checked;
if((_3ac==true&&_3ad==true)||(_3ac==false&&_3ad==false)){
SwitchGames.Dialogs.showErrorDialog("You must select one and only one rating.  Try again");
}else{
var _3ae={};
_3ae.pane="add_rating";
_3ae.rating=_3ac?1:0;
if(_3ab.length>0){
_3ae.comment=_3ab;
}
_3ae.member_id=_3a3;
_3ae.deal_id=_3a4;
var _3af=Ext.get("sg-rate-user-submit-btn");
_3af.dom.style.display="none";
_3af.next().dom.style.display="inline";
Ext.Ajax.request({url:"data/switch_center/rate_member.php",params:_3ae,success:function(_3b0,_3b1){
_3af.dom.style.display="";
_3af.next().dom.style.display="none";
var data=Ext.util.JSON.decode(_3b0.responseText);
if(data.error!=undefined&&data.error!=null){
SwitchGames.Dialogs.showErrorDialog(data.error);
}else{
var _3b3=Ext.get("sg-rate-user-main");
var _3b4=Ext.get("sg-rate-user-finish");
_3b3.slideOut("l",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_3b4.slideIn("r",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false});
}});
SwitchGames.Member.rateUserDialog.on("hide",function(e,t){
SwitchGames.LiveTransactions.load();
});
}
},failure:function(_3b7,_3b8){
_3af.dom.style.display="";
_3af.next().dom.style.display="none";
SwitchGames.Dialogs.showErrorDialog("Error connecting to server.  Try again later");
}});
}
});
SwitchGames.Member.rateUserDialog.show();
};
SwitchGames.Member.messageMember=function(_3b9,_3ba,_3bb,_3bc){
var _3bd=new Ext.XTemplate("<div id=\"sg-message-user-main\" class=\"sg-message-user\">","<div class=\"sg-message-user-blank-5\">&#160;</div>","<div class=\"sg-message-user-text\">You are sending a message to:</div>","<div class=\"sg-message-user-text\"><b>{screen_name}</b></div>","<div class=\"sg-message-user-blank\">&#160;</div>","<div class=\"sg-message-user-text\">Subject:&#160;&#160;<input id=\"sg-message-user-subject\" style=\"width: 200px;\" name=\"subject\" maxlength=\"50\" value=\"{subject}\" /></div>","<div class=\"sg-message-user-blank-5\">&#160;</div>","<textarea wrap=\"virtual\" id=\"sg-message-user-body\" maxlength=\"2048\" onkeydown='return SwitchGames.Utility.limitTextFieldLength(event);' class=\"sg-message-user-body\" name=\"sg-message-user-comment\"></textarea>","<div class=\"sg-message-user-blank\">&#160;</div>","<div class=\"sg-message-user-blank\">","<img id=\"sg-message-user-submit-btn\" class=\"sg-message-user-submit-btn\" src=\""+SwitchGames.imageUrl+"common/buttons/submit-button.png\" />","<span style=\"line-height: 24px; display: none;\"><img style=\"vertical-align: middle;\" src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" /><span> Sending message...</span></span>","</div>","</div>","<div id=\"sg-message-user-finish\" style=\"display: none;\" class=\"sg-message-user-finish\"><div class=\"sg-message-user-text\">Message Sent</div></div>");
if(SwitchGames.Member.messageMemberDialog==undefined||SwitchGames.Member.messageMemberDialog==null){
SwitchGames.Member.messageMemberDialog=SwitchGames.Dialogs.createDialog("","sg-message-member-dlg","Send Message",385,430,"sg-window");
}
var _3b9=_3b9;
var _3be=_3bb;
var _3bf={screen_name:_3ba};
var _3bc=_3bc;
if(_3be){
_3bf["subject"]=_3be;
}else{
_3bf["subject"]="";
}
_3bd.overwrite(SwitchGames.Member.messageMemberDialog.body,_3bf);
Ext.fly("sg-message-user-submit-btn").on("click",function(e,t){
var _3c2=Ext.get("sg-message-user-subject").dom.value;
var body=Ext.get("sg-message-user-body").dom.value;
if(_3c2.length==0){
SwitchGames.Dialogs.showErrorDialog("Subject required");
return;
}
if(body.length==0){
SwitchGames.Dialogs.showErrorDialog("Message body required");
return;
}
var _3c4={};
_3c4.subject=_3c2;
_3c4.body=body;
_3c4.pane="send_message";
_3c4.member_id=_3b9;
_3c4.msg_type="pm";
_3c4.thread_state="open";
_3c4.thread_id=_3bc;
var _3c5=Ext.get("sg-message-user-submit-btn");
_3c5.dom.style.display="none";
_3c5.next().dom.style.display="inline";
Ext.Ajax.request({url:"data/community/messages.php",params:_3c4,success:function(_3c6,_3c7){
_3c5.dom.style.display="";
_3c5.next().dom.style.display="none";
var data=Ext.util.JSON.decode(_3c6.responseText);
if(data.error!=undefined&&data.error!=null){
SwitchGames.Dialogs.showErrorDialog(data.error);
}else{
var _3c9=Ext.get("sg-message-user-main");
var _3ca=Ext.get("sg-message-user-finish");
_3c9.slideOut("l",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_3ca.slideIn("r",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
SwitchGames.Ads.AdManager.appendAd(_3ca,"transactional","messagesent");
}});
}});
if(SwitchGames.Messages){
SwitchGames.Messages.load();
}
if(SwitchGames.BuddyList){
SwitchGames.BuddyList.load();
}
}
},failure:function(_3cb,_3cc){
_3c5.dom.style.display="";
_3c5.next().dom.style.display="none";
SwitchGames.Dialogs.showErrorDialog("Error contacting server.  Try again later");
}});
});
SwitchGames.Member.messageMemberDialog.show();
};
SwitchGames.Dialogs.reportBug=function(){
var _3cd=new Ext.XTemplate("<form id=\"bug-submit-form\" name=frmSubmit ACTION=http://www.bughost.com/websubmit.asp METHOD=POST>","<div id=\"bug-submit-main\">","<img src=\""+SwitchGames.imageUrl+"core-layout-images/page-body/beta_2_0_report_bug_logo.png\" width=\"76\" height=\"30\" style=\"margin-left:28px;\"/>","<input id=\"x_Login\" type=\"hidden\" name=\"x_Login\" value=\"A8ACZ8E8A7YQC1NSOB89\">","<table class=\"table-form\" style=\"margin:15px 0px 0px 15px;\">","<tr>","<td style=\"width:170px;\" class=\"label-rt\"><label class=\"label-caps\">Your EMail or Username</label></td>","<td><input id=\"x_ReportedBy\" name=\"x_ReportedBy\" size=\"50\" maxlength=\"128\"  class=\"input-text\"/>","</td>","</tr>","<tr>","<td class=\"label-rt\"><label class=\"label-caps\">Site Area</label></td>","<td><select id=\"x_Module\" name=\"x_Module\">","<option selected value=\"0\">&nbsp;</option>","<option value=\"33\">[Other...]</option>","<option value=\"23\">About Page</option>","<option value=\"2\">Account Creation</option>","<option value=\"24\">Advertising Page</option>","<option value=\"27\">Community: [Other...]</option>","<option value=\"14\">Community: Buddies</option>","<option value=\"15\">Community: My Gamer Page</option>","<option value=\"12\">Community: Rate User</option>","<option value=\"13\">Community: Search Users</option>","<option value=\"1\">Home Page</option>","<option value=\"28\">My Account: [Other...]</option>","<option value=\"22\">My Account: Account Status</option>","<option value=\"21\">My Account: Billing &amp; Shipping</option>","<option value=\"20\">My Account: Payments</option>","<option value=\"19\">My Account: Preferences</option>","<option value=\"29\">Post Office: [Other...]</option>","<option value=\"16\">Post Office: Auto Labels</option>","<option value=\"18\">Post Office: History/Reprint</option>","<option value=\"17\">Post Office: Manual Labels</option>","<option value=\"30\">Search: [Other...]</option>","<option value=\"5\">Search: Advanced</option>","<option value=\"3\">Search: Predictive</option>","<option value=\"4\">Search: Results</option>","<option value=\"35\">Server/Admin Stuff</option>","<option value=\"34\">Sitewide</option>","<option value=\"31\">SwitchCenter: [Other...]</option>","<option value=\"6\">SwitchCenter: Live Transaction</option>","<option value=\"7\">SwitchCenter: Messages</option>","<option value=\"8\">SwitchCenter: Transact History</option>","<option value=\"26\">Terms of Use/Privacy</option>","<option value=\"25\">Ticketing (Feedbck, Cust Serv)</option>","<option value=\"32\">Trade Tools: [Other...]</option>","<option value=\"10\">Trade Tools: My Stuff</option>","<option value=\"11\">Trade Tools: SwitchBot</option>","<option value=\"9\">Trade Tools: Wishlist</option>","</select>","</td>","</tr>","<tr>","<td valign=\"top\" class=\"label-rt\"><label class=\"label-caps\">Summary</label></td>","<td><textarea wrap=\"virtual\" maxlength=\"255\" onkeydown='return SwitchGames.Utility.limitTextFieldLength(event);' id=\"x_Summary\"  name=\"x_Summary\" class=\"textarea\" cols=60 rows=2></textarea>","</td>","</tr>","<tr>","<td valign=\"top\" class=\"label-rt\"><label class=\"label-caps\">Detailed Description</label></td>","<td><textarea wrap=\"virtual\" maxlength=\"5000\" onkeydown='return SwitchGames.Utility.limitTextFieldLength(event);' id=\"x_Description\" name=\"x_Description\" class=\"textarea\" cols=\"60\" rows=\"10\"></textarea>","</td>","</tr>","<tr>","<td class=\"label-rt\"><label class=\"label-caps\">OS &amp; Browser</label></td>","<td><select id=\"x_OS\" name=\"x_OS\">","<option selected value=\"0\">&nbsp;</option>","<option value=\"6\">Mac OS X: Firefox</option>","<option value=\"7\">Mac OS X: Internet Explorer</option>","<option value=\"8\">Mac OS X: Other Browser</option>","<option value=\"5\">Mac OS X: Safari</option>","<option value=\"21\">Mac OS X: WebKit</option>","<option value=\"10\">Windows 2000: Firefox</option>","<option value=\"2\">Windows 2000: IE6</option>","<option value=\"9\">Windows 2000: IE7</option>","<option value=\"13\">Windows 2000: Other Browser</option>","<option value=\"3\">Windows 2003: Firefox</option>","<option value=\"11\">Windows 2003: IE6</option>","<option value=\"12\">Windows 2003: IE7</option>","<option value=\"14\">Windows 2003: Other Browser</option>","<option value=\"16\">Windows Vista: Firefox</option>","<option value=\"4\">Windows Vista: IE6</option>","<option value=\"15\">Windows Vista: IE7</option>","<option value=\"17\">Windows Vista: Other Browser</option>","<option value=\"23\">Windows Vista: Safari</option>","<option value=\"19\">Windows XP: Firefox</option>","<option value=\"1\">Windows XP: IE6</option>","<option value=\"18\">Windows XP: IE7</option>","<option value=\"20\">Windows XP: Other Browser</option>","<option value=\"22\">Windows XP: Safari</option>","</select>","</td>","</tr>","<tr>","<td class=\"label-rt\"><label class=\"label-caps\">Type of Bug</label></td>","<td><select id=\"x_BugType\" name=\"x_BugType\">","<option selected value=\"0\">&nbsp;</option>","<option value=\"8\">Artwork Problem</option>","<option value=\"1\">Bothersome (not really a bug)</option>","<option value=\"2\">Data Loss</option>","<option value=\"7\">Design/Layout Problem</option>","<option value=\"6\">Form Problem</option>","<option value=\"4\">Functional Problem</option>","<option value=\"5\">Reminder / To Do</option>","<option value=\"3\">Suggestion/Wishlist</option>","</select>","</td>","</tr>","<tr>","<td>&nbsp;</td>","<td>&nbsp;</td>","</tr>","<tr>","<td>&nbsp;","<input id=\"x_Application\" name=\"x_Application\" size=\"50\" maxlength=\"128\" type=\"hidden\" value=\"2\"/>","<input id=\"x_Severity\" name=\"x_Severity\" size=\"50\" maxlength=128 type=\"hidden\" value=\"1\"/>","<input id=\"x_AssignedTo\" name=\"x_AssignedTo\" size=\"50\" maxlength=\"128\" type=\"hidden\" value=\"5\"/>","</td>","<td>","<img id=\"bug-submit-btn\" style=\"cursor: pointer; padding-left: 70px;\" src=\""+SwitchGames.imageUrl+"common/buttons/submit-button.png\" width=\"102\" height=\"25\"/>","</td>","</tr>","</table>","</div>","<div id=\"bug-submit-finish\" style=\"display: none;\" style=\"\">","<div style=\"font-size: 14px; font-weight: normal;padding-top: 200px; text-align: center;\">Bug Submitted</div>","<div style=\"font-size: 14px; font-weight: normal;padding-top: 0px; text-align: center;\">Thank you!</div>","</div>","</form>");
if(SwitchGames.Dialogs.reportBugDialog==undefined||SwitchGames.Dialogs.reportBugDialog==null){
SwitchGames.Dialogs.reportBugDialog=SwitchGames.Dialogs.createDialog("","sg-report-bug-dlg","Report A Bug",650,550,"sg-window");
_3cd.overwrite(SwitchGames.Dialogs.reportBugDialog.body,{});
Ext.get("bug-submit-btn").on("click",function(e,t){
var _3d0={pane:"submit_bug"};
var _3d1={x_Login:Ext.fly("x_Login").getValue(),x_ReportedBy:Ext.fly("x_ReportedBy").getValue(),x_Module:Ext.fly("x_Module").getValue(),x_Summary:Ext.fly("x_Summary").getValue(),x_Description:Ext.fly("x_Description").getValue(),x_OS:Ext.fly("x_OS").getValue(),x_BugType:Ext.fly("x_BugType").getValue(),x_Application:Ext.fly("x_Application").getValue(),x_Severity:Ext.fly("x_Severity").getValue(),x_AssignedTo:Ext.fly("x_AssignedTo").getValue()};
var _3d2="";
if(_3d1.x_ReportedBy.length==0){
_3d2+="You must enter an email address or username\n";
}
if(_3d1.x_Summary.length==0){
_3d2+="You must enter a summary\n";
}
if(_3d1.x_Description.length==0){
_3d2+="You must enter a description\n";
}
if(_3d1.xModule==0){
_3d2+="You must select a module\n";
}
if(_3d1.x_OS==0){
_3d2+="You must select an operating system\n";
}
if(_3d1.x_BugType==0){
_3d2+="You must select a bug type\n";
}
if(_3d2.length!=0){
alert(_3d2);
return;
}
Ext.Ajax.request({url:"data/common/utilities.php",params:_3d0,form:"bug-submit-form",success:function(_3d3,_3d4){
var _3d5=Ext.get("bug-submit-main");
var _3d6=Ext.get("bug-submit-finish");
_3d5.slideOut("l",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_3d6.slideIn("r",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false});
}});
},failure:function(_3d7,_3d8){
SwitchGames.Dialogs.showErrorDialog("Could not submit bug.  Please try again.");
}});
});
}
Ext.fly("x_ReportedBy").dom.value="";
Ext.fly("x_Module").dom.value="0";
Ext.fly("x_Summary").dom.value="";
Ext.fly("x_Description").dom.value="";
Ext.fly("x_OS").dom.value="0";
Ext.fly("x_BugType").dom.value="0";
Ext.fly("x_Application").dom.value="";
Ext.fly("x_Severity").dom.value="";
Ext.fly("x_AssignedTo").dom.value="";
if(SwitchGames.userInfo.email!=undefined){
Ext.fly("x_ReportedBy").dom.value=SwitchGames.userInfo.email;
}
var _3d9=Ext.get("bug-submit-main");
var _3da=Ext.get("bug-submit-finish");
_3da.setDisplayed(false);
_3d9.setDisplayed(true);
SwitchGames.Dialogs.reportBugDialog.show();
};
SwitchGames.Search={};
SwitchGames.Search.searchTree=null;
SwitchGames.Search.nav_combo_data_store=new Ext.data.JsonStore({url:"data/search/nav.php",root:"items",totalProperty:"total",id:"id",fields:["id","type","name","platform","publisher","esrb","date_released","photo_cover","manufacturer"]});
SwitchGames.Search.nav_combo_data_template=new Ext.XTemplate("<tpl for=\".\">","<div class=\"search-item\">","<div class=\"img-container\">","<img src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\"/>","</div>","<div class=\"game-info-container\">","<h2>{name}</h2>","{[values.platform != null ? \"<h2 style=\\\"color:#bebfbf!important;\\\">Platform: \"+values.platform+\"</h2>\" : \"\"]}","{[values.manufacturer != null ? \"<h3>Manufacturer: \"+values.manufacturer+\"</h3>\" : \"\"]}","{[values.publisher != null ? \"<h3><span>Publisher:</span>  \"+values.publisher+\"</h3>\" : \"\"]}","<h3><span>Released:</span>  {date_released}</h3>","</div>","</div>","</tpl>");
SwitchGames.Search.itemTypes=[["all","All"],["game","Games"],["platform","Consoles"],["accessory","Accessories"]];
SwitchGames.Search.typeStore=new Ext.data.SimpleStore({fields:["type","typeName"],data:SwitchGames.Search.itemTypes});
SwitchGames.Search.genres=[["all","All"],["Action","Action"],["Adventure","Adventure"],["Educational","Educational"],["Fighting","Fighting"],["Puzzle","Puzzle"],["Racing","Racing"],["Role-playing","Role-playing"],["Shooter","Shooter"],["Simulation","Simulation"],["Sports","Sports"],["Strategy","Strategy"],["Traditional","Traditional"]];
SwitchGames.Search.genreStore=new Ext.data.SimpleStore({fields:["genre","genreName"],data:SwitchGames.Search.genres});
SwitchGames.Search.platforms=[["all","All"]];
for(var i=0,len=SwitchGames.Utility.platformList.consoles.length;i<len;i++){
SwitchGames.Search.platforms.push([SwitchGames.Utility.platformList.consoles[i].name,SwitchGames.Utility.platformList.consoles[i].name]);
}
for(var i=0,len=SwitchGames.Utility.platformList.handhelds.length;i<len;i++){
SwitchGames.Search.platforms.push([SwitchGames.Utility.platformList.handhelds[i].name,SwitchGames.Utility.platformList.handhelds[i].name]);
}
for(var i=0,len=SwitchGames.Utility.platformList.computers.length;i<len;i++){
SwitchGames.Search.platforms.push([SwitchGames.Utility.platformList.computers[i].name,SwitchGames.Utility.platformList.computers[i].name]);
}
for(var i=0,len=SwitchGames.Utility.platformList.vintage.length;i<len;i++){
SwitchGames.Search.platforms.push([SwitchGames.Utility.platformList.vintage[i].name,SwitchGames.Utility.platformList.vintage[i].name]);
}
SwitchGames.Search.platformStore=new Ext.data.SimpleStore({fields:["platform","platformName"],data:SwitchGames.Search.platforms});
SwitchGames.Search.sortByStore=new Ext.data.SimpleStore({fields:["sortName","sortValue"],data:[["Newest to oldest","new_to_old"],["Oldest to newest","old_to_new"],["Price: low to high","low_to_high"],["Price: high to low","high_to_low"],["Bestselling","bestselling"]]});
SwitchGames.Search.createFilter=function(_3dd,_3de,_3df,_3e0,_3e1,_3e2,_3e3,_3e4,_3e5){
var _3e6=new Ext.form.ComboBox({typeAhead:false,triggerAction:"all",displayField:_3e0,store:_3dd,fieldClass:"sg-form-field",width:_3e2,listWidth:_3e3,pageSize:0,editable:false,lazyInit:false,lazyRender:true,listBaseClass:"sg-combo-list-item",selectedClass:"sg-combo-list-item-selected",forceSelection:true,value:"All",mode:"local",tpl:"<tpl for=\".\"><div class=\"sg-combo-list-item-item\">{"+_3e0+"}</div></tpl>",listeners:{"select":function(_3e7,_3e8,_3e9){
if(_3de=="combo"){
if(_3df.store.baseParams[_3e1]!=undefined){
delete _3df.store.baseParams[_3e1];
}
}else{
if(_3de=="tree"){
if(_3df.loader.baseParams[_3e1]!=undefined){
delete _3df.getLoader().baseParams[_3e1];
}
}
}
if(_3e8.data[_3e1]!="all"){
if(_3de=="combo"){
_3df.store.baseParams[_3e1]=_3e8.data[_3e1];
}else{
if(_3de=="tree"){
_3df.getLoader().baseParams[_3e1]=_3e8.data[_3e1];
}
}
}
if(_3de=="combo"){
_3df.doQuery(SwitchGames.Search.searchComboBox.getRawValue());
_3e7.collapse();
}else{
if(_3de=="tree"){
_3df.getLoader().load(_3df.getRootNode());
}
}
},"expand":function(_3ea){
_3ea.list.on("mousedown",SwitchGames.Search.stopMouseDown);
},"collapse":function(_3eb){
_3eb.list.un("mousedown",SwitchGames.Search.stopMouseDown);
}}});
if(_3e4){
_3e6.render(_3e5);
}
return (_3e6);
};
SwitchGames.Search.createSearchTree=function(_3ec,_3ed,_3ee,_3ef,url,_3f1,_3f2,_3f3,_3f4,_3f5,_3f6){
var _3f7={};
if(_3f6==null){
_3f6=url;
}
if(_3f2=="byidlist"){
_3f7.querytype="byidlist";
_3f7.gameids=_3f4.games;
_3f7.platformids=_3f4.platforms;
_3f7.accessoryids=_3f4.accessories;
_3f7.querywidget=_3f1;
}else{
if(_3f2=="byname"){
_3f7.querytype="byname";
_3f7.name=_3f3;
_3f7.querywidget=_3f1;
}else{
_3f7.querytype=_3f2;
_3f7.querywidget=_3f1;
}
}
var _3f5=_3f5;
var _3f8=new Ext.tree.TreePanel({height:_3ee,rootVisible:false,autoScroll:true,lines:false,baseCls:"sg-search-panel",plugins:new SwitchGames.SearchTreePlugin(),title:_3ef,layout:"fit",renderTo:Ext.get(_3ec),init:function(){
this.addEvents("afterchildrenrendered");
},loader:new Ext.tree.TreeLoader({dataUrl:_3f6,uiProviders:{"game":Ext.tree.GameNodeUI,"emptyGame":Ext.tree.EmptyGameNodeUI,"wishlistgame":Ext.tree.WishlistGameNodeUI,"offer":Ext.tree.OfferNodeUI,"info":Ext.tree.InfoNodeUI,"emptyOffer":Ext.tree.EmptyOfferNodeUI,"emptyMyStuff":Ext.tree.EmptyMyStuffNodeUI,"emptyWishlist":Ext.tree.EmptyWishlistNodeUI},listeners:{"beforeload":function(_3f9,_3fa,_3fb){
if(_3f9.baseParams==null){
_3f9.baseParams={};
}
if(_3fa.isRoot==true){
_3f9.baseParams=_3f7;
_3f9.baseParams.querytype=_3f2;
}else{
if(_3fa.ui.node.id.substr(0,5)=="game_"){
_3f9.baseParams.querytype="byid";
_3f9.baseParams.querywidget=_3fa.attributes.widget;
_3f9.baseParams.resultsPerPage=_3fa.attributes.resultsPerPage;
_3f9.baseParams.pageNumber=_3fa.attributes.pageNumber;
_3f9.baseParams.tradeFilter=_3fa.attributes.forTrade;
_3f9.baseParams.safeTradeFilter=_3fa.attributes.safeTrade;
_3f9.baseParams.saleFilter=_3fa.attributes.forSale;
_3f9.baseParams.type=_3fa.attributes.type;
if(_3fa.attributes.type=="game"){
_3f9.baseParams.id=_3fa.attributes.game_id;
}else{
if(_3fa.attributes.type=="platform"){
_3f9.baseParams.id=_3fa.attributes.platform_id;
}else{
if(_3fa.attributes.type=="accessory"){
_3f9.baseParams.id=_3fa.attributes.accessory_id;
}
}
}
}else{
if(_3fa.ui.node.id.substr(0,6)=="offer_"){
_3f9.baseParams.querytype="byid";
_3f9.baseParams.listing_id=_3fa.attributes.listing_id;
_3f9.baseParams.member_id=_3fa.attributes.member_id;
}
}
}
},"load":function(_3fc,_3fd){
if(_3fd.ui.node.id.substr(0,5)=="game_"){
if(_3f5!=null){
SwitchGames.Utility.createVerifiedBadgeTooltips(Ext.get(_3fd.ui.ctNode),_3f5,"SwitchGames.Utility.verifiedMemberCallback");
}
}
this.dataUrl=url;
}}}),root:new Ext.tree.AsyncTreeNode({text:"gamelist",id:"gamelist"}),listeners:{"expandnode":function(node){
},"load":function(e){
if((e.attributes.game_id!=null||e.attributes.accessory_id!=null||e.attributes.platform_id!=null)&&(e.attributes.widget=="mystuff"||e.attributes.type!="game")){
var _400=e.attributes.game_id||e.attributes.platform_id||e.attributes.accessory_id;
var _401=e.attributes.pageNumber;
var _402=e.attributes.resultsPerPage;
var _403=e.attributes.widget;
var _404=Ext.get("sg-"+_403+"-game-node-pagination-container-"+_400);
var _405=Ext.get("sg-"+_403+"-game-node-prev-btn-"+_400);
var _406=Ext.get("sg-"+_403+"-game-node-next-btn-"+_400);
var _407=Ext.get("sg-"+_403+"-game-node-page-info-"+_400);
var _408=e.attributes.widget=="mystuff"?e.attributes.wishlist_count:e.attributes.listing_count;
var _409=_408>0?"":"none";
var _40a=(_401*_402)>=_408?"none":"";
var _40b=_401>1?"":"none";
var temp=_401*_402;
var _40d=((_401-1)*_402)+1;
var _40e=_408<temp?_408:temp;
var _40f=_40d+" - "+_40e+" &#160;of&#160 "+_408;
Ext.get("sg-"+_403+"-game-node-trade-filter-"+_400).setStyle("display","none");
Ext.get("sg-"+_403+"-game-node-sale-filter-"+_400).setStyle("display","none");
_407.update(_40f);
_404.setStyle("display",_409);
_407.setStyle("display",_409);
_405.setStyle("display",_40b);
_406.setStyle("display",_40a);
}
},"afterchildrenrendered":function(e){
if(e.attributes.game_id!=null){
var _411=e.attributes.game_id;
var _412=e.attributes.pageNumber;
var _413=e.attributes.resultsPerPage;
var _414=e.attributes.widget;
var _415=Ext.get("sg-"+_414+"-game-node-pagination-container-"+_411);
var _416=Ext.get("sg-"+_414+"-game-node-prev-btn-"+_411);
var _417=Ext.get("sg-"+_414+"-game-node-next-btn-"+_411);
var _418=Ext.get("sg-"+_414+"-game-node-page-info-"+_411);
var _419=Ext.get("sg-"+_414+"-game-node-trade-filter-"+_411);
var _41a=Ext.get("sg-"+_414+"-game-node-sale-filter-"+_411);
var _41b=e.attributes.total_count;
var _41c=_414.indexOf("shop_")!=-1?"none":e.attributes.type=="game"?"":"none";
var _41d=_41b>0?"":"none";
var _41e=(_412*_413)>=_41b?"none":"";
var _41f=_412>1?"":"none";
var temp=_412*_413;
var _421=e.attributes.page_start+1||((_412-1)*_413)+1;
var _422=e.attributes.page_total||_41b<temp?_41b:temp;
var _423=_421+" - "+_422+" &#160;of&#160 "+_41b;
_415.setStyle("display",_41d);
_418.setStyle("display",_41d);
_418.update(_423);
_416.setStyle("display",_41f);
_417.setStyle("display",_41e);
_419.setStyle("display",_41c);
_41a.setStyle("display",_41c);
}
}}});
return _3f8;
};
if(!SwitchGames.Search.ATMS){
SwitchGames.Search.ATMS={};
}
SwitchGames.Search.ATMS.verifiedCallback=function(){
var _424=SwitchGames.Search.addToMyStuffDialog.body.dom.getAttribute("item-id");
var type=SwitchGames.Search.addToMyStuffDialog.body.dom.getAttribute("item-type");
var _426=false;
if(SwitchGames.Search.addToMyStuffDialog.body.dom.getAttribute("for-edit")=="true"){
_426=true;
}
SwitchGames.Search.addToMyStuff(_424,type,_426);
};
SwitchGames.Search.ATMS.adjustWindow=function(){
var _427=Ext.get("atms-panel-controls");
var _428=Ext.get("sm-atms-RequireSafeTrade-div");
var _429=Ext.get("sg-atms-sell-panels");
var sChk=Ext.get("sg-atms-ListItemForSale-id");
var tChk=Ext.get("sg-atms-ListItemForTrade-id");
if(sChk.dom.checked&&tChk.dom.checked){
_427.setStyle("margin-top","45px");
_428.setStyle("display","");
SwitchGames.Search.addToMyStuffDialog.setHeight(840);
_429.setStyle("display","");
}else{
if(sChk.dom.checked&&!tChk.dom.checked){
_428.setStyle("display","none");
_427.setStyle("margin-top","5px");
SwitchGames.Search.addToMyStuffDialog.setHeight(800);
_429.setStyle("display","");
Ext.fly("sg-atms-RequireSafeTrade-id").dom.checked=false;
}else{
if(!sChk.dom.checked&&tChk.dom.checked){
_427.setStyle("margin-top","45px");
_428.setStyle("display","");
_429.setStyle("display","none");
SwitchGames.Search.addToMyStuffDialog.setHeight(390);
}else{
if(!tChk.dom.checked&&sChk.dom.disabled){
_427.setStyle("margin-top","45px");
_428.setStyle("display","none");
_429.setStyle("display","none");
SwitchGames.Search.addToMyStuffDialog.setHeight(390);
}else{
_428.setStyle("display","none");
_427.setStyle("margin-top","5px");
_429.setStyle("display","none");
SwitchGames.Search.addToMyStuffDialog.setHeight(350);
Ext.fly("sg-atms-RequireSafeTrade-id").dom.checked=false;
}
}
}
}
};
SwitchGames.Search.ATMS.calculateValues=function(_42c,_42d){
var _42e=parseFloat(Ext.fly("sg-atms-sell-price").dom.value);
if(isNaN(_42e)||!Ext.fly("sg-atms-ListItemForSale-id").dom.checked){
_42e=0;
}
var _42f=parseFloat(Ext.get("sg-atms-publisher-donation-percent").getValue())/100;
if(isNaN(_42f)||_42f<0||!Ext.fly("sg-atms-donate-to-publisher-yes").dom.checked){
_42f=0;
}
var _430=_42e*_42f;
var _431=_42e*_42d;
var _432=_42e-_42c-_430-_431;
var _433=SwitchGames.Utility.formatCurrency(_432);
var _434=new Array();
_434["sellPrice"]=_42e;
_434["pubDonation"]=_430;
_434["sgCut"]=_431;
_434["finalMemberCredit"]=_433;
if(_433<0){
_433="0.00";
}
Ext.fly("atms-running-total").update("$"+_433);
return _434;
};
SwitchGames.Search.addToMyStuff=function(_435,type,_437){
var _438=new Ext.XTemplate("<div id=\"sg-atms-panel\">","<div class=\"ms-panel-blank-line-20\"></div>","<div style=\"font-size: 15px; font-color: #ffffff; font-weight: bold; text-transform: uppercase;\">{[values.game.length != 0 ? values.game.game_name : values.platform.length != 0 ? values.platform.platform_name : values.accessory.length != 0 ? values.accessory.accessory_name : \"\"]}</div>","<div class=\"ms-panel-fields\" style=\"width: 535px;\">","<div class=\"ms-panel-blank-line-5\">&nbsp;</div>","<div class=\"ms-panel-blank-line-5\">&nbsp;</div>","<div>","<div style=\"float: left; width: 275px;\">","<div><input id=\"sg-atms-ListItemForTrade-id\" type=\"checkbox\" checked />&nbsp;List this item for <span class=\"ms-panel-text-trade\">TRADE</span></div>","<div id=\"sm-atms-RequireSafeTrade-div\" style=\"margin-top: 5px;\"><input id=\"sg-atms-RequireSafeTrade-id\" type=\"checkbox\" />&nbsp;Require <img src=\""+SwitchGames.imageUrl+"trade_tools/safetrade_logo_mystuff.png\" ext:qtip=\"SafeTrade guarantees full coverage in the event your game is lost or stolen in a trade.  $5.95 fee (only paid if your offer is accepted) includes a pre-paid USPS shipping label with free online package tracking.\" /> guarantee<br/><span style=\"font-size: 10px; margin-left: 16px;\">Both members pay <b>$5.95</b> fee (includes all postage)</span></div>","</div>","<div id=\"sg-atms-for-sale-group\" style=\"float: left; width: 255px;\">","<div id=\"sg-atms-for-sale-div\"><input id=\"sg-atms-ListItemForSale-id\" type=\"checkbox\" />&nbsp;List this item for <span class=\"ms-panel-text-trade\">SALE</span></div>","<div id=\"sg-atms-verified\" style=\"margin-top: 5px; font-size: 12px;\">Only Verified Members can sell stuff<br/><span style=\"cursor: pointer; font-weight: bold; text-decoration: underline;\" onClick=\"SwitchGames.Account.VerifyMember(SwitchGames.Search.ATMS.verifiedCallback);\">Verify My Account Now</span> <span style=\"font-size: 10px; margin-left: 3px;\">(<b>$4.95</b> fee applies)</span></div>","</div>","</div>","<div class=\"ms-panel-blank-line-20\"></div>","<div class=\"ms-panel-controls\" id=\"atms-panel-controls\" style=\"margin-top: 40px;\">","<div class=\"ms-rb-lt-grey-wrapper\">","<div class=\"ms-rb-lt-grey-top\"><div></div></div>","<div class=\"ms-rb-lt-grey-body\">","<span class=\"ms-panel-field-label\">Overall Condition:</span>&nbsp;&nbsp;","<input id=\"sg-atms-condition-perfect\" type=\"radio\" name=\"condition\" value=\"1\"><span class=\"ms-panel-field-label\">Perfect</span>","<input id=\"sg-atms-condition-verygood\" type=\"radio\" name=\"condition\" value=\"2\"><span class=\"ms-panel-field-label\">Very Good</span>","<input id=\"sg-atms-condition-good\" type=\"radio\" name=\"condition\" value=\"3\"><span class=\"ms-panel-field-label\">Good</span>","<input id=\"sg-atms-condition-bad\" type=\"radio\" name=\"condition\" value=\"4\"><span class=\"ms-panel-field-label\">Bad</span>","<div class=\"ms-panel-blank-line-15\"></div>","<input id=\"sg-atms-opened\" type=\"checkbox\"><span class=\"ms-panel-field-label\">Opened</span>","<input id=\"sg-atms-original-packaging\" type=\"checkbox\"><span class=\"ms-panel-field-label\">Original Packaging (including manual)</span>","<input id=\"sg-atms-has-scratches\" type=\"checkbox\"><span class=\"ms-panel-field-label\">Scratches Present</span>","<div class=\"ms-panel-blank-line-15\"></div>","<span class=\"ms-panel-field-label\">Comments (max 130 characters)</span>","<textarea wrap=\"virtual\" id=\"atms-item-comment\" maxlength=\"130\" onkeydown='return SwitchGames.Utility.limitTextFieldLength(event);' class=\"ms-item-comment\"></textarea>","</div>","<div class=\"ms-rb-lt-grey-btm\"><div></div></div>","</div>","</div>","<div class=\"ms-panel-blank-line-20\"></div>","<div id=\"sg-atms-sell-panels\" style=\"display: none;\">","<div id=\"sg-atms-SellPrice\">","<div id=\"sg-atms-panel-sell\" class=\"ms-panel-controls\">","<div style=\"font-size: 14px; margin-bottom: 10px;\">","<div>MARKET VALUE: <span id=\"sg-atms-market-value\" style=\"font-weight: bold;\"></span></div>","<div id=\"sg-atms-market-value-text\"></div>","<div id=\"sg-atms-medium-average\" style=\"margin-top: 10px;\"></div>","<div id=\"sg-atms-high-low-average\"></div>","</div>","<div class=\"ms-rb-lt-grey-wrapper\">","<div class=\"ms-rb-lt-grey-top\">","<div></div>","</div>","<div class=\"ms-rb-lt-grey-body\">","<div class=\"ms-panel-heading\">I AM SELLING THIS FOR $<input id=\"sg-atms-sell-price\" name=\"sg-atms-sell-price\" class=\"ms-sell-price\" maxlength=\"6\" value=\"0.00\" /> <span style=\"color: #CCCCCC; font-size: 10px;\">$500 max</span></div>","<div style=\"font-size: 12px; margin-top: 5px;\">YOU MUST USE THE MAILING LABEL PROVIDED TO RECEIVE PAYMENT</div>","<div style=\"font-size: 12px; margin-top: 5px;\">","<input id=\"sg-atms-sale-terms-agree\" type=\"checkbox\" />&nbsp;&nbsp;","<span id=\"sg-atms-sale-terms\">Upon the sale of this item, I allow SwitchGames to deduct a 10% sales commission, and a $2.95 mailing label fee from the sale price of this item.&nbsp; I will receive a First Class USPS Postage label with free package tracking.&nbsp; Once the buyer receives my shipment, payment will be delivered to my SwitchGames account within 48 hours.</span>","<div style=\"margin-top: 5px; font-size: 18px;\"><span id=\"atms-running-total\" style=\"font-weight: bold;\">$0.00</span> will be sent to my SwitchGames account.</div>","</div>","</div>","<div class=\"ms-rb-lt-grey-btm\">","<div></div>","</div>","</div>","</div>","</div>","<div class=\"ms-panel-blank-line-20\"></div>","<div>","<div class=\"ms-panel-heading\">PUBLISHER DONATION? (this is optional)</div>","<div style=\"font-size: 14px; margin: 5px 0 10px;\">You have the option to pay the publisher of this game (<span id=\"sg-atms-publisher-name\">&nbsp;</span>) a percentage of your game sale. SwitchGames will make the specified payment on your behalf if you click YES.</div>","</div>","<div class=\"ms-panel-controls\">","<div class=\"ms-rb-lt-grey-wrapper\">","<div class=\"ms-rb-lt-grey-top\"><div></div></div>","<div class=\"ms-rb-lt-grey-body\">","<div class=\"ms-panel-heading\"><input type=\"radio\" id=\"sg-atms-donate-to-publisher-no\" name=\"sg-atms-donate-to-publisher\" checked=\"true\" /> NO</div>","<div style=\"font-size: 24px; font-weight: bold; margin-top: 3px;\"><input type=\"radio\" id=\"sg-atms-donate-to-publisher-yes\" name=\"sg-atms-donate-to-publisher\" /> YES, I WILL DONATE <input id=\"sg-atms-publisher-donation-percent\" name=\"sg-atms-publisher-donation-percent\" class=\"ms-donation-percent\" maxlength=\"2\" value=\"0\" DISABLED />% &nbsp; ($<span id=\"sg-atms-publisher-donation-amount\">0.00</span>)</div>","</div>","<div class=\"ms-rb-lt-grey-btm\"><div></div></div>","</div>","</div>","<div class=\"ms-panel-blank-line-20\"></div>","</div>","<div style=\"text-align: center;\">","<img id=\"sg-atms-continue-button\" name=\"sg-atms-add-button\" style=\"cursor: pointer;\" src=\"\" />","<span id=\"sg-atms-processing\" style=\"display: none; line-height: 24px;\"><img style=\"vertical-align: middle;\" src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" /><span> Adding to your stuff...</span></span>","</div>","</div>","</div>","<div id=\"sg-atms-finish\" style=\"display: none; padding-top: 145px;\"><div id=\"sg-atms-finish-message\" style=\"font-size: 14px; font-weight: bold; font-color: #ffffff; text-align: center;\"></div></div>");
var _439=2.95;
var _43a=0.1;
if(SwitchGames.Search.addToMyStuffDialog==undefined||SwitchGames.Search.addToMyStuffDialog==null){
SwitchGames.Search.addToMyStuffDialog=SwitchGames.Dialogs.createDialog("","sg-add-to-my-stuff-dlg","Add Item To My Stuff",600,390,"sg-window");
SwitchGames.Search.addToMyStuffDialog.body.on("click",function(e,t){
SwitchGames.Search.ATMS.adjustWindow();
},this,{delegate:"input[@id=\"sg-atms-ListItemForTrade-id\"]"});
SwitchGames.Search.addToMyStuffDialog.body.on("click",function(e,t){
SwitchGames.Search.ATMS.adjustWindow();
},this,{delegate:"input[@id=\"sg-atms-ListItemForSale-id\"]"});
SwitchGames.Search.addToMyStuffDialog.body.on("click",function(e,t){
if(t.checked){
Ext.fly("sg-atms-publisher-donation-percent").dom.value="0";
Ext.fly("sg-atms-publisher-donation-percent").dom.disabled=true;
Ext.fly("sg-atms-publisher-donation-amount").update("0.00");
SwitchGames.Search.ATMS.calculateValues(_439,_43a);
}
},this,{delegate:"input[@id=\"sg-atms-donate-to-publisher-no\"]"});
SwitchGames.Search.addToMyStuffDialog.body.on("click",function(e,t){
if(t.checked){
Ext.fly("sg-atms-publisher-donation-percent").dom.disabled=false;
}
},this,{delegate:"input[@id=\"sg-atms-donate-to-publisher-yes\"]"});
SwitchGames.Search.addToMyStuffDialog.body.on("keyup",function(e,t){
SwitchGames.Search.ATMS.calculateValues(_439,_43a);
},this,{delegate:"input[@id=\"sg-atms-sell-price\"]"});
SwitchGames.Search.addToMyStuffDialog.body.on("keyup",function(e,t){
var vals=SwitchGames.Search.ATMS.calculateValues(_439,_43a);
var _448=SwitchGames.Utility.formatCurrency(vals["pubDonation"]);
Ext.fly("sg-atms-publisher-donation-amount").update(_448);
},this,{delegate:"input[@id=\"sg-atms-publisher-donation-percent\"]"});
SwitchGames.Search.addToMyStuffDialog.body.on("click",function(e,t){
var _44b=Ext.fly("sg-atms-condition-perfect").dom.checked;
var _44c=Ext.fly("sg-atms-condition-verygood").dom.checked;
var _44d=Ext.fly("sg-atms-condition-good").dom.checked;
var _44e=Ext.fly("sg-atms-condition-bad").dom.checked;
var _44f=_44b?1:_44c?2:_44d?3:_44e?4:0;
var _450=Ext.fly("atms-item-comment").getValue();
var _451=SwitchGames.Search.addToMyStuffDialog.body.dom.getAttribute("for-edit");
var _452=Ext.get("sg-atms-sale-terms-agree");
var _453=SwitchGames.Search.ATMS.calculateValues(_439,_43a);
if(_44f==0){
SwitchGames.Dialogs.showErrorDialog("You must select a condition of the item.");
return;
}else{
if(_453["finalMemberCredit"]<0&&Ext.fly("sg-atms-ListItemForSale-id").dom.checked){
SwitchGames.Dialogs.showErrorDialog("<b>You cannot sell an item for a<br/>net profit of less than $0.00.</b>");
return;
}else{
if(parseFloat(Ext.fly("sg-atms-sell-price").getValue())>500){
SwitchGames.Dialogs.showErrorDialog("<b>You cannot sell a game for more than $500!<br/>Please go back and change the price.</b>");
return;
}else{
if(!_452.dom.checked&&Ext.fly("sg-atms-ListItemForSale-id").dom.checked){
SwitchGames.Dialogs.showErrorDialog("<b>Please read the terms and check the box<br/>before listing this game for sale.</b>");
return;
}else{
if(_451=="true"){
reqParams={datatype:"ms",action:"update",item_id:SwitchGames.Search.addToMyStuffDialog.body.dom.getAttribute("item-id"),item_type:SwitchGames.Search.addToMyStuffDialog.body.dom.getAttribute("item-type"),for_sale:Ext.fly("sg-atms-ListItemForSale-id").dom.checked?1:0,price:_453["sellPrice"],donation:_453["pubDonation"],for_trade:Ext.fly("sg-atms-ListItemForTrade-id").dom.checked?1:0,require_safetrade:Ext.fly("sg-atms-RequireSafeTrade-id").dom.checked?1:0,condition:_44f,scratches:Ext.fly("sg-atms-has-scratches").dom.checked?1:0,original_box:Ext.fly("sg-atms-original-packaging").dom.checked?1:0,brand_new:Ext.fly("sg-atms-opened").dom.checked?0:1,notes:_450};
}else{
reqParams={datatype:"ms",action:"add",item_id:SwitchGames.Search.addToMyStuffDialog.body.dom.getAttribute("item-id"),item_type:SwitchGames.Search.addToMyStuffDialog.body.dom.getAttribute("item-type"),for_sale:Ext.fly("sg-atms-ListItemForSale-id").dom.checked?1:0,price:_453["sellPrice"],donation:_453["pubDonation"],for_trade:Ext.fly("sg-atms-ListItemForTrade-id").dom.checked?1:0,require_safetrade:Ext.fly("sg-atms-RequireSafeTrade-id").dom.checked?1:0,condition:_44f,scratches:Ext.fly("sg-atms-has-scratches").dom.checked?1:0,original_box:Ext.fly("sg-atms-original-packaging").dom.checked?1:0,brand_new:Ext.fly("sg-atms-opened").dom.checked?0:1,notes:_450};
}
}
}
}
}
Ext.fly("sg-atms-continue-button").dom.style.display="none";
Ext.fly("sg-atms-processing").dom.style.display="inline";
Ext.Ajax.request({url:"data/trade_tools/trade_tools_data.php",params:reqParams,success:function(_454,_455){
Ext.fly("sg-atms-continue-button").dom.style.display="";
Ext.fly("sg-atms-processing").dom.style.display="none";
SwitchGames.Search.addToMyStuffDialog.setHeight(350);
var data=Ext.util.JSON.decode(_454.responseText);
if(data.error!=undefined&&data.error!=null){
SwitchGames.Dialogs.showErrorDialog(data.error);
}else{
if(SwitchGames.TradeTools.myStuffTree!=undefined&&SwitchGames.TradeTools.myStuffTree!=null){
SwitchGames.TradeTools.updateTree("ms");
if(_451=="false"){
SwitchGames.TradeTools.updateSwitchbot();
}
}
var _457=Ext.get("sg-atms-panel");
var _458=Ext.get("sg-atms-finish");
_457.slideOut("l",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false,callback:function(){
_458.slideIn("r",{duration:0.5,easing:"backBoth",useDisplay:true,block:true,concurrent:false});
}});
}
},failure:function(_459,_45a){
Ext.fly("sg-atms-continue-button").dom.style.display="";
Ext.fly("sg-atms-processing").dom.style.display="none";
SwitchGames.Dialogs.showErrorDialog("Error contacting server.  Try again later");
}});
},this,{delegate:"img[@name=\"sg-atms-add-button\"]"});
}
var _435=_435;
var type=type;
var _437=_437==undefined?false:_437;
var _45b;
if(_437==true){
Ext.Ajax.request({url:"data/common/utilities.php",params:{pane:"get_listing_detail",itemid:_435,type:type},success:function(_45c,_45d){
var data=Ext.util.JSON.decode(_45c.responseText);
if(data.error!=undefined&&data.error!=null){
SwitchGames.Dialogs.showErrorDialog(data.error);
}else{
var item=data.game.length!=0?data.game:data.platform.length!=0?data.platform:data.accessory.length!=0?data.accessory:null;
_45b=data.game.length!=0?data.game.game_name:data.platform.length!=0?data.platform.platform_name:data.accessory.length!=0?data.accessory.accessory_name:"";
_438.overwrite(SwitchGames.Search.addToMyStuffDialog.body,data);
Ext.fly("sg-atms-publisher-name").update(data.game.publisher,false);
Ext.fly("sg-atms-finish-message").update(_45b+" updated",false);
Ext.fly("sg-atms-continue-button").dom.src=SwitchGames.imageUrl+"common/buttons/update-item.png";
SwitchGames.Search.addToMyStuffDialog.body.dom.setAttribute("item-id",_435);
SwitchGames.Search.addToMyStuffDialog.body.dom.setAttribute("item-type",type);
SwitchGames.Search.addToMyStuffDialog.body.dom.setAttribute("for-edit",_437==true?"true":"false");
Ext.fly("sg-atms-ListItemForTrade-id").dom.checked=item.for_trade==1;
Ext.fly("sg-atms-RequireSafeTrade-id").dom.checked=item.require_safetrade==1;
Ext.fly("sg-atms-ListItemForSale-id").dom.checked=item.for_sale==1;
Ext.fly("sg-atms-market-value").update(data.game.demand);
Ext.fly("sg-atms-market-value-text").update(data.game.desc);
if(data.game.source!=null&&data.game.source=="internet"){
Ext.fly("sg-atms-medium-average").update("COMPETITIVE ONLINE PRICE (USED): <b>$"+data.game.medium_avg+"</b>");
}else{
Ext.fly("sg-atms-medium-average").update("AVERAGE PRICE: <b>$"+data.game.medium_avg+"</b>");
Ext.fly("sg-atms-high-low-average").update("Average low price: <b>$"+data.game.low_avg+"</b> &nbsp; &nbsp Average high price: <b>$"+data.game.high_avg+"</b>");
}
if(SwitchGames.userInfo.verified!=1){
Ext.fly("sg-atms-ListItemForSale-id").dom.checked=false;
Ext.fly("sg-atms-ListItemForSale-id").dom.disabled=true;
Ext.fly("sg-atms-for-sale-div").setStyle("color","#505050");
Ext.fly("sg-atms-verified").setStyle("display","");
}else{
Ext.fly("sg-atms-verified").setStyle("display","none");
Ext.fly("sg-atms-for-sale-div").setStyle("color","#ffffff");
Ext.fly("sg-atms-ListItemForSale-id").dom.disabled=false;
}
if(type!="game"){
Ext.fly("sg-atms-for-sale-group").setStyle("display","none");
}else{
Ext.fly("sg-atms-for-sale-group").setStyle("display","");
}
SwitchGames.Search.ATMS.adjustWindow();
Ext.fly("sg-atms-condition-perfect").dom.checked=item.condition==1;
Ext.fly("sg-atms-condition-verygood").dom.checked=item.condition==2;
Ext.fly("sg-atms-condition-good").dom.checked=item.condition==3;
Ext.fly("sg-atms-condition-bad").dom.checked=item.condition==4;
Ext.fly("sg-atms-has-scratches").dom.checked=item.scratches==1;
Ext.fly("sg-atms-original-packaging").dom.checked=item.original_box==1;
Ext.fly("sg-atms-opened").dom.checked=item.brand_new==0;
Ext.fly("sg-atms-sell-price").dom.value=item.price;
Ext.fly("sg-atms-publisher-donation-percent").dom.value=item.publisher_percent;
Ext.fly("atms-item-comment").dom.value=item.notes;
if(item.publisher_percent>0){
Ext.fly("sg-atms-donate-to-publisher-yes").dom.checked=true;
Ext.fly("sg-atms-publisher-donation-percent").dom.disabled=false;
Ext.fly("sg-atms-publisher-donation-amount").update(item.donation);
}
SwitchGames.Search.addToMyStuffDialog.setTitle("Editing - "+_45b);
SwitchGames.Search.ATMS.calculateValues(_439,_43a);
}
},failure:function(_460,_461){
SwitchGames.Dialogs.showErrorDialog("Error contacting server.  Try again later");
}});
}else{
Ext.Ajax.request({url:"data/common/utilities.php",params:{pane:"get_item_detail",itemid:_435,type:type},success:function(_462,_463){
var data=Ext.util.JSON.decode(_462.responseText);
if(data.error!=undefined&&data.error!=null){
SwitchGames.Dialogs.showErrorDialog(data.error);
}else{
_45b=data.game.length!=0?data.game.game_name:data.platform.length!=0?data.platform.platform_name:data.accessory.length!=0?data.accessory.accessory_name:"";
_438.overwrite(SwitchGames.Search.addToMyStuffDialog.body,data);
Ext.fly("sg-atms-market-value").update(data.game.demand);
Ext.fly("sg-atms-market-value-text").update(data.game.desc);
if(data.game.source!=null&&data.game.source=="internet"){
Ext.fly("sg-atms-medium-average").update("COMPETITIVE ONLINE PRICE (USED): <b>$"+data.game.medium_avg+"</b>");
}else{
Ext.fly("sg-atms-medium-average").update("AVERAGE PRICE: <b>$"+data.game.medium_avg+"</b>");
Ext.fly("sg-atms-high-low-average").update("Average low price: <b>$"+data.game.low_avg+"</b> &nbsp; &nbsp Average high price: <b>$"+data.game.high_avg+"</b>");
}
if(SwitchGames.userInfo.verified!=1){
Ext.fly("sg-atms-ListItemForSale-id").dom.checked=false;
Ext.fly("sg-atms-ListItemForSale-id").dom.disabled=true;
Ext.fly("sg-atms-for-sale-div").setStyle("color","#505050");
Ext.fly("sg-atms-verified").setStyle("display","");
}else{
Ext.fly("sg-atms-verified").setStyle("display","none");
Ext.fly("sg-atms-for-sale-div").setStyle("color","#ffffff");
Ext.fly("sg-atms-ListItemForSale-id").dom.disabled=false;
}
if(type!="game"){
Ext.fly("sg-atms-for-sale-group").setStyle("display","none");
}else{
Ext.fly("sg-atms-for-sale-group").setStyle("display","");
}
SwitchGames.Search.ATMS.adjustWindow();
Ext.fly("sg-atms-publisher-name").update(data.game.publisher,false);
Ext.fly("sg-atms-finish-message").update(_45b+" added to your stuff");
Ext.fly("sg-atms-continue-button").dom.src=SwitchGames.imageUrl+"common/buttons/add-to-my-stuff.png";
SwitchGames.Search.addToMyStuffDialog.body.dom.setAttribute("item-id",_435);
SwitchGames.Search.addToMyStuffDialog.body.dom.setAttribute("item-type",type);
SwitchGames.Search.addToMyStuffDialog.body.dom.setAttribute("for-edit",_437==true?"true":"false");
SwitchGames.Search.addToMyStuffDialog.setTitle("Adding - "+_45b);
}
},failure:function(_465,_466){
SwitchGames.Dialogs.showErrorDialog("Error contacting server.  Try again later");
}});
}
SwitchGames.Search.addToMyStuffDialog.show();
};
SwitchGames.Search.GamePanel={};
SwitchGames.Search.OfferPanel={};
SwitchGames.Search.OfferPanel.getOfferNode=function(tree,el){
};
SwitchGames.Search.OfferPanel.doTransaction=function(type){
switch(type){
case "buy":
SwitchGames.Transaction.buy(treeNode.attributes.listing_id);
break;
case "safesale":
SwitchGames.Transaction.safeSale(treeNode.attributes.listing_id);
break;
case "safebuy":
SwitchGames.Transaction.safeBuy(treeNode.attributes.listing_id);
break;
case "trade":
SwitchGames.Transaction.trade(treeNode.attributes.listing_id);
break;
case "safetrade":
SwitchGames.Transaction.safeTrade(treeNode.attributes.listing_id);
break;
}
};
SwitchGames.Search.InfoPanel={};
SwitchGames.Search.InfoPanel.ItemDetails={};
Ext.namespace("SwitchGames.Ads");
SwitchGames.Ads.AdManagerClass=function(){
this.generatedAdId=(new Date().getTime());
this.cooldown=function(){
this.inCooldownPeriod=true;
var self=this;
setTimeout(function(){
self.inCooldownPeriod=false;
},20000);
};
this.rotateAds=function(_46b,_46c,_46d){
if(this.inCooldownPeriod===true&&_46d!==true){
return;
}
if(_46c==null){
_46c=Ext.query(".sg-core-masthead-wrapper")[0];
}
var ads=this.getAds(_46c);
for(var i=0;i<ads.length;i++){
var ad=ads[i];
var _471=this.getAdSpecs(_46b,ad.name);
ad.src=this.getIframeSrc(ad.id,_471);
}
this.cooldown();
};
this.getAdSpecs=function(_472,_473){
var _474=SwitchGames.Ads.AdMap["catchall"]["catchall"];
if(SwitchGames.Ads.AdMap.hasOwnProperty(_472)&&SwitchGames.Ads.AdMap[_472].hasOwnProperty(_473)){
_474=SwitchGames.Ads.AdMap[_472][_473];
}
return _474;
};
this.getIframeSrc=function(adId,_476,_477){
if(_477==null){
var _477=(new Date().getTime());
}
var _478="{0}//www.switchgames.com/ads/www/delivery/afr.php?n={1}&zoneid={2}&grZone={3}&grTile={4}&grSize={5}&cb={6}";
return String.format(_478,window.location.protocol,adId,_476.zone,_476.grZone,_476.tile,_476.size,_477);
};
this.getLinkSrc=function(_479,_47a){
if(_47a==null){
var _47a=(new Date().getTime());
}
var _47b="{0}//ans.giantrealm.com/click/gr.switchgames/{1};tile={2};sz={3};ord={4}";
return String.format(_47b,window.location.protocol,_479.grZone,_479.tile,_479.size,_47a);
};
this.getImgSrc=function(_47c,_47d){
if(_47d==null){
var _47d=(new Date().getTime());
}
var _47e="{0}//ans.giantrealm.com/img/gr.switchgames/{1};tile={2};sz={3};ord={4}";
return String.format(_47e,window.location.protocol,_47c.grZone,_47c.tile,_47c.size,_47d);
};
this.generateAdCode=function(_47f,_480){
var _481=this.getAdSpecs(_47f,_480);
this.generatedAdId++;
var adId=this.generatedAdId;
var _483=_481.size;
var _484=Ext.util.Format.htmlEncode(this.getIframeSrc(adId,_481));
var _485=Ext.util.Format.htmlEncode(this.getLinkSrc(_481));
var _486=Ext.util.Format.htmlEncode(this.getImgSrc(_481));
if(this.adCodeTemplate==null){
this.adCodeTemplate=new Ext.XTemplate("<iframe class=\"sg-adspace sg-adspace-{adSize}\" id=\"{adId}\" name=\"{adName}\" src=\"{iframeSrc}\" framespacing=\"0\" frameborder=\"no\" scrolling=\"no\">","<a href=\"{linkSrc}\" target=\"_blank\"><img src=\"{imgSrc}\" border=\"0\" alt=\"\" /></a>","</iframe>");
}
var data={"adId":this.generatedAdId++,"adName":_480,"adSize":_481.size,"iframeSrc":Ext.util.Format.htmlEncode(this.getIframeSrc(adId,_481)),"linkSrc":Ext.util.Format.htmlEncode(this.getLinkSrc(_481)),"imgSrc":Ext.util.Format.htmlEncode(this.getImgSrc(_481))};
return this.adCodeTemplate.apply(data);
};
this.appendAd=function(el,_489,_48a){
Ext.Element.fly(el).insertHtml("beforeEnd",this.generateAdCode(_489,_48a));
};
this.removeAds=function(el){
var _48c=Ext.query(".sg-adspace",el);
for(var i=0;i<_48c.length;i++){
Ext.Element.fly(_48c[i]).remove();
}
};
this.getAds=function(_48e){
return Ext.query(".sg-adspace",_48e);
};
this.cooldown();
};
SwitchGames.Ads.AdManager=new SwitchGames.Ads.AdManagerClass();
Ext.get(document.body).on("click",function(e,t){
var _491=t.getAttribute("itemid");
var _492=t.getAttribute("itemtype");
SwitchGames.Dialogs.showItemDetailDialog(_491,_492);
},this,{delegate:"img.has-detail"});
});
Ext.namespace("SwitchGames.Utility");
SwitchGames.Utility.Exception=function(msg,func,_495){
this.message=msg;
this.func=func;
this.component=_495;
};
SwitchGames.Utility.Exception.prototype.toString=function(){
var sb=[];
if(this.component!=null){
sb.push(this.component);
sb.push(": ");
}
if(this.func!=null){
sb.push(this.func);
sb.push("(): ");
}
sb.push(this.message);
return sb.join("");
};
Ext.namespace("SwitchGames.Analytics");
SwitchGames.Analytics.TrackEvent=function(_497,_498,_499,_49a){
if(pageTracker){
pageTracker._trackEvent(_497,_498,_499,_49a);
}
};
SwitchGames.Analytics.TrackTabLoad=function(_49b){
SwitchGames.Analytics.TrackEvent("Tabs","Load",_49b);
};
SwitchGames.Analytics.TrackTabSwitchTo=function(_49c){
SwitchGames.Analytics.TrackEvent("Tabs","SwitchTo",_49c);
};
Ext.onReady(function(){
Ext.namespace("SwitchGames","SwitchGames.Search");
SwitchGames.Search.stopMouseDown=function(e){
Ext.lib.Event.stopEvent(e.browserEvent);
return (false);
};
SwitchGames.Search.typeFiltered=false;
SwitchGames.Search.platformFiltered=false;
SwitchGames.Search.genreFiltered=false;
SwitchGames.Search.typeFilterCombobox=new Ext.form.ComboBox({typeAhead:false,triggerAction:"all",displayField:"typeName",store:SwitchGames.Search.typeStore,fieldClass:"sg-form-field",width:100,listWidth:100,pageSize:0,editable:false,lazyInit:false,lazyRender:true,listBaseClass:"sg-combo-list-item",selectedClass:"sg-combo-list-item-selected",forceSelection:true,value:"All",mode:"local",tpl:"<tpl for=\".\"><div class=\"sg-combo-list-item-item\">{typeName}</div></tpl>",listeners:{"select":function(_49e,_49f,_4a0){
SwitchGames.Search.typeFiltered=true;
if(_49f.data.type=="all"){
delete SwitchGames.Search.searchComboBox.store.baseParams.type;
}else{
SwitchGames.Search.searchComboBox.store.baseParams.type=_49f.data.type;
}
SwitchGames.Search.searchComboBox.doQuery(SwitchGames.Search.searchComboBox.getRawValue());
SwitchGames.Search.typeFilterCombobox.collapse();
},"expand":function(_4a1){
_4a1.list.on("mousedown",SwitchGames.Search.stopMouseDown);
},"collapse":function(_4a2){
_4a2.list.un("mousedown",SwitchGames.Search.stopMouseDown);
}}});
SwitchGames.Search.platformFilterCombobox=new Ext.form.ComboBox({typeAhead:false,triggerAction:"all",store:new Ext.data.JsonStore({url:"data/search/nav-platform.php",root:"items",totalProperty:"total",id:"platformId",fields:["platform"],listeners:{"load":function(_4a3,_4a4,_4a5){
SwitchGames.Search.platformFilterCombobox.setValue("All");
}}}),fieldClass:"sg-form-field",width:245,listWidth:245,pageSize:0,editable:false,lazyInit:false,lazyRender:true,displayField:"platform",listBaseClass:"sg-combo-list-item",selectedClass:"sg-combo-list-item-selected",forceSelection:true,mode:"local",tpl:"<tpl for=\".\"><div class=\"sg-combo-list-item-item\">{platform}</div></tpl>",listeners:{"select":function(_4a6,_4a7,_4a8){
SwitchGames.Search.platformFiltered=true;
if(_4a7.data.platform=="All"){
delete SwitchGames.Search.searchComboBox.store.baseParams.platform;
}else{
SwitchGames.Search.searchComboBox.store.baseParams.platform=_4a7.data.platform;
}
SwitchGames.Search.searchComboBox.doQuery(SwitchGames.Search.searchComboBox.getRawValue());
SwitchGames.Search.platformFilterCombobox.collapse();
},"expand":function(_4a9){
_4a9.list.on("mousedown",SwitchGames.Search.stopMouseDown);
},"collapse":function(_4aa){
_4aa.list.un("mousedown",SwitchGames.Search.stopMouseDown);
}}});
SwitchGames.Search.genreFilterCombobox=new Ext.form.ComboBox({typeAhead:false,triggerAction:"all",displayField:"genreName",store:SwitchGames.Search.genreStore,fieldClass:"sg-form-field",width:100,listWidth:100,pageSize:0,editable:false,lazyInit:false,lazyRender:true,listBaseClass:"sg-combo-list-item",selectedClass:"sg-combo-list-item-selected",forceSelection:true,value:"All",mode:"local",tpl:"<tpl for=\".\"><div class=\"sg-combo-list-item-item\">{genreName}</div></tpl>",listeners:{"select":function(_4ab,_4ac,_4ad){
SwitchGames.Search.genreFiltered=true;
if(_4ac.data.genre=="all"){
delete SwitchGames.Search.searchComboBox.store.baseParams.genre;
}else{
SwitchGames.Search.searchComboBox.store.baseParams.genre=_4ac.data.genre;
}
SwitchGames.Search.searchComboBox.doQuery(SwitchGames.Search.searchComboBox.getRawValue());
SwitchGames.Search.typeFilterCombobox.collapse();
},"expand":function(_4ae){
_4ae.list.on("mousedown",SwitchGames.Search.stopMouseDown);
},"collapse":function(_4af){
_4af.list.un("mousedown",SwitchGames.Search.stopMouseDown);
}}});
if(Ext.get("main_search_query")!=null){
SwitchGames.Search.searchComboBox=new Ext.form.ComboBox({applyTo:"main_search_query",displayField:"name",disableKeyFilter:true,emptyText:"Search for games, etc...",enableKeyEvents:true,forceSelection:true,itemSelector:"div.search-item",hideTrigger:true,lazyInit:false,listWidth:900,listAlign:"tl-bl",loadingText:"Searching...",minChars:2,minListWidth:900,pageSize:20,queryDelay:700,queryParam:"query",resizable:true,shadow:"frame",store:SwitchGames.Search.nav_combo_data_store,typeAhead:false,tpl:SwitchGames.Search.nav_combo_data_template,triggerAction:"all",valueField:"name",width:160,listeners:{"beforequery":function(_4b0){
if(_4b0.query.length<_4b0.combo.minChars){
return;
}
_4b0.combo.store.baseParams.widget="search";
_4b0.forceAll=true;
_4b0.combo.lastQuery="";
if(SwitchGames.Search.platformFiltered==false){
SwitchGames.Search.platformFilterCombobox.store.baseParams.widget="search";
SwitchGames.Search.platformFilterCombobox.store.baseParams.query=_4b0.combo.getRawValue();
SwitchGames.Search.platformFilterCombobox.store.load();
}
},"render":function(_4b1){
_4b1.pageTb.addSeparator();
_4b1.pageTb.addText("Type:");
_4b1.pageTb.addSeparator();
_4b1.pageTb.addField(SwitchGames.Search.typeFilterCombobox);
_4b1.pageTb.addSeparator();
_4b1.pageTb.addText("Platform:");
_4b1.pageTb.addSeparator();
_4b1.pageTb.addField(SwitchGames.Search.platformFilterCombobox);
_4b1.pageTb.addSeparator();
_4b1.pageTb.addText("Genre:");
_4b1.pageTb.addSeparator();
_4b1.pageTb.addField(SwitchGames.Search.genreFilterCombobox);
},"keydown":function(_4b2,e){
delete SwitchGames.Search.searchComboBox.store.baseParams.platform;
SwitchGames.Search.platformFiltered=false;
},"collapse":function(_4b4){
if(_4b4.store.baseParams.platform!=undefined){
delete _4b4.store.baseParams.platform;
}
if(_4b4.store.baseParams.type!=undefined){
delete _4b4.store.baseParams.type;
}
if(_4b4.store.baseParams.genre!=undefined){
delete _4b4.store.baseParams.genre;
}
SwitchGames.Search.typeFilterCombobox.selectByValue("All");
SwitchGames.Search.typeFilterCombobox.setValue("All");
SwitchGames.Search.platformFilterCombobox.selectByValue("All");
SwitchGames.Search.platformFilterCombobox.setValue("All");
SwitchGames.Search.genreFilterCombobox.selectByValue("All");
SwitchGames.Search.genreFilterCombobox.setValue("All");
SwitchGames.Search.typeFiltered=false;
SwitchGames.Search.platformFiltered=false;
SwitchGames.Search.genreFiltered=false;
}},onSelect:function(_4b5){
var _4b6="";
var _4b7="";
var _4b8="";
if(_4b5.data.type=="game"){
_4b6=_4b5.data.id;
}else{
if(_4b5.data.type=="platform"){
_4b7=_4b5.data.id;
}else{
if(_4b5.data.type=="accessory"){
_4b8=_4b5.data.id;
}
}
}
window.location.href=String.format("search.php?game_ids={0}&platform_ids={1}&accessory_ids={2}&game_name={3}",_4b6,_4b7,_4b8,encodeURIComponent(_4b5.data.name));
}});
}
});
Ext.onReady(function(){
if(SwitchGames.TradeTools==undefined||SwitchGames.TradeTools==null){
SwitchGames.TradeTools={};
}
SwitchGames.TradeTools.add=function(_4b9,_4ba,type){
var _4b9=_4b9;
var _4ba=_4ba;
var type=type;
var _4bc;
if(_4ba=="wl"){
_4bc="wishlist";
}else{
_4bc="stuff";
}
SwitchGames.Dialogs.confirmationMessage("Add Item","Add to your "+_4bc+"?",function(_4bd){
if(_4bd==true){
SwitchGames.Dialogs.messageBox("Processing","<span style=\"line-height: 24px;\"><img style=\"vertical-align: middle;\" src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" /><span> Adding to your "+_4bc+"...</span></span>");
SwitchGames.TradeTools.addRemove("add",_4b9,type,_4ba);
}
});
};
SwitchGames.TradeTools.remove=function(_4be,_4bf,type){
var _4be=_4be;
var _4bf=_4bf;
var type=type;
var _4c1;
if(_4bf=="wl"){
_4c1="wishlist";
}else{
_4c1="stuff";
}
SwitchGames.Dialogs.confirmationMessage("Remove Item","Remove from your "+_4c1+"?",function(_4c2){
if(_4c2==true){
SwitchGames.TradeTools.addRemove("remove",_4be,type,_4bf);
}
});
};
SwitchGames.TradeTools.addRemove=function(_4c3,id,_4c5,_4c6,_4c7){
var _4c8=false;
var _4c6=_4c6;
var prms;
var _4c3=_4c3;
var _4c7=(_4c7!=undefined&&_4c7!=null)?_4c7:null;
if(_4c3=="remove"){
prms={datatype:_4c6,action:"remove",item_id:id,item_type:_4c5};
}else{
if(id==null){
id=Ext.get("sg-"+_4c6+"-search-item_id").dom.value;
}
if(_4c5==null){
_4c5=Ext.get("sg-"+_4c6+"-search-item_type").dom.value;
}
switch(_4c6){
case "wl":
prms={datatype:_4c6,action:_4c3,item_id:id,item_type:_4c5};
break;
case "ms":
var _4ca=Ext.fly("sg-ms-condition-perfect").dom.checked;
var _4cb=Ext.fly("sg-ms-condition-verygood").dom.checked;
var _4cc=Ext.fly("sg-ms-condition-good").dom.checked;
var _4cd=Ext.fly("sg-ms-condition-bad").dom.checked;
var _4ce=_4ca?1:_4cb?2:_4cc?3:_4cd?4:0;
var _4cf=Ext.fly("ms-item-comment").getValue();
var _4d0=0;
var _4d1=0;
var _4d2=0;
var _4d3=0;
if(Ext.fly("sg-ms-sell-price")){
_4d0=Ext.fly("sg-ms-ListItemForSale-id").dom.checked?1:0;
var _4d4=Ext.get("sg-ms-ListItemForSale-id");
_4d1=parseFloat(Ext.fly("sg-ms-sell-price").getValue());
_4d2=parseFloat(Ext.fly("sg-ms-publisher-donation-amount").dom.innerHTML);
var _4d5=0.1;
var _4d6=2.95;
if(isNaN(_4d1)||_4d1==null||_4d4.dom.checked==false){
_4d1=0;
}
if(isNaN(_4d2)||_4d2==null||Ext.fly("sg-ms-donate-to-publisher-yes").dom.checked==false){
_4d2=0;
}
var _4d7=_4d1*_4d5;
_4d3=parseFloat(_4d1-_4d7-_4d2-_4d6);
if(parseFloat(Ext.fly("sg-ms-sell-price").getValue())>500&&_4d4.dom.checked==true){
SwitchGames.Dialogs.showErrorDialog("<b>You cannot sell a game for more than $500!<br/>Please go back and change the price.</b>");
return;
}else{
if(_4d3<0&&_4d4.dom.checked==true){
SwitchGames.Dialogs.showErrorDialog("<b>You cannot sell an item for a<br/>net profit of less than $0.00.</b>");
return;
}
}
}
if(_4ce==0){
SwitchGames.Dialogs.showErrorDialog("You must select a condition of the item.");
return;
}else{
prms={datatype:_4c6,action:_4c3,item_id:id,item_type:_4c5,for_sale:_4d0,for_trade:Ext.fly("sg-ms-ListItemForTrade-id").dom.checked?1:0,require_safetrade:Ext.fly("sg-ms-RequireSafeTrade-id").dom.checked?1:0,price:_4d1,donation:_4d2,credit:_4d3,condition:_4ce,scratches:Ext.fly("sg-ms-has-scratches").dom.checked?1:0,original_box:Ext.fly("sg-ms-original-packaging").dom.checked?1:0,brand_new:Ext.fly("sg-ms-opened").dom.checked?0:1,notes:Ext.get("ms-item-comment").getValue()};
}
break;
}
}
if(_4c6=="ms"){
var _4d8=Ext.query("#ms-panel-body [@name=\"panel-scroller-right-arrow\"]")[0];
if(_4d8){
var _4d9=Ext.query("img",_4d8)[0];
if(_4d9){
Ext.fly(_4d8).addClass("sg-disabled");
_4d9.src=SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-right-processing.gif";
}
}
}else{
if(_4c6=="wl"){
var _4da=Ext.query("#wl-add-button>img")[0];
if(_4da){
var _4db=_4da.style.display;
_4da.style.display="none";
Ext.query("#wl-add-processing")[0].style.display="inline";
}
}
}
Ext.Ajax.request({url:"data/trade_tools/trade_tools_data.php",params:prms,success:function(_4dc,_4dd){
if(_4c6=="ms"){
if(_4d9&&_4d8){
_4d9.src=SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-right.png";
Ext.fly(_4d8).removeClass("sg-disabled");
}
if(Ext.fly("sg-ms-sell-price")){
Ext.fly("sg-ms-sell-price").dom.value="0.00";
Ext.fly("sg-ms-sale-terms-agree").dom.checked=false;
Ext.fly("sg-ms-donate-to-publisher-no").dom.checked=false;
Ext.fly("sg-ms-publisher-donation-percent").dom.value="0";
}
}else{
if(_4c6=="wl"){
if(_4da){
Ext.query("#wl-add-processing")[0].style.display="none";
_4da.style.display=_4db;
}
}
}
var data=Ext.util.JSON.decode(_4dc.responseText);
if(data.error==undefined){
if(SwitchGames.TradeTools.myStuffTree!=undefined&&SwitchGames.TradeTools.myStuffTree!=null){
SwitchGames.TradeTools.updateTree(_4c6);
SwitchGames.TradeTools.updateSwitchbot();
}
var _4df="Successfully ";
var _4e0="";
if(_4c3=="remove"){
_4df+="Removed from ";
_4e0+="remove";
}else{
_4df+="Added to ";
_4e0+="add";
}
if(_4c6=="wl"){
_4df+="your wishlist";
_4e0+="wishlist";
}else{
_4df+="your stuff";
_4e0+="mystuff";
}
SwitchGames.Dialogs.messageBox("Success",_4df,"transactional",_4e0);
if(_4c7){
_4c7(true);
}
}else{
SwitchGames.Dialogs.showErrorDialog(data.error);
if(_4c7){
_4c7(false);
}
}
},failure:function(_4e1,_4e2){
if(_4c6=="ms"){
if(_4d9&&_4d8){
_4d9.src=SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-right.png";
Ext.fly(_4d8).removeClass("sg-disabled");
}
}else{
if(_4c6=="wl"){
if(_4da){
Ext.query("#wl-add-processing")[0].style.display="none";
_4da.style.display=_4db;
}
}
}
SwitchGames.Dialogs.showErrorDialog(_4e1.responseText);
if(_4c7){
_4c7(false);
}
}});
return _4c8;
};
SwitchGames.TradeTools.updateTree=function(_4e3){
var _4e4,_4e5;
if(_4e3=="wl"){
_4e4=SwitchGames.TradeTools.wishlistTree;
_4e5=SwitchGames.TradeTools.Badges.Wishlist;
}else{
_4e4=SwitchGames.TradeTools.myStuffTree;
_4e5=SwitchGames.TradeTools.Badges.MyStuff;
}
SwitchGames.Utility.removeVerifiedTooltips(_4e5);
Ext.Ajax.request({url:"data/trade_tools/trade_tools_data.php",params:{datatype:_4e3,action:"getall",fields:"game_id"},success:function(_4e6,_4e7){
var data=Ext.decode(_4e6.responseText);
if(data.error!=undefined&&data.error!=null){
SwitchGames.Dialogs.showErrorDialog(data.error);
}else{
var _4e9=_4e4.getLoader();
if(data.games){
_4e9.baseParams.gameids=data.games.join(",");
}
if(data.platforms){
_4e9.baseParams.platformids=data.platforms.join(",");
}
if(data.accessories){
_4e9.baseParams.accessoryids=data.accessories.join(",");
}
_4e9.load(_4e4.getRootNode());
}
},failure:function(_4ea,_4eb){
SwitchGames.Dialogs.showErrorDialog("Error contacting server.  Try again later.");
}});
};
SwitchGames.TradeTools.updateSwitchbot=function(){
var _4ec=SwitchGames.TradeTools.switchbotTree;
SwitchGames.Utility.removeVerifiedTooltips(SwitchGames.TradeTools.Badges.SwitchBot);
var _4ed=_4ec.getLoader();
_4ed.load(_4ec.getRootNode());
};
SwitchGames.TradeTools.verifiedContent=function(el){
var mkp="";
var _4f0=Ext.get("sg-ms-ListItemForSale-id");
var _4f1=Ext.get("forSaleDiv");
var _4f2=Ext.get("sg-ms-search-item_type").getValue();
var _4f3="<img src=\""+SwitchGames.imageUrl+"common/ajax-loader-big-353535.gif\" style=\"margin-left: 50px;\" />";
if(el==null||el.type!=null){
el=Ext.get("sg-ms-SafeSale");
}
if(_4f2=="game"){
_4f1.show();
if(SwitchGames.userInfo!=null){
if(SwitchGames.userInfo.verified=="1"){
_4f1.setStyle("color","#ffffff");
_4f0.dom.disabled=false;
}else{
_4f1.setStyle("color","#505050");
_4f0.dom.disabled=true;
_4f0.dom.checked=false;
mkp="Only Verified Members can sell stuff<br/><span style=\"cursor: pointer; font-weight: bold; text-decoration: underline;\" onClick=\"SwitchGames.Account.VerifyMember(SwitchGames.TradeTools.verifiedMemberCallback);\">Verify My Account Now</span> <span style=\"font-size: 10px; margin-left: 3px;\">(<b>$4.95</b> fee applies)</span>";
Ext.fly("ms-panel-controls").setStyle("margin-top","65px");
}
}else{
if(el.dom.innerHTML.indexOf("ajax-loader")<0){
el.update(_4f3);
}
_4f0.dom.disabled=true;
_4f1.setStyle("color","#505050");
Ext.fly("ms-panel-controls").setStyle("margin-top","65px");
setTimeout("SwitchGames.TradeTools.verifiedContent()",1000);
return;
}
}else{
_4f1.hide();
}
el.update(mkp);
};
SwitchGames.TradeTools.hideShowSafeTrade=function(){
var sChk=Ext.get("sg-ms-ListItemForSale-id");
var tChk=Ext.get("sg-ms-ListItemForTrade-id");
var _4f6=Ext.get("sg-ms-RequireSafeTrade-id");
var _4f7=Ext.get("safeTradeDiv");
if(tChk.dom.checked||sChk.dom.disabled){
Ext.fly("ms-panel-controls").setStyle("margin-top","65px");
}else{
Ext.fly("ms-panel-controls").setStyle("margin-top","25px");
}
if(tChk.dom.checked){
_4f7.setStyle("display","");
}else{
_4f7.setStyle("display","none");
_4f6.dom.checked=false;
}
};
SwitchGames.TradeTools.verifiedMemberCallback=function(){
var _4f8=Ext.get("sg-ms-SafeSale");
SwitchGames.TradeTools.verifiedContent(_4f8);
SwitchGames.TradeTools.hideShowSafeTrade();
SwitchGames.Dialogs.standardErrorDialog.hide();
};
SwitchGames.TradeTools.updateRunningTotals=function(){
var _4f9=2.95;
var _4fa=0.1;
var _4fb=Ext.get("sg-ms-publisher-donation-amount");
var _4fc=Ext.get("sg-ms-publisher-donation-percent");
var _4fd=Ext.get("sg-ms-donate-to-publisher-yes");
if(_4fd.dom.checked==true){
_4fc.dom.disabled=false;
}
var _4fe=Ext.get("sg-ms-donate-to-publisher-no");
if(_4fe.dom.checked==true){
_4fc.dom.disabled=true;
_4fc.dom.value="0";
}
var _4ff=Ext.select("span.ms-running-total",true);
var _500=parseFloat(Ext.fly("sg-ms-sell-price").dom.value);
if(isNaN(_500)){
_500=0;
}
var _501=_500*_4fa;
var _502=parseFloat(Ext.fly("sg-ms-publisher-donation-percent").dom.value)/100;
if(isNaN(_502)||_4fe.dom.checked==true){
_502=0;
}
var _503=_500*_502;
var _504=SwitchGames.Utility.formatCurrency(_503);
var _505=_500-_4f9-_501-_504;
var _506=SwitchGames.Utility.formatCurrency(_505);
_4fb.update(_504,false);
for(var i=0,n=_4ff.elements.length;i<n;i++){
var _509="$"+_506;
_4ff.elements[i].update(_509,false);
}
};
SwitchGames.TradeTools.renewListing=function(e,t){
};
});
Ext.onReady(function(){
SwitchGames.TradeOffer={};
SwitchGames.TradeOfferDD.init();
SwitchGames.TradeOffer.getItemMarkup=function(item){
var _50d=new Ext.XTemplate("<div style=\"overflow: none;\"class=\"to-scroll-box-item-prod-wrapper\">","<img width=\"49\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\"/>","</div>","<div class=\"to-scroll-box-item-prod-description\">","<span class=\"scroll-box-item-game-title\">{[SwitchGames.Utility.printTruncatedString(values.name, 12)]}</span><br/>","<span>{[SwitchGames.Utility.printTruncatedString(values.platform_name, 18)]}</span><br/>","<span>Released: {[SwitchGames.Utility.printTruncatedString(values.date_released, 10)]}</span><br/>","<span>Publisher: {[SwitchGames.Utility.printTruncatedString(values.publisher, 8)]}</span><br/>","<span>ESRB: {[SwitchGames.Utility.createStringValue(values.esrb)]}</span>","</div>");
var _50e=new Ext.XTemplate("<div style=\"overflow: none;\"class=\"to-scroll-box-item-prod-wrapper\">","<img width=\"49\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\"/>","</div>","<div class=\"to-scroll-box-item-prod-description\">","<span class=\"scroll-box-item-game-title\">{[SwitchGames.Utility.printTruncatedString(values.name, 12)]}</span><br/>","<span>{[SwitchGames.Utility.printTruncatedString(values.manufacturer, 18)]}</span><br/>","<span>Released: {[SwitchGames.Utility.printTruncatedString(values.date_released, 10)]}</span><br/>","</div>");
var _50f=new Ext.XTemplate("<div style=\"overflow: none;\"class=\"to-scroll-box-item-prod-wrapper\">","<img width=\"49\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\"/>","</div>","<div class=\"to-scroll-box-item-prod-description\">","<span class=\"scroll-box-item-game-title\">{[SwitchGames.Utility.printTruncatedString(values.name, 12)]}</span><br/>","<span>{[SwitchGames.Utility.printTruncatedString(values.platform_name, 18)]}</span><br/>","<span>Released: {[SwitchGames.Utility.printTruncatedString(values.date_released, 10)]}</span><br/>","</div>");
var _510=new Ext.XTemplate("<div style=\"width: 186px; height: 32px; margin-top: 80px; text-align: center; font-face: verdana,arial,helvetica,sans-serif; font-size: 14px; font-weight: normal;\">","Item is no longer available","</div>");
if(item.type=="game"){
return (_50d.apply(item.game));
}else{
if(item.type=="platform"){
return (_50e.apply(item.platform));
}else{
if(item.type=="accessory"){
return (_50f.apply(item.accessory));
}
}
}
};
SwitchGames.TradeOffer.tradeOfferDialogOuterTemplate=new Ext.XTemplate("<div name=\"panel-scroller-root\" class=\"to-dialog-body\" style=\"position: relative; height: 490px;\">","<div class=\"to-dialog-body-left-col\">","<div name=\"panel-scroller-left-arrow\">","<img src=\""+SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-left.png\" height=\"50\" width=\"50\" alt=\"button left\" style=\" \"/>","<span>PREV</span>","</div>","</div>","<div class=\"to-dialog-body-center-col\">","<div name=\"panel-scroller-content-root\" totalpanels=\"{total_panels}\" currentpanel=\"0\" style=\"background: transparent;\">","{bodies}","</div>","</div>","<div  class=\"to-dialog-body-right-col\">","<div name=\"panel-scroller-right-arrow\">","<img src=\""+SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-right.png\" height=\"50\" width=\"50\" alt=\"button left\"/>","<span>NEXT</span>","</div>","</div>","</div>");
SwitchGames.TradeOffer.tradeOfferPanel1Template=new Ext.XTemplate("<div name=\"panel-scroller-content\">","<div class=\"to-dialog-offering-top-wrapper\">","<div class=\"rb-box-dg\">","<div class=\"rb-box-dg-top\"><div></div></div>","<div class=\"rb-box-dg-content sg-dg-watermark\">","<div class=\"to-dialog-top-inner-wrapper\" style=\"height: 160px;\">","<div class=\"to-dialog-top-inner-wrapper-left\">","<div class=\"to-dialog-user-header-making-offer\">Making an offer to:</div>","<img class=\"\" src=\"{[SwitchGames.Utility.getAvatarValue(values.avatar)]}\" />","<div class=\"to-dialog-user-name\">{screen_name}</div>","</div>","<div class=\"to-dialog-top-inner-wrapper-right\">","<div class=\"to-dialog-user-header-for-item\">For this item:</div>","<img class=\"\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\" />","<div class=\"to-dialog-product-name\">{name}</div>","</div>","</div>","</div>","<div class=\"rb-box-dg-bottom\"><div></div></div>","</div>","</div>","<div class=\"to-dialog-offering-middle-wrapper\">","<div class=\"to-dialog-middle-inner-left\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\" style=\"text-align: center;\">Your Stuff</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\" style=\"height: 200px;\">","<img style=\"visibility: hidden\" class=\"to-scroll-box-btn-up\" src=\""+SwitchGames.imageUrl+"trade_offer/to-sm-btn-up.png\" height=\"20\" width=\"20\" alt=\"scroll up button\"/>","<div name=\"drop-element\" class=\"to-scroll-box-wrapper\">","<tpl for=\"mystuff\">","<div name=\"drag-element\" itemid=\"{id}\" class=\"to-scroll-box-item-wrapper\">","<div class=\"to-scroll-box-item-body\">","<div class=\"to-scroll-box-item-body-inner\">","{[SwitchGames.TradeOffer.getItemMarkup(values)]}","</div>","</div>","</div>","</tpl>","</div>","<img {[SwitchGames.Utility.getDownArrowVisibility(values.mystuff.length)]} class=\"to-scroll-box-btn-down\" src=\""+SwitchGames.imageUrl+"trade_offer/to-sm-btn-down.png\" height=\"20\" width=\"20\" alt=\"scroll down button\"/>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","<img class=\"to-scroll-box-area-drag-area\" src=\""+SwitchGames.imageUrl+"trade_offer/to-drag-arrow.gif\" width=\"49\" height=\"41\" alt=\"drag arrow graphic\" />","<div class=\"to-dialog-middle-inner-right\">","<!-- What You Are Offering Box -->","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\" style=\"text-align: center;\">What You Are Offering</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\" style=\"height: 200px;\">","<img style=\"visibility: hidden\" class=\"to-scroll-box-btn-up\" src=\""+SwitchGames.imageUrl+"trade_offer/to-sm-btn-up.png\" height=\"20\" width=\"20\" alt=\"scroll up button\"/>","<div id=\"to-offer-container\" name=\"drop-element\" class=\"to-scroll-box-wrapper\">","</div>","<img style=\"visibility: hidden\" class=\"to-scroll-box-btn-down\" src=\""+SwitchGames.imageUrl+"trade_offer/to-sm-btn-down.png\" height=\"20\" width=\"20\" alt=\"scroll down button\"/>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","</div>","<div class=\"to-dialog-offering-bottom-wrapper\">","<div class=\"rb-box-dg\">","<div class=\"rb-box-dg-top\"><div></div></div>","<div class=\"rb-box-dg-content\" style=\"text-align: center;\">","<span>This offer will expire in: </span>","<span><select id=\"to-time-expiration\"><option value=\"1\">1 Day</option><option value=\"2\">2 Days</option><option value=\"3\">3 Days</option><option value=\"4\">4 Days</option><option value=\"5\">5 Days</option><option value=\"6\">6 Days</option><option value=\"7\" selected>7 Days</option></select></span>","</div>","<div class=\"rb-box-dg-bottom\"><div></div></div>","</div>","</div>","</div>");
SwitchGames.TradeOffer.verifiedMemberPanelTemplate=new Ext.XTemplate("<div name=\"panel-scroller-content\" style=\"display: none; overflow: hidden;\">","<div style=\"margin-top:25px; margin-bottom: 30px; font-size: 34px; text-align: center;\">96% of members prefer trading with Verified Members</div>","<div class=\"verify-title\" style=\"overflow: hidden; zoom: 1 !important; font-weight: bold; font-size: 30px;\"><img src=\""+SwitchGames.imageUrl+"common/badges/badge-verified-large.png\" align=\"absmiddle\"/>&nbsp;Get The Badge Instantly!</div>","<ul class=\"no-list-style\" style=\"margin:20px 0px 0px 0px!important;\">","<li class=\"nl-1\">Credit card required for verification</li>","<li class=\"nl-2\">Your mailing address must match billing info</li>","<li class=\"nl-3\">$4.95 processing fee applies</li>","<li class=\"nl-4\">Immediately earn more trust from others</li>","</ul>","<div style=\"text-align:center;margin-top:25px;\">","<img src=\""+SwitchGames.imageUrl+"common/buttons/btn-verify.png\" style=\"cursor:pointer;\" onclick=\"SwitchGames.Account.VerifyMember(SwitchGames.TradeOffer.verifiedDialogCallback);\" />","</div>","<div style=\"text-align:center;margin-top:25px; font-size: 18px;\">(You <span style=\"font-weight: bold;\">will not</span> lose your place in this trade offer)</div>","</div>");
SwitchGames.TradeOffer.switchbotVerifiedMemberPanelTemplate=new Ext.XTemplate("<div name=\"panel-scroller-content\" style=\"display: none; overflow: hidden;\">","<div style=\"margin-top:25px; margin-bottom: 30px; font-size: 34px; text-align: center;\">96% of members prefer trading with Verified Members</div>","<div class=\"verify-title\" style=\"overflow: hidden; zoom: 1 !important; font-weight: bold; font-size: 30px;\"><img src=\""+SwitchGames.imageUrl+"common/badges/badge-verified-large.png\" align=\"absmiddle\"/>&nbsp;Get The Badge Instantly!</div>","<ul class=\"no-list-style\" style=\"margin:20px 0px 0px 0px!important;\">","<li class=\"nl-1\">Credit card required for verification</li>","<li class=\"nl-2\">Your mailing address must match billing info</li>","<li class=\"nl-3\">$4.95 processing fee applies</li>","<li class=\"nl-4\">Immediately earn more trust from others</li>","</ul>","<div style=\"text-align:center;margin-top:25px;\">","<img src=\""+SwitchGames.imageUrl+"common/buttons/btn-verify.png\" style=\"cursor:pointer;\" onclick=\"SwitchGames.Account.VerifyMember(SwitchGames.TradeOffer.switchbotVerifiedDialogCallback);\" />","</div>","<div style=\"text-align:center;margin-top:25px; font-size: 18px;\">(You <span style=\"font-weight: bold;\">will not</span> lose your place in this trade offer)</div>","</div>");
SwitchGames.TradeOffer.tradeOfferPanel2Template=new Ext.XTemplate("<div name=\"panel-scroller-content\" style=\"display:none\">","<div class=\"to-review-trade-offer-center-col\">","<div id=\"to-dialog-panel2-body\" class=\"to-dialog-offering-bottom-wrapper\">","<div class=\"rb-box-dg\">","<div class=\"rb-box-dg-top\"><div></div></div>","<div class=\"rb-box-dg-content\" style=\"text-align: center;\">","<span class=\"to-header-top\">Review this trade offer</span>","</div>","<div class=\"rb-box-dg-bottom\"><div></div></div>","</div>","</div>","<div class=\"to-dialog-offering-top-wrapper\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\">Issuing offer to:</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\">","<div class=\"to-wrapper\">","<div class=\"to-avatar \">","<img src=\"{[SwitchGames.Utility.getAvatarValue(values.avatar)]}\" alt=\"avatar image\" width=\"60\" height=\"59\" />","</div>","<div class=\"to-ratings-wrapper\">","<div class=\"to-ratings\">","<span class=\"to-ratings-plus\">+{ratings_positive}</span>","<span class=\"to-ratings-minus\">-{ratings_negative}</span>","</div>","<div  class=\"to-user-name\">","{screen_name}","</div>","</div>","<div  class=\"to-badges-wraper\">","<div class=\"to-badge-tenure-{tenure_badge}\" {[SwitchGames.Utility.getTenureTooltip(values.tenure_badge)]}></div>","<div class=\"to-badge-transactions-{transaction_badge}\" {[SwitchGames.Utility.getTransactionTooltip(values.transaction_badge)]}></div>","<div class=\"to-badge-philanthropy-{philanthropy_badge}\" {[SwitchGames.Utility.getPhilanthropyTooltip(values.philanthropy_badge)]}></div>","<br/>","<div class=\"to-badge-rating-{ratings_star_badge}\" {[SwitchGames.Utility.getRatingsStarTooltip(values.ratings_star_badge)]}></div>","<div class=\"to-badge-plus-member-{plus_badge}\" {[SwitchGames.Utility.getPlusTooltip(values.plus_badge)]}></div>","<div class=\"to-badge-verified-{verified_badge}\" name=\"verified-badge\" verified=\"{verified_badge}\" memberVerified=\"{member_verified}\"></div>","</div>","</div>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","<div class=\"to-dialog-offering-middle-wrapper\">","<div class=\"to-dialog-middle-inner-left\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\">Your Stuff:</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\" style=\"height: 200px;\">","<img {[SwitchGames.Utility.getDownArrowVisibility(0)]} class=\"to-scroll-box-btn-up\" src=\""+SwitchGames.imageUrl+"trade_offer/to-sm-btn-up.png\" height=\"20\" width=\"20\" alt=\"scroll up button\"/>","<div id=\"to-review-container\" class=\"to-scroll-box-wrapper\">","</div>","<img {[SwitchGames.Utility.getDownArrowVisibility(0)]} class=\"to-scroll-box-btn-down\" src=\""+SwitchGames.imageUrl+"trade_offer/to-sm-btn-down.png\" height=\"20\" width=\"20\" alt=\"scroll down button\"/>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","<div class=\"to-dialog-middle-inner-right\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\" >For:</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\" style=\"height: 200px; text-align: center;\">","<img class=\"to-dialog-for-game-box\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\" height=\"110\" width=\"95\" alt=\"Game Cover Devil May Cry\" />","<div class=\"to-dialog-for-game-description\">","<div class=\"to-dialog-for-game-title\">{name}</div>","<div class=\"to-dialog-for-game-platform\">{platform_name}</div>","</div>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","</div>","</div>","</div>");
SwitchGames.TradeOffer.tradeOfferPanel3Template=new Ext.XTemplate("<div name=\"panel-scroller-content\" style=\"display:none\">","<div class=\"rb-box-dg\">","<div class=\"rb-box-dg-top\"><div></div></div>","<div class=\"rb-box-dg-content\" style=\"text-align: center;\">","<span class=\"to-header-top\">trade offer sent!</span>","</div>","<div class=\"rb-box-dg-bottom\"><div></div></div>","</div>","<div class=\"to-banner-ad-wrapper\">","<div id=\"to-ad-banner\" class=\"to-banner-ad-300x250-show\">","</div>","</div>","</div>");
SwitchGames.TradeOffer.switchbotTradeOfferTemplate=new Ext.XTemplate("<div name=\"panel-scroller-content\">","<div class=\"to-review-trade-offer-center-col\">","<div id=\"to-dialog-panel2-body\" class=\"to-dialog-offering-bottom-wrapper\">","<div class=\"rb-box-dg\">","<div class=\"rb-box-dg-top\"><div></div></div>","<div class=\"rb-box-dg-content\" style=\"text-align: center;\">","<span class=\"to-header-top\">Review this trade offer</span>","</div>","<div class=\"rb-box-dg-bottom\"><div></div></div>","</div>","</div>","<div class=\"to-dialog-offering-top-wrapper\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\">Issuing offer to:</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\">","<tpl for=\"their_listing\">","<div class=\"to-wrapper\">","<div class=\"to-avatar \">","<img src=\"{[SwitchGames.Utility.getAvatarValue(values.avatar)]}\" alt=\"avatar image\" width=\"60\" height=\"59\" />","</div>","<div class=\"to-ratings-wrapper\">","<div class=\"to-ratings\">","<span class=\"to-ratings-plus\">+{ratings_positive}</span>","<span class=\"to-ratings-minus\">-{ratings_negative}</span>","</div>","<div  class=\"to-user-name\">","{screen_name}","</div>","</div>","<div  class=\"to-badges-wraper\">","<div class=\"to-badge-tenure-{tenure_badge}\" {[SwitchGames.Utility.getTenureTooltip(values.tenure_badge)]}></div>","<div class=\"to-badge-transactions-{transaction_badge}\" {[SwitchGames.Utility.getTransactionTooltip(values.transaction_badge)]}></div>","<div class=\"to-badge-philanthropy-{philanthropy_badge}\" {[SwitchGames.Utility.getPhilanthropyTooltip(values.philanthropy_badge)]}></div>","<br/>","<div class=\"to-badge-rating-{ratings_star_badge}\" {[SwitchGames.Utility.getRatingsStarTooltip(values.ratings_star_badge)]}></div>","<div class=\"to-badge-plus-member-{plus_badge}\" {[SwitchGames.Utility.getPlusTooltip(values.plus_badge)]}></div>","<div class=\"to-badge-verified-{verified_badge}\" {[SwitchGames.Utility.getVerifiedTooltip(values.verified_badge)]}></div>","</div>","</div>","</tpl>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","<div class=\"to-dialog-offering-middle-wrapper\">","<div class=\"to-dialog-middle-inner-left\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\" >You Are Offering:</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<tpl for=\"your_listing\">","<div class=\"sg-live-transactions-round-box-body-inner\" style=\"height: 200px; text-align: center;\">","<img class=\"to-dialog-for-game-box\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\" height=\"110\" width=\"95\" alt=\"Game Cover Devil May Cry\" />","<div class=\"to-dialog-for-game-description\">","<div class=\"to-dialog-for-game-title\">{name}</div>","<div class=\"to-dialog-for-game-platform\">{platform_name}</div>","</div>","</div>","</tpl>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","<div class=\"to-dialog-middle-inner-right\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\" >For:</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<tpl for=\"their_listing\">","<div class=\"sg-live-transactions-round-box-body-inner\" style=\"height: 200px; text-align: center;\">","<img class=\"to-dialog-for-game-box\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\" height=\"110\" width=\"95\" alt=\"Game Cover Devil May Cry\" />","<div class=\"to-dialog-for-game-description\">","<div class=\"to-dialog-for-game-title\">{name}</div>","<div class=\"to-dialog-for-game-platform\">{platform_name}</div>","</div>","</div>","</tpl>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","</div>","</div>","<div class=\"to-dialog-offering-bottom-wrapper\">","<div class=\"rb-box-dg\">","<div class=\"rb-box-dg-top\"><div></div></div>","<div class=\"rb-box-dg-content\" style=\"text-align: center;\">","<span>This offer will expire in:</span>","<span><select id=\"to-time-expiration\"><option value=\"1\">1 Day</option><option value=\"2\">2 Days</option><option value=\"3\">3 Days</option><option value=\"4\">4 Days</option><option value=\"5\">5 Days</option><option value=\"6\">6 Days</option><option value=\"7\" selected>7 Days</option></select></span>","<span>Days</span>","</div>","<div class=\"rb-box-dg-bottom\"><div></div></div>","</div>","</div>","</div>");
SwitchGames.TradeOffer.upClickRepeaters=[];
SwitchGames.TradeOffer.downClickRepeaters=[];
SwitchGames.TradeOffer.verifiedDialogCallback=function(_511){
if(_511==true){
SwitchGames.TradeOffer.verifiedMembershipComplete=true;
leftButtonEl=Ext.select("div[@name=\"panel-scroller-left-arrow\"]",true,SwitchGames.TradeOffer.tradeOfferDialog.body.dom).elements[0];
rightButtonEl=Ext.select("div[@name=\"panel-scroller-right-arrow\"]",true,SwitchGames.TradeOffer.tradeOfferDialog.body.dom).elements[0];
SwitchGames.Utility.updateVerifiedMemberElements();
SwitchGames.Utility.scrollPanelRight(rightButtonEl.findParent("[@name=\"panel-scroller-root\"]",20,true),1,2,"slide",true,null);
var _512=Ext.select("span",true,rightButtonEl.dom).elements[0];
_512.dom.innerHTML="FINISH!";
}
};
SwitchGames.TradeOffer.scrollRightCallback=function(_513,_514,_515,_516,_517){
if(_516==0){
var _518=Ext.get("to-offer-container");
var _519=_518.query("[@name=\"drag-element\"]");
if(_519.length!=0){
var _51a=Ext.get("to-review-container");
_51a.dom.innerHTML="";
Ext.DomHelper.useDom=true;
SwitchGames.TradeOffer.reviewInfo.mystuff="";
var _51b=[];
for(var i=0;i<_519.length;i++){
_51b.push(_519[i].getAttribute("itemid"));
var _51d=_519[i].cloneNode(true);
_51a.dom.appendChild(_51d);
}
SwitchGames.TradeOffer.reviewInfo.buyer_listing_ids=_51b.join(",");
if(_519.length>2){
_51a.prev().setVisible(true);
}
var _51e=Ext.select("span",true,_515.dom).elements[0];
if(SwitchGames.TradeOffer.verifiedMember==0){
if(SwitchGames.TradeOffer.verifiedMembershipComplete==false){
_51e.dom.innerHTML="&nbsp;&nbsp;SKIP";
}else{
SwitchGames.Utility.scrollPanelRight(_515.findParent("[@name=\"panel-scroller-root\"]",20,true),0,2,"slide",true,null);
_51e.dom.innerHTML="FINISH!";
return (false);
}
_51e.dom.innerHTML="&nbsp;&nbsp;SKIP";
}else{
_51e.dom.innerHTML="FINISH!";
}
return (true);
}else{
SwitchGames.Dialogs.showErrorDialog("Drag some items into the offer");
return (false);
}
}else{
if(_516==1){
var _515=_515;
var _514=_514;
if(SwitchGames.TradeOffer.verifiedMember==1){
finalReview={};
finalReview.buyer_member_id=SwitchGames.TradeOffer.reviewInfo.your_member_id;
finalReview.seller_member_id=SwitchGames.TradeOffer.reviewInfo.member_id;
finalReview.seller_listing_id=SwitchGames.TradeOffer.reviewInfo.listing_id;
finalReview.buyer_listing_ids=SwitchGames.TradeOffer.reviewInfo.buyer_listing_ids;
finalReview.expiry=Ext.fly("to-time-expiration").dom.value;
finalReview.pane="add_deal";
finalReview.type="trade";
var _51f=Ext.query("img",_515.dom)[0];
_515.addClass("sg-disabled");
var _520=_51f.src;
_51f.src=SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-right-processing.gif";
Ext.Ajax.request({url:"data/switch_center/live_transactions.php",params:finalReview,success:function(_521,_522){
_515.removeClass("sg-disabled");
_51f.src=_520;
createDealResponse=Ext.util.JSON.decode(_521.responseText);
if(createDealResponse.error==undefined&&createDealResponse.error==null){
_514.setVisible(false);
var _523=_515.findParent("div[@name=\"panel-scroller-root\"]",true);
var _524=Ext.select("div[@name=\"panel-scroller-content\"]",true,_523.dom);
_515.setVisible(false,false);
_514.setVisible(false,false);
SwitchGames.Utility.scrollPanelRight(_515.findParent("[@name=\"panel-scroller-root\"]",20,true),1,2,"slide",true,function(){
SwitchGames.Ads.AdManager.appendAd(Ext.getDom("to-ad-banner"),"transactional","tradeoffersent");
});
}else{
if(createDealResponse.trade_filter=="1"){
SwitchGames.Dialogs.messageBox("Trade Filter",createDealResponse.error);
}else{
SwitchGames.Dialogs.showErrorDialog(createDealResponse.error);
}
}
},failure:function(_525,_526){
_515.removeClass("sg-disabled");
_51f.src=_520;
SwitchGames.Dialogs.showErrorDialog("Error contacting server");
}});
return (false);
}else{
var _51e=Ext.select("span",true,_515.dom).elements[0];
_51e.dom.innerHTML="FINISH!";
}
}else{
if(_516==2){
var _515=_515;
var _514=_514;
if(SwitchGames.TradeOffer.verifiedMember==0){
finalReview={};
finalReview.buyer_member_id=SwitchGames.TradeOffer.reviewInfo.your_member_id;
finalReview.seller_member_id=SwitchGames.TradeOffer.reviewInfo.member_id;
finalReview.seller_listing_id=SwitchGames.TradeOffer.reviewInfo.listing_id;
finalReview.buyer_listing_ids=SwitchGames.TradeOffer.reviewInfo.buyer_listing_ids;
finalReview.expiry=Ext.fly("to-time-expiration").dom.value;
finalReview.pane="add_deal";
finalReview.type="trade";
var _51f=Ext.query("img",_515.dom)[0];
_515.addClass("sg-disabled");
var _520=_51f.src;
_51f.src=SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-right-processing.gif";
Ext.Ajax.request({url:"data/switch_center/live_transactions.php",params:finalReview,success:function(_527,_528){
_515.removeClass("sg-disabled");
_51f.src=_520;
createDealResponse=Ext.util.JSON.decode(_527.responseText);
if(createDealResponse.error==undefined&&createDealResponse.error==null){
_514.setVisible(false);
var _529=_515.findParent("div[@name=\"panel-scroller-root\"]",true);
var _52a=Ext.select("div[@name=\"panel-scroller-content\"]",true,_529.dom);
_515.setVisible(false,false);
_514.setVisible(false,false);
SwitchGames.Utility.scrollPanelRight(_515.findParent("[@name=\"panel-scroller-root\"]",20,true),2,3,"slide",true,function(){
SwitchGames.Ads.AdManager.appendAd(Ext.getDom("to-ad-banner"),"transactional","tradeoffersent");
});
}else{
SwitchGames.Dialogs.showErrorDialog(createDealResponse.error);
}
},failure:function(_52b,_52c){
_515.removeClass("sg-disabled");
_51f.src=_520;
SwitchGames.Dialogs.showErrorDialog("Error contacting server");
}});
return (false);
}else{
return (true);
}
}else{
return (true);
}
}
}
};
SwitchGames.TradeOffer.scrollLeftCallback=function(_52d,_52e,_52f,_530,_531){
var _532=Ext.select("span",true,_52f.dom).elements[0];
if(_530==1){
_532.dom.innerHTML="NEXT";
}else{
if(_530==2){
if(SwitchGames.TradeOffer.verifiedMember==0){
if(SwitchGames.TradeOffer.verifiedMembershipComplete==false){
_532.dom.innerHTML="&nbsp;&nbsp;SKIP";
}else{
SwitchGames.Utility.scrollPanelLeft(_52f.findParent("[@name=\"panel-scroller-root\"]",20,true),2,0,"slide",true,null);
_532.dom.innerHTML="&nbsp;&nbsp;NEXT";
return (false);
}
}
}
}
return (true);
};
SwitchGames.TradeOffer.switchbotVerifiedDialogCallback=function(_533){
if(_533==true){
SwitchGames.TradeOffer.verifiedMembershipComplete=true;
leftButtonEl=Ext.select("div[@name=\"panel-scroller-left-arrow\"]",true,SwitchGames.TradeOffer.switchbotTradeOfferDialog.body.dom).elements[0];
rightButtonEl=Ext.select("div[@name=\"panel-scroller-right-arrow\"]",true,SwitchGames.TradeOffer.switchbotTradeOfferDialog.body.dom).elements[0];
SwitchGames.Utility.updateVerifiedMemberElements();
SwitchGames.Utility.scrollPanelLeft(rightButtonEl.findParent("[@name=\"panel-scroller-root\"]",20,true),1,0,"slide",true,null);
var _534=Ext.select("span",true,rightButtonEl.dom).elements[0];
_534.dom.innerHTML="FINISH!";
}
};
SwitchGames.TradeOffer.switchbotScrollRightCallback=function(_535,_536,_537,_538,_539){
if(_538==0){
var _537=_537;
var _536=_536;
if(SwitchGames.TradeOffer.verifiedMember==1){
finalReview={};
finalReview.buyer_member_id=SwitchGames.TradeOffer.reviewInfo.your_listing.your_member_id;
finalReview.seller_member_id=SwitchGames.TradeOffer.reviewInfo.their_listing.member_id;
finalReview.seller_listing_id=SwitchGames.TradeOffer.reviewInfo.their_listing.listing_id;
finalReview.buyer_listing_ids=SwitchGames.TradeOffer.reviewInfo.your_listing.listing_id;
finalReview.expiry=Ext.fly("to-time-expiration").dom.value;
finalReview.pane="add_deal";
finalReview.type="trade";
var _53a=Ext.query("img",_537.dom)[0];
_537.addClass("sg-disabled");
var _53b=_53a.src;
_53a.src=SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-right-processing.gif";
Ext.Ajax.request({url:"data/switch_center/live_transactions.php",params:finalReview,success:function(_53c,_53d){
_537.removeClass("sg-disabled");
_53a.src=_53b;
createDealResponse=Ext.util.JSON.decode(_53c.responseText);
if(createDealResponse.error==undefined&&createDealResponse.error==null){
_536.setVisible(false);
var _53e=_537.findParent("div[@name=\"panel-scroller-root\"]",true);
var _53f=Ext.select("div[@name=\"panel-scroller-content\"]",true,_53e.dom);
_537.setVisible(false,false);
_536.setVisible(false,false);
SwitchGames.Utility.scrollPanelRight(_537.findParent("[@name=\"panel-scroller-root\"]",20,true),0,1,"slide",true,function(){
SwitchGames.Ads.AdManager.appendAd(Ext.getDom("to-ad-banner"),"transactional","tradeoffersent");
});
}else{
SwitchGames.Dialogs.showErrorDialog(createDealResponse.error);
}
},failure:function(_540,_541){
_537.removeClass("sg-disabled");
_53a.src=_53b;
SwitchGames.Dialogs.showErrorDialog("Error contacting server");
}});
return (false);
}else{
var _542=Ext.select("span",true,_537.dom).elements[0];
if(SwitchGames.TradeOffer.verifiedMembershipComplete==false){
_542.dom.innerHTML="&nbsp;&nbsp;SKIP";
}else{
finalReview={};
finalReview.buyer_member_id=SwitchGames.TradeOffer.reviewInfo.your_listing.your_member_id;
finalReview.seller_member_id=SwitchGames.TradeOffer.reviewInfo.their_listing.member_id;
finalReview.seller_listing_id=SwitchGames.TradeOffer.reviewInfo.their_listing.listing_id;
finalReview.buyer_listing_ids=SwitchGames.TradeOffer.reviewInfo.your_listing.listing_id;
finalReview.expiry=Ext.fly("to-time-expiration").dom.value;
finalReview.pane="add_deal";
finalReview.type="trade";
var _53a=Ext.query("img",_537.dom)[0];
_537.addClass("sg-disabled");
var _53b=_53a.src;
_53a.src=SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-right-processing.gif";
Ext.Ajax.request({url:"data/switch_center/live_transactions.php",params:finalReview,success:function(_543,_544){
_537.removeClass("sg-disabled");
_53a.src=_53b;
createDealResponse=Ext.util.JSON.decode(_543.responseText);
if(createDealResponse.error==undefined&&createDealResponse.error==null){
_536.setVisible(false);
var _545=_537.findParent("div[@name=\"panel-scroller-root\"]",true);
var _546=Ext.select("div[@name=\"panel-scroller-content\"]",true,_545.dom);
_537.setVisible(false,false);
_536.setVisible(false,false);
SwitchGames.Utility.scrollPanelRight(_537.findParent("[@name=\"panel-scroller-root\"]",20,true),0,2,"slide",true,function(){
SwitchGames.Ads.AdManager.appendAd(Ext.getDom("to-ad-banner"),"transactional","tradeoffersent");
});
}else{
SwitchGames.Dialogs.showErrorDialog(createDealResponse.error);
}
},failure:function(_547,_548){
_537.removeClass("sg-disabled");
_53a.src=_53b;
SwitchGames.Dialogs.showErrorDialog("Error contacting server");
}});
return (false);
}
}
}else{
if(_538==1){
var _537=_537;
var _536=_536;
if(SwitchGames.TradeOffer.verifiedMember==0){
finalReview={};
finalReview.buyer_member_id=SwitchGames.TradeOffer.reviewInfo.your_listing.your_member_id;
finalReview.seller_member_id=SwitchGames.TradeOffer.reviewInfo.their_listing.member_id;
finalReview.seller_listing_id=SwitchGames.TradeOffer.reviewInfo.their_listing.listing_id;
finalReview.buyer_listing_ids=SwitchGames.TradeOffer.reviewInfo.your_listing.listing_id;
finalReview.expiry=Ext.fly("to-time-expiration").dom.value;
finalReview.pane="add_deal";
finalReview.type="trade";
var _53a=Ext.query("img",_537.dom)[0];
_537.addClass("sg-disabled");
var _53b=_53a.src;
_53a.src=SwitchGames.imageUrl+"common/arrows/scroll-panel-arrow-right-processing.gif";
Ext.Ajax.request({url:"data/switch_center/live_transactions.php",params:finalReview,success:function(_549,_54a){
_537.removeClass("sg-disabled");
_53a.src=_53b;
createDealResponse=Ext.util.JSON.decode(_549.responseText);
if(createDealResponse.error==undefined&&createDealResponse.error==null){
_536.setVisible(false);
var _54b=_537.findParent("div[@name=\"panel-scroller-root\"]",true);
var _54c=Ext.select("div[@name=\"panel-scroller-content\"]",true,_54b.dom);
_537.setVisible(false,false);
_536.setVisible(false,false);
SwitchGames.Utility.scrollPanelRight(_537.findParent("[@name=\"panel-scroller-root\"]",20,true),1,2,"slide",true,function(){
SwitchGames.Ads.AdManager.appendAd(Ext.getDom("to-ad-banner"),"transactional","tradeoffersent");
});
}else{
SwitchGames.Dialogs.showErrorDialog(createDealResponse.error);
}
},failure:function(_54d,_54e){
_537.removeClass("sg-disabled");
_53a.src=_53b;
SwitchGames.Dialogs.showErrorDialog("Error contacting server");
}});
return (false);
}else{
return (true);
}
}else{
return (true);
}
}
};
SwitchGames.TradeOffer.switchbotScrollLeftCallback=function(_54f,_550,_551,_552,_553){
var _554=Ext.select("span",true,_551.dom).elements[0];
if(_552==1){
if(SwitchGames.TradeOffer.verifiedMember==0){
if(SwitchGames.TradeOffer.verifiedMembershipComplete==false){
_554.dom.innerHTML="&nbsp;&nbsp;NEXT";
}else{
SwitchGames.Utility.scrollPanelLeft(_551.findParent("[@name=\"panel-scroller-root\"]",20,true),1,0,"slide",true,null);
_554.dom.innerHTML="&nbsp;&nbsp;FINISH";
return (false);
}
}
}
return (true);
};
SwitchGames.TradeOffer.trade=function(_555){
if(SwitchGames.TradeOffer.tradeOfferDialog==null){
SwitchGames.TradeOffer.tradeOfferDialog=SwitchGames.Dialogs.createDialog("","trade-offer-dlg","Trade Offer",600,null,"sg-window");
}
SwitchGames.TradeOffer.verifiedMembershipComplete=false;
Ext.Ajax.request({url:"data/switch_center/trade_offer_request.php",params:{pane:"trade",listing_id:_555},success:function(_556,_557){
var i,j,_55a,_55b;
SwitchGames.TradeOffer.listingInfo=Ext.util.JSON.decode(_556.responseText);
if(SwitchGames.TradeOffer.listingInfo.error!=undefined){
SwitchGames.Dialogs.showErrorDialog(SwitchGames.TradeOffer.listingInfo.error);
return;
}else{
SwitchGames.TradeOffer.verifiedMember=SwitchGames.TradeOffer.listingInfo.member_verified;
SwitchGames.Utility.removeVerifiedTooltips(SwitchGames.TradeOffer);
SwitchGames.TradeOffer.reviewInfo=SwitchGames.Utility.deepCopy(SwitchGames.TradeOffer.listingInfo);
delete SwitchGames.TradeOffer.reviewInfo.mystuff;
SwitchGames.TradeOffer.reviewInfo.buyer_listing_ids="";
var _55c=SwitchGames.TradeOffer.tradeOfferPanel1Template.apply(SwitchGames.TradeOffer.listingInfo);
var _55d=SwitchGames.TradeOffer.tradeOfferPanel2Template.apply(SwitchGames.TradeOffer.reviewInfo);
var _55e={};
var _55f=SwitchGames.TradeOffer.tradeOfferPanel3Template.apply(_55e);
var _560="";
var _561="";
var _562={};
if(SwitchGames.TradeOffer.verifiedMember==0){
_561=SwitchGames.TradeOffer.verifiedMemberPanelTemplate.apply({});
_560=_55c+_561+_55d+_55f;
_562={bodies:_560,total_panels:4};
}else{
_560=_55c+_55d+_55f;
_562={bodies:_560,total_panels:3};
}
var _563=SwitchGames.TradeOffer.tradeOfferDialogOuterTemplate.apply(_562);
SwitchGames.TradeOffer.tradeOfferDialog.body.dom.innerHTML=_563;
var _564=false;
SwitchGames.Utility.createVerifiedBadgeTooltips(SwitchGames.TradeOffer.tradeOfferDialog.body,SwitchGames.TradeOffer,"SwitchGames.Utility.verifiedMemberCallback");
SwitchGames.Utility.setupLeftRightScrolling(Ext.select("div[@name=\"panel-scroller-content-root\"]",true,SwitchGames.TradeOffer.tradeOfferDialog.body.dom).elements[0],Ext.select("div[@name=\"panel-scroller-left-arrow\"]",true,SwitchGames.TradeOffer.tradeOfferDialog.body.dom).elements[0],Ext.select("div[@name=\"panel-scroller-right-arrow\"]",true,SwitchGames.TradeOffer.tradeOfferDialog.body.dom).elements[0],"slide",true,SwitchGames.TradeOffer.scrollLeftCallback,SwitchGames.TradeOffer.scrollRightCallback,null);
SwitchGames.TradeOffer.tradeOfferDialog.show();
var _565=Ext.select("div[@name=\"drag-element\"]",true,SwitchGames.TradeOffer.tradeOfferDialog.body.dom);
myDragElementList=_565;
var _566=Ext.select("div[@name=\"drop-element\"]",true,SwitchGames.TradeOffer.tradeOfferDialog.body.dom);
myDropElementList=_566;
SwitchGames.TradeOfferDD.removeDragTargets();
SwitchGames.TradeOfferDD.removeDropTargets();
SwitchGames.TradeOfferDD.addDragTargets(_565.elements);
SwitchGames.TradeOfferDD.addDropTargets(_566.elements);
SwitchGames.TradeOffer.upButtonClickHandler=function(e){
var upEl=Ext.get(e.el);
var _569=upEl.next().next();
var _56a=upEl.next();
_56a.stopFx();
var _56b=_56a.scroll("up",81,{duration:0.1,callback:function(el){
if(el.dom.scrollTop==0){
upEl.setVisible(false);
}
}});
if(!_56b){
upEl.setVisible(false);
}
if(_56a.dom.scrollHeight!=_56a.dom.offsetHeight){
_569.setVisible(true);
}
};
SwitchGames.TradeOffer.downButtonClickHandler=function(e){
var _56e=Ext.get(e.el);
var upEl=_56e.prev().prev();
var _570=_56e.prev();
_570.stopFx();
var _571=_570.scroll("down",81,{duration:0.1,callback:function(el){
if(el.dom.scrollTop+el.dom.offsetHeight>=el.dom.scrollHeight){
_56e.setVisible(false);
}
}});
_56e.setVisible(_571);
if(_570.dom.scrollHeight!=_570.dom.offsetHeight){
upEl.setVisible(true);
}
};
for(i=0;i<SwitchGames.TradeOffer.upClickRepeaters;i++){
Ext.destroy(SwitchGames.TradeOffer.upClickRepeaters[i]);
}
for(i=0;i<SwitchGames.TradeOffer.downClickRepeaters;i++){
Ext.destroy(SwitchGames.TradeOffer.downClickRepeaters[i]);
}
SwitchGames.TradeOffer.upClickRepeaters=[];
SwitchGames.TradeOffer.downClickRepeaters=[];
var _573=Ext.select("img.to-scroll-box-btn-up",true,SwitchGames.TradeOffer.tradeOfferDialog.body.dom);
for(i=0;i<_573.elements.length;i++){
var _574=new Ext.util.ClickRepeater(_573.elements[i].dom,{accelerate:false,el:_573.elements[i]});
SwitchGames.TradeOffer.upClickRepeaters.push(_574);
_574.on("click",SwitchGames.TradeOffer.upButtonClickHandler,_574,{preventDefault:true});
}
var _575=Ext.select("img.to-scroll-box-btn-down",true,SwitchGames.TradeOffer.tradeOfferDialog.body.dom);
for(i=0;i<_575.elements.length;i++){
var _574=new Ext.util.ClickRepeater(_575.elements[i].dom,{accelerate:false,el:_575.elements[i]});
SwitchGames.TradeOffer.downClickRepeaters.push(_574);
_574.on("click",SwitchGames.TradeOffer.downButtonClickHandler,_574,{preventDefault:true});
}
}
},failure:function(_576,_577){
SwitchGames.Dialogs.standardErrorDialog("Error connecting to web server");
}});
};
SwitchGames.TradeOffer.switchbotTrade=function(_578,_579){
if(SwitchGames.TradeOffer.switchbotTradeOfferDialog==null){
SwitchGames.TradeOffer.switchbotTradeOfferDialog=SwitchGames.Dialogs.createDialog("","switchbot-trade-offer-dlg","Switchbot Trade Offer",600,null,"sg-window");
}
SwitchGames.TradeOffer.verifiedMembershipComplete=false;
Ext.Ajax.request({url:"data/switch_center/trade_offer_request.php",params:{pane:"switchbot_trade",their_listing_id:_578,your_listing_id:_579},success:function(_57a,_57b){
var i,j,_57e,_57f;
SwitchGames.TradeOffer.reviewInfo=Ext.util.JSON.decode(_57a.responseText);
if(SwitchGames.TradeOffer.reviewInfo.error!=undefined){
SwitchGames.Dialogs.showErrorDialog(SwitchGames.TradeOffer.reviewInfo.error);
return;
}
SwitchGames.TradeOffer.verifiedMember=SwitchGames.TradeOffer.reviewInfo.your_listing.member_verified;
SwitchGames.Utility.removeVerifiedTooltips(SwitchGames.TradeOffer);
var _580=SwitchGames.TradeOffer.switchbotTradeOfferTemplate.apply(SwitchGames.TradeOffer.reviewInfo);
var _581={};
var _582=SwitchGames.TradeOffer.tradeOfferPanel3Template.apply(_581);
var _583="";
var _584="";
var _585={};
if(SwitchGames.TradeOffer.verifiedMember==0){
_584=SwitchGames.TradeOffer.switchbotVerifiedMemberPanelTemplate.apply({});
_583=_580+_584+_582;
_585={bodies:_583,total_panels:3};
}else{
_583=_580+_582;
_585={bodies:_583,total_panels:2};
}
var _586=SwitchGames.TradeOffer.tradeOfferDialogOuterTemplate.apply(_585);
SwitchGames.TradeOffer.switchbotTradeOfferDialog.body.dom.innerHTML=_586;
SwitchGames.Utility.createVerifiedBadgeTooltips(SwitchGames.TradeOffer.switchbotTradeOfferDialog.body,SwitchGames.TradeOffer,"SwitchGames.Utility.verifiedMemberCallback");
SwitchGames.Utility.setupLeftRightScrolling(Ext.select("div[@name=\"panel-scroller-content-root\"]",true,SwitchGames.TradeOffer.switchbotTradeOfferDialog.body.dom).elements[0],Ext.select("div[@name=\"panel-scroller-left-arrow\"]",true,SwitchGames.TradeOffer.switchbotTradeOfferDialog.body.dom).elements[0],Ext.select("div[@name=\"panel-scroller-right-arrow\"]",true,SwitchGames.TradeOffer.switchbotTradeOfferDialog.body.dom).elements[0],"slide",true,SwitchGames.TradeOffer.switchbotScrollLeftCallback,SwitchGames.TradeOffer.switchbotScrollRightCallback,null);
var _587=Ext.select("span",true,Ext.select("div[@name=\"panel-scroller-right-arrow\"]",true,SwitchGames.TradeOffer.switchbotTradeOfferDialog.body.dom).elements[0].dom).elements[0];
if(SwitchGames.TradeOffer.verifiedMember==0){
_587.dom.innerHTML="&nbsp;&nbsp;NEXT";
}else{
_587.dom.innerHTML="FINISH!";
}
SwitchGames.TradeOffer.switchbotTradeOfferDialog.show();
},failure:function(_588,_589){
SwitchGames.Dialogs.standardErrorDialog("Error connecting to web server");
}});
};
});
Ext.onReady(function(){
Ext.Fx.fadeOut=function(o){
var el=this.getFxEl();
o=o||{};
el.queueFx(o,function(){
var to=o.endOpacity||0;
arguments.callee.anim=this.fxanim({opacity:{to:to}},o,null,0.5,"easeOut",function(){
if(to===0){
if(this.visibilityMode==Ext.Element.DISPLAY||o.useDisplay){
this.dom.style.display="none";
}else{
this.dom.style.visibility="hidden";
}
this.clearOpacity();
}
el.afterFx(o);
});
});
return this;
};
Ext.Fx.fadeIn=function(o){
var el=this.getFxEl();
o=o||{};
el.queueFx(o,function(){
var _58f=o.noReset;
if(_58f&&_58f!=true){
this.setOpacity(0);
}
this.fixDisplay();
this.dom.style.visibility="visible";
var to=o.endOpacity||1;
arguments.callee.anim=this.fxanim({opacity:{to:to}},o,null,0.5,"easeOut",function(){
if(to==1){
this.clearOpacity();
}
el.afterFx(o);
});
});
return this;
};
Ext.apply(Ext.Element.prototype,Ext.Fx);
if(!window.SwitchGames){
window.SwitchGames={};
}
if(!SwitchGames.Tasks){
SwitchGames.Tasks={};
}
SwitchGames.Tasks.getLoginStateInfo=function(_591){
var _591=_591==undefined?false:_591;
Ext.Ajax.request({url:"data/common/utilities.php",params:{pane:"get_login_state_info"},success:function(_592,_593){
var data=Ext.decode(_592.responseText);
if(data.error!=undefined&&data.error!=null){
if(data.error=="Not logged in"){
SwitchGames.userInfo={};
SwitchGames.userInfo.loggedIn=false;
SwitchGames.userInfo.verified=-1;
var _595=Ext.fly("sg-total-item-count");
if(_595){
_595.update(SwitchGames.Utility.formatWithCommas(data.total_listing_count.toString()));
}
if(SwitchGames.Tasks.periodicUpdateRunner){
SwitchGames.Tasks.periodicUpdateRunner.stop(SwitchGames.Tasks.periodicUpdateTask);
}
}
}else{
var _595=Ext.fly("sg-total-item-count");
if(_595){
_595.update(SwitchGames.Utility.formatWithCommas(data.total_listing_count.toString()));
}
if(SwitchGames.userInfo==undefined||SwitchGames.userInfo==null){
SwitchGames.userInfo={};
}
SwitchGames.userInfo.id=data.member_id;
SwitchGames.userInfo.screenName=data.screen_name;
SwitchGames.userInfo.email=data.email;
SwitchGames.userInfo.loggedIn=true;
SwitchGames.userInfo.verified=data.verified;
var _596=Ext.get("alert-icon");
var _597=Ext.get("message-icon");
var _598=Ext.get("members-want-count");
var _599=Ext.get("members-have-count");
var _59a=Ext.get("check-switchbot");
var _59b=data.message_count;
var _59c=data.action_count;
var _59d=data.members_want_count;
var _59e=data.members_have_count;
if(_59d==0){
_598.dom.innerHTML="<a style=\"color: #FFFFFF;\" href=\"trade_tools.php?tab=my_stuff\"><b>No</b> members want stuff you have&nbsp;&nbsp;</a>";
}else{
if(_59d==1){
_598.dom.innerHTML="<a style=\"color: #FFFFFF;\" href=\"trade_tools.php?tab=my_stuff\"><b>"+_59d+"</b> member wants stuff you have&nbsp;&nbsp;</a>";
}else{
_598.dom.innerHTML="<a style=\"color: #FFFFFF;\" href=\"trade_tools.php?tab=my_stuff\"><b>"+_59d+"</b> members want stuff you have&nbsp;&nbsp;</a>";
}
}
if(_59e==0){
_599.dom.innerHTML="<a style=\"color: #FFFFFF;\" href=\"trade_tools.php?tab=wishlist\"><b>No</b> members have stuff you want</a><span style=\"color: #FFFFFF; font-size: 12px; padding: 0px;\">&nbsp;&nbsp;&nbsp;</span><a style=\"color: #FFFFFF;\" href=\"trade_tools.php?tab=switchbot\">Check SwitchBot</a>";
}else{
if(_59e==1){
_599.dom.innerHTML="<a style=\"color: #FFFFFF;\" href=\"trade_tools.php?tab=wishlist\"><b>"+_59e+"</b> member has stuff you want</a><span style=\"color: #FFFFFF; font-size: 12px; padding: 0px;\">&nbsp;&nbsp;&nbsp;</span><a style=\"color: #FFFFFF;\" href=\"trade_tools.php?tab=switchbot\">Check SwitchBot</a>";
}else{
_599.dom.innerHTML="<a style=\"color: #FFFFFF;\" href=\"trade_tools.php?tab=wishlist\"><b>"+_59e+"</b> members have stuff you want</a><span style=\"color: #FFFFFF; font-size: 12px; padding: 0px;\">&nbsp;&nbsp;&nbsp;</span><a style=\"color: #FFFFFF;\" href=\"trade_tools.php?tab=switchbot\">Check SwitchBot</a>";
}
}
if(_59b>0){
Ext.fly("login-message-count").setOpacity(1);
if(_59b!=SwitchGames.Tasks.memberMessageCount){
Ext.fly("login-message-count").dom.innerHTML=_59b;
SwitchGames.Tasks.messageIconRunner.start(SwitchGames.Tasks.messageIconTask);
SwitchGames.Tasks.memberMessageCount=_59b;
if(SwitchGames.Messages&&SwitchGames.Messages.load&&_591==false){
SwitchGames.Messages.load();
}
}
}else{
SwitchGames.Tasks.messageIconRunner.stop(SwitchGames.Tasks.messageIconTask);
SwitchGames.Tasks.memberMessageCount=0;
_597.setOpacity(0.1);
Ext.fly("login-message-count").dom.innerHTML="";
}
if(_59c>0){
if(_59c!=SwitchGames.Tasks.memberActionCount){
Ext.fly("login-action-count").dom.innerHTML=_59c;
SwitchGames.Tasks.memberActionCount=_59c;
}
SwitchGames.Tasks.alertIconRunner.start(SwitchGames.Tasks.alertIconTask);
}else{
Ext.fly("login-action-count").dom.innerHTML="";
SwitchGames.Tasks.alertIconRunner.stop(SwitchGames.Tasks.alertIconTask);
_596.setOpacity(0.1);
}
}
},failure:function(_59f,_5a0){
}});
};
if(window.location.pathname.match("label_print")==null){
SwitchGames.Tasks.messageIconRunner=new Ext.util.TaskRunner();
SwitchGames.Tasks.alertIconRunner=new Ext.util.TaskRunner();
SwitchGames.Tasks.periodicUpdateRunner=new Ext.util.TaskRunner();
SwitchGames.Tasks.memberMessageCount=0;
SwitchGames.Tasks.memberActionCount=0;
SwitchGames.Tasks.messageIconTask={run:function(){
var _5a1=Ext.get("message-icon");
_5a1.sequenceFx().fadeOut({endOpacity:0.5,duration:0.75,easing:"easeNone",remove:false,useDisplay:false}).fadeIn({noReset:true,endOpacity:1,duration:0.75,easing:"easeNone",remove:false,useDisplay:false});
},interval:5000};
SwitchGames.Tasks.alertIconTask={run:function(){
var _5a2=Ext.get("alert-icon");
_5a2.sequenceFx().fadeOut({endOpacity:0.5,duration:0.75,easing:"easeNone",remove:false,useDisplay:false}).fadeIn({noReset:true,endOpacity:1,duration:0.75,easing:"easeNone",remove:false,useDisplay:false});
},interval:5000};
SwitchGames.Tasks.periodicUpdateTask={run:SwitchGames.Tasks.getLoginStateInfo,interval:300000};
SwitchGames.Tasks.periodicUpdateRunner.start(SwitchGames.Tasks.periodicUpdateTask);
Ext.fly("login-state-button").on("click",function(e,t){
var _5a5=Ext.get(t);
var _5a6=Ext.get("login-state-body");
if(_5a5.hasClass("sg-login-left-button-logged-in-closed")){
_5a5.removeClass("sg-login-left-button-logged-in-closed");
_5a5.addClass("sg-login-left-button-logged-in-open");
_5a6.slideIn("r",{easing:"easeOut",duration:0.35,useDisplay:true,block:true,concurrent:false});
}else{
if(_5a5.hasClass("sg-login-left-button-logged-in-open")){
_5a5.removeClass("sg-login-left-button-logged-in-open");
_5a5.addClass("sg-login-left-button-logged-in-closed");
_5a6.slideOut("r",{easing:"easeOut",duration:0.35,useDisplay:true,block:true,concurrent:false});
}else{
if(_5a5.hasClass("sg-login-left-button-logged-out-closed")){
_5a5.removeClass("sg-login-left-button-logged-out-closed");
_5a5.addClass("sg-login-left-button-logged-out-open");
_5a6.slideIn("r",{easing:"easeOut",duration:0.35,useDisplay:true,block:true,concurrent:false});
}else{
if(_5a5.hasClass("sg-login-left-button-logged-out-open")){
_5a5.removeClass("sg-login-left-button-logged-out-open");
_5a5.addClass("sg-login-left-button-logged-out-closed");
_5a6.slideOut("r",{easing:"easeOut",duration:0.35,useDisplay:true,block:true,concurrent:false});
}
}
}
}
});
Ext.get(document.body).on("click",function(e,t){
if(SwitchGames.loggedIn==true){
var href=t.getAttribute("link");
window.location.href=href;
return;
}
SwitchGames.Dialogs.showNotLoggedInDialog();
},this,{delegate:"a[@name=\"login-required-button\"]"});
}
});
var ddmenuTimeout=500;
var ddmenuCloseTimer=0;
var ddmenuItem=0;
function mopen(id){
mcancelclosetime();
if(ddmenuItem){
ddmenuItem.style.visibility="hidden";
}
ddmenuItem=document.getElementById(id);
ddmenuItem.style.visibility="visible";
};
function mclose(){
if(ddmenuItem){
ddmenuItem.style.visibility="hidden";
}
};
function mclosetime(){
ddmenuCloseTimer=window.setTimeout(mclose,ddmenuTimeout);
};
function mcancelclosetime(){
if(ddmenuCloseTimer){
window.clearTimeout(ddmenuCloseTimer);
ddmenuCloseTimer=null;
}
};
document.onclick=mclose;
Ext.onReady(function(){
Ext.namespace("SwitchGames","SwitchGames.Account");
if(SwitchGames.Account.verifyMemberDialog==null){
SwitchGames.Account.verifyMemberDialog=SwitchGames.Dialogs.createDialog("","verify-member-dlg","",696,null,"sg-window",true);
}
var _5ab=["<div class=\"verify-title\"><img src=\""+SwitchGames.imageUrl+"common/badges/badge-verified-large.png\" align=\"absmiddle\"/> Verified Membership Badge</div>","<div class=\"verify-font-blue-large align-center\" style=\"margin-top:15px;\">Verifying your identity = more trust from others</div>","<div class=\"verify-font-grey align-center\" style=\"margin-top:10px;\">Having the Verified Member Badge lets other members of the community<br/>see that you have validated your billing information and we know who you are.<br/><br/>To obtain a Verified Membership badge, your SwitchGames shipping address<br/>must match the billing address on file with a major credit card. If the information<br/>does not match, you will not be granted a Verified Membership badge.</div>","<ul class=\"no-list-style\" style=\"margin:20px 0px 0px 10px!important;\">","<li style=\"line-height: 32px; padding-left: 45px;\"><img src=\""+SwitchGames.imageUrl+"common/numbers/number-white-1.gif\" align=\"top\"/><span class=\"verify-number-text\"> Become a Verified Member instantly!</span></li>","<li style=\"line-height: 32px; padding-left: 45px;\"><img src=\""+SwitchGames.imageUrl+"common/numbers/number-white-2.gif\" align=\"top\"/><span class=\"verify-number-text\"> Valid credit card required</span></li>","<li style=\"line-height: 32px; padding-left: 45px;\"><img src=\""+SwitchGames.imageUrl+"common/numbers/number-white-3.gif\" align=\"top\"/><span class=\"verify-number-text\"> $4.95 processing fee applies</span></li>","</ul>"];
var _5ac=["<div class=\"verify-title\"><img src=\""+SwitchGames.imageUrl+"common/badges/badge-verified-large.png\" align=\"absmiddle\"/> Verified Membership Badge<span class=\"verify-dots-container\"><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-blue.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/></span></div>","<div style=\"margin-left:10px;\">","<div class=\"verify-font-blue-small\" style=\"margin-top:10px;\">SHIPPING INFORMATION<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 5px;\"/><a href=\"https://sealinfo.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&dn=WWW.SWITCHGAMES.COM&lang=en\" target=\"_blank\"><img src=\""+SwitchGames.imageUrl+"common/icons/icon-thawte.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 0px;\"/></a><span id=\"verify-member-panel1error\" class=\"verify-error-text\"></span></div>","<!-- start form -->","<table class=\"table-form\" style=\"margin-top:10px;\">","<tr>","<td colspan=\"4\" style=\"height:15px;\"></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">first name</label>","</td>","<td><input id=\"verify-member-ship-firstname\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">last name</label>","</td>","<td><input id=\"verify-member-ship-lastname\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">address</label>","</td>","<td colspan=\"3\"><input id=\"verify-member-ship-address\" class=\"input-text-wh\" type=\"text\" size=\"40\"/></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">suite/apartment</label>","</td>","<td><input id=\"verify-member-ship-apt\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">city</label>","</td>","<td><input id=\"verify-member-ship-city\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">state</label>","</td>","<td>","<select id=\"verify-member-ship-state\">","<option></option>","<option value=\"AK\">AK</option>","<option value=\"AL\">AL</option>","<option value=\"AR\">AR</option>","<option value=\"AZ\">AZ</option>","<option value=\"CA\">CA</option>","<option value=\"CO\">CO</option>","<option value=\"CT\">CT</option>","<option value=\"DC\">DC</option>","<option value=\"DE\">DE</option>","<option value=\"FL\">FL</option>","<option value=\"GA\">GA</option>","<option value=\"HI\">HI</option>","<option value=\"IA\">IA</option>","<option value=\"ID\">ID</option>","<option value=\"IL\">IL</option>","<option value=\"IN\">IN</option>","<option value=\"KS\">KS</option>","<option value=\"KY\">KY</option>","<option value=\"LA\">LA</option>","<option value=\"MA\">MA</option>","<option value=\"MD\">MD</option>","<option value=\"ME\">ME</option>","<option value=\"MI\">MI</option>","<option value=\"MN\">MN</option>","<option value=\"MO\">MO</option>","<option value=\"MS\">MS</option>","<option value=\"MT\">MT</option>","<option value=\"NC\">NC</option>","<option value=\"ND\">ND</option>","<option value=\"NE\">NE</option>","<option value=\"NH\">NH</option>","<option value=\"NJ\">NJ</option>","<option value=\"NM\">NM</option>","<option value=\"NV\">NV</option>","<option value=\"NY\">NY</option>","<option value=\"OH\">OH</option>","<option value=\"OK\">OK</option>","<option value=\"OR\">OR</option>","<option value=\"PA\">PA</option>","<option value=\"RI\">RI</option>","<option value=\"SC\">SC</option>","<option value=\"SD\">SD</option>","<option value=\"TN\">TN</option>","<option value=\"TX\">TX</option>","<option value=\"UT\">UT</option>","<option value=\"VA\">VA</option>","<option value=\"VT\">VT</option>","<option value=\"WA\">WA</option>","<option value=\"WI\">WI</option>","<option value=\"WV\">WV</option>","<option value=\"WY\">WY</option>","</select>","</td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">zip</label>","</td>","<td><input id=\"verify-member-ship-zip\" class=\"input-text-wh\" type=\"text\" size=\"20\" maxlength=\"10\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">country</label>","</td>","<td>","<select id=\"verify-member-ship-country\">","<option value=\"US\">U.S.</option>","</select>","</td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">phone number</label>","</td>","<td><input id=\"verify-member-ship-areacode\" class=\"input-text-wh\" type=\"text\" size=\"3\" maxlength=\"3\"/>-<input id=\"verify-member-ship-prefix\" class=\"input-text-wh\" type=\"text\" size=\"3\" maxlength=\"3\"/>-<input id=\"verify-member-ship-suffix\" class=\"input-text-wh\" type=\"text\" size=\"4\" maxlength=\"4\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td colspan=\"4\" style=\"height:15px;\"></td>","</tr>","<tr>","<td></td>","<td colspan=\"3\">","<table border=\"0\" cellspacing=\"0\">","<tr>","<td>","<script src=\"https://siteseal.thawte.com/cgi/server/thawte_seal_generator.exe\"></script>","</td>","</tr>","<tr>","<td>","<a href=\"https://sealinfo.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&dn=WWW.SWITCHGAMES.COM&lang=en\" target=\"_blank\"><img src=\""+SwitchGames.imageUrl+"common/buttons/thawte_stamp.gif\" border=\"0\"/></a>","</td>","</tr>","</table>","</td>","</tr>","</table>","<!-- end form -->","</div>"];
var _5ad=["<div class=\"verify-title\"><img src=\""+SwitchGames.imageUrl+"common/badges/badge-verified-large.png\" align=\"absmiddle\"/> Verified Membership Badge<span class=\"verify-dots-container\"><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-blue.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/></span></div>","<div style=\"margin-left:10px;\">","<div class=\"verify-font-blue-small\" style=\"margin-top:10px;\">BILLING INFORMATION<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 5px;\"/><a href=\"https://sealinfo.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&dn=WWW.SWITCHGAMES.COM&lang=en\" target=\"_blank\"><img src=\""+SwitchGames.imageUrl+"common/icons/icon-thawte.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 0px;\"/></a><span id=\"verify-member-panel2error\" class=\"verify-error-text\"></span></div>","<!-- start form -->","<table class=\"table-form\" style=\"margin-top:10px;\">","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">payment method</label>","</td>","<td>","<select id=\"verify-member-card-type\">","<option></option>","<option value=\"visa\">Visa</option>","<option value=\"mastercard\">MasterCard</option>","<option value=\"discover\">Discover</option>","<option value=\"amex\">American Express</option>","</select>","</td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" valign=\"top\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">card number</label>","</td>","<td><input id=\"verify-member-card-number\" class=\"input-text-wh\" type=\"text\" size=\"20\" maxlength=\"16\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">security code</label>","</td>","<td><input id=\"verify-member-card-cvv2\" class=\"input-text-wh\" type=\"text\" size=\"4\" maxlength=\"4\"/></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" valign=\"top\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">expiration</label>","</td>","<td>","<select id=\"verify-member-card-expiry-month\">","<option></option>","<option value=\"01\">01</option>","<option value=\"02\">02</option>","<option value=\"03\">03</option>","<option value=\"04\">04</option>","<option value=\"05\">05</option>","<option value=\"06\">06</option>","<option value=\"07\">07</option>","<option value=\"08\">08</option>","<option value=\"09\">09</option>","<option value=\"10\">10</option>","<option value=\"11\">11</option>","<option value=\"12\">12</option>","</select> "," <select id=\"verify-member-card-expiry-year\">","<option></option>","<option value=\"09\">2009</option>","<option value=\"10\">2010</option>","<option value=\"11\">2011</option>","<option value=\"12\">2012</option>","<option value=\"13\">2013</option>","<option value=\"14\">2014</option>","<option value=\"15\">2015</option>","<option value=\"16\">2016</option>","<option value=\"17\">2017</option>","<option value=\"18\">2018</option>","<option value=\"19\">2019</option>","<option value=\"20\">2020</option>","</select>","</td>","<td></td>","</tr>","<tr>","<td colspan=\"4\" style=\"height:15px;\"></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">first name</label>","</td>","<td><input id=\"verify-member-bill-firstname\" class=\"input-text-wh\" type=\"text\" size=\"20\" READONLY/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">last name</label>","</td>","<td><input id=\"verify-member-bill-lastname\" class=\"input-text-wh\" type=\"text\" size=\"20\" READONLY/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">address</label>","</td>","<td colspan=\"3\"><span id=\"verify-member-bill-address\" style=\"color: #aaa;\"></span></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">suite/apartment</label>","</td>","<td><span id=\"verify-member-bill-apt\" style=\"color: #aaa;\"></span></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">city</label>","</td>","<td><span id=\"verify-member-bill-city\" style=\"color: #aaa;\"></span></td>","<td class=\"label-rt\">","<label class=\"label-caps\">state</label>","</td>","<td><span id=\"verify-member-bill-state\" style=\"color: #aaa;\"></span></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">zip</label>","</td>","<td><span id=\"verify-member-bill-zip\" style=\"color: #aaa;\"></span></td>","<td class=\"label-rt\">","<label class=\"label-caps\">country</label>","</td>","<td><span id=\"verify-member-bill-country\" style=\"color: #aaa;\"></span></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">phone number</label>","</td>","<td><input id=\"verify-member-bill-areacode\" class=\"input-text-wh\" type=\"text\" size=\"3\" maxlength=\"3\" READONLY/>-<input id=\"verify-member-bill-prefix\" class=\"input-text-wh\" type=\"text\" size=\"3\" maxlength=\"3\" READONLY/>-<input id=\"verify-member-bill-suffix\" class=\"input-text-wh\" type=\"text\" size=\"4\" maxlength=\"4\" READONLY/></td>","<td colspan=\"2\"><span class=\"verify-font-blue-small\"><b>MUST</b> be the number on file!</span></div></td>","</tr>","<tr>","<td></td>","<td style=\"padding-top: 10px;\" colspan=\"3\"><input id=\"verify-member-save-billing\" type=\"checkbox\"/><label>&nbsp;Save this information for one-click purchases on SwitchGames</label></td>","</tr>","</table>","<!-- end form -->","</div>"];
var _5ae=["<div class=\"verify-title\"><img src=\""+SwitchGames.imageUrl+"common/badges/badge-verified-large.png\" align=\"absmiddle\"/> Verified Membership Badge<span class=\"verify-dots-container\"><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-blue.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/></span></div>","<div class=\"verify-font-blue-small\" style=\"margin:10px 0px 0px 10px;\">CONFIRM &amp; PROCESS<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 5px;\"/></div>","<div style=\"text-align:center;\">","<div class=\"verify-large-text\" style=\"margin-top:15px;\">You will be charged $4.95*</div>","<div style=\"height: 15px;\"></div>","<div class=\"verify-medium-text\">To accept and continue verification, click Next...</div>","<div style=\"height: 15px;\"></div>","<div id=\"verify-member-processing\" class=\"verify-processing-text\" style=\"margin-top: 25px; visibility: hidden;\"><img src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" align=\"absmiddle\"/>&nbsp;&nbsp;Processing...</div>","<div id=\"verify-member-panel3error\" class=\"verify-error-text\" style=\"margin-top:15px;\"></div>","<div style=\"height: 15px;\"></div>","<div class=\"verify-disclaimer-text\" style=\"margin:15px 10px 0px 10px;\">* $4.95 is for the purchase of one (1) single verification of the information you have provided.  ","Verified Member status is good for twelve (12) months from the time of purchase.  In the event you ","modify the verified information within twelve (12) months of purchase, Verified Membership status ","will be lost.  A $4.95 fee applies for every purchase of a Verified Membership.","</div>","</div>"];
var _5af=["<div class=\"verify-title\"><img src=\""+SwitchGames.imageUrl+"common/badges/badge-verified-large.png\" align=\"absmiddle\"/> Verified Membership Badge<span class=\"verify-dots-container\"><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-blue.gif\"/></span></div>","<div style=\"text-align:center;\">","<div id=\"verify-member-congrats\" class=\"verify-large-text\" style=\"margin-top:35px;\"></div>","<div style=\"margin-top:25px;\"><label>Your badges now look like this:</label></div>","<div class=\"verify-badges-container\" style=\"margin-top:25px;\">","<!-- badges will be turned on and off appropriately -->","<img id=\"verify-member-badge-philanthropy\" src=\""+SwitchGames.imageUrl+"common/badges/badge-philanthropy-off.png\"/>","<img id=\"verify-member-badge-plus-member\" src=\""+SwitchGames.imageUrl+"common/badges/badge-plus-member-off.png\"/>","<img id=\"verify-member-badge-ratings\" src=\""+SwitchGames.imageUrl+"common/badges/badge-ratings-off.png\"/>","<img id=\"verify-member-badge-tenure\" src=\""+SwitchGames.imageUrl+"common/badges/badge-tenure-off.png\"/>","<img id=\"verify-member-badge-transactions\" src=\""+SwitchGames.imageUrl+"common/badges/badge-transactions-off.png\"/>","<img id=\"verify-member-badge-verified\" src=\""+SwitchGames.imageUrl+"common/badges/badge-verified.png\"/>","</div>","<img id=\"verify-member-btn-ok\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-ok.png\" style=\"margin-top:25px;cursor:pointer;\"/>","</div>","<input id=\"verify-member-pnref\" type=\"hidden\" />"];
var _5b0="NEXT";
var _5b1=["<div name=\"panel-scroller-root\" class=\"verify-dialog-body\" style=\"position: relative;\">","<div class=\"verify-dialog-body-left-col\">","<div id=\"verify-member-left-scroller-container\" name=\"panel-scroller-left-arrow\" style=\"position: relative; top: 130px; left: 0px;\">","<div id=\"verify-member-left-scroller-btn\" class=\"left-scroller-btn-enable\"></div><span style=\"position: relative; top: 5px; left: 10px;\">PREV</span>","</div>","</div>","<div class=\"verify-dialog-body-center-col\" style=\"\">","<div name=\"panel-scroller-content-root\" totalpanels=\"5\" currentpanel=\"0\" class=\"panelcontrol\">","<div name=\"panel-scroller-content\">"+_5ab.join("")+"</div>","<div name=\"panel-scroller-content\" style=\"display:none\">"+_5ac.join("")+"</div>","<div name=\"panel-scroller-content\" style=\"display:none\">"+_5ad.join("")+"</div>","<div name=\"panel-scroller-content\" style=\"display:none\">"+_5ae.join("")+"</div>","<div name=\"panel-scroller-content\" style=\"display:none\">"+_5af.join("")+"</div>","</div>","</div>","<div class=\"verify-dialog-body-right-col\">","<div id=\"verify-member-right-scroller-container\" name=\"panel-scroller-right-arrow\" style=\"position: relative; top: 130px; left: 15px;\">","<div id=\"verify-member-right-scroller-btn\" class=\"right-scroller-btn-enable\"></div><span style=\"position: relative; top: 5px; zoom: 1; display: block;\">"+_5b0+"</span>","</div>","</div>","</div>"];
SwitchGames.Account.VerifyMember=function(_5b2){
var _5b2=_5b2;
var _5b3=false;
SwitchGames.Account.verifyMemberDialog.on("hide",function(e,t){
if(_5b2!=null){
_5b2(_5b3);
}else{
window.location.href="account.php?tab=shipping";
}
});
SwitchGames.Account.verifyMemberDialog.body.update(_5b1.join(""));
SwitchGames.Account.verifyMemberDialog.show();
SwitchGames.Account.loadShippingData=function(){
var _5b6={pane:"load"};
Ext.Ajax.request({url:"data/account/verify_member.php",params:_5b6,success:function(_5b7,_5b8){
var data=Ext.util.JSON.decode(_5b7.responseText);
if(data.error!=undefined){
}else{
if(data.phone){
var _5ba=data.phone.substr(0,3);
var _5bb=data.phone.substr(3,3);
var _5bc=data.phone.substr(6,4);
}else{
var _5ba="";
var _5bb="";
var _5bc="";
}
var t=Ext.get("verify-member-ship-firstname");
if(data.first_name){
t.dom.value=data.first_name;
}
SwitchGames.Account.simpleFieldValidation(t,1,"firstName",true,false);
var t=Ext.get("verify-member-ship-lastname");
if(data.last_name){
t.dom.value=data.last_name;
}
SwitchGames.Account.simpleFieldValidation(t,1,"lastName",true,false);
var t=Ext.get("verify-member-ship-address");
if(data.address1){
t.dom.value=data.address1;
}
SwitchGames.Account.simpleFieldValidation(t,1,"address",true,false);
var t=Ext.get("verify-member-ship-apt");
if(data.address2){
t.dom.value=data.address2;
}
var t=Ext.get("verify-member-ship-city");
if(data.city){
t.dom.value=data.city;
}
SwitchGames.Account.simpleFieldValidation(t,1,"city",true,false);
var t=Ext.get("verify-member-ship-state");
if(data.state){
t.dom.value=data.state;
}
SwitchGames.Account.selectFieldValidation(t,1,"state",true,false);
var t=Ext.get("verify-member-ship-zip");
if(data.zip){
t.dom.value=data.zip;
}
SwitchGames.Account.simpleFieldValidation(t,1,"zip",true,false);
var t=Ext.get("verify-member-ship-country");
if(data.country){
t.dom.value=data.country;
}
var t=Ext.get("verify-member-ship-areacode");
t.dom.value=_5ba;
SwitchGames.Account.simpleFieldValidation(t,1,"areacode",true,false);
var t=Ext.get("verify-member-ship-prefix");
t.dom.value=_5bb;
SwitchGames.Account.simpleFieldValidation(t,1,"prefix",true,false);
var t=Ext.get("verify-member-ship-suffix");
t.dom.value=_5bc;
SwitchGames.Account.simpleFieldValidation(t,1,"suffix",true,false);
if(data.philanthropy_badge=="1"){
Ext.fly("verify-member-badge-philanthropy").dom.src=SwitchGames.imageUrl+"common/badges/badge-philanthropy.png";
}
if(data.plus_badge=="1"){
Ext.fly("verify-member-badge-plus-member").dom.src=SwitchGames.imageUrl+"common/badges/badge-plus-member.png";
}
if(data.ratings_star_badge=="1"){
Ext.fly("verify-member-badge-ratings").dom.src=SwitchGames.imageUrl+"common/badges/badge-ratings.png";
}
if(data.verified_badge=="1"){
Ext.fly("verify-member-badge-verified").dom.src=SwitchGames.imageUrl+"common/badges/badge-verified.png";
}
if(data.transaction_badge>=5){
Ext.fly("verify-member-badge-transactions").dom.src=SwitchGames.imageUrl+"common/badges/badge-transactions-"+data.transaction_badge+".png";
}
if(data.tenure_badge>0){
Ext.fly("verify-member-badge-tenure").dom.src=SwitchGames.imageUrl+"common/badges/badge-tenure-"+data.tenure_badge+".png";
}
Ext.fly("verify-member-congrats").update("Congratulations, "+data.screen_name+"!");
}
},failure:function(_5be,_5bf){
SwitchGames.Dialogs.showErrorDialog(_5be);
}});
};
SwitchGames.Account.screen1EntryAttempt={firstName:false,lastName:false,address:false,city:false,state:false,zip:false,areacode:false,prefix:false,suffix:false};
SwitchGames.Account.screen1ValidationMessages={firstName:"First name is required",lastName:"Last name is required",address:"Address is required",city:"City is required",state:"State is required",zip:"Please enter a valid zip code",areacode:"Please enter a valid areacode",prefix:"A valid phone number is required",suffix:"A valid phone number is required"};
SwitchGames.Account.screen1ValidationParams={firstName:false,lastName:false,address:false,city:false,state:false,zip:false,areacode:false,prefix:false,suffix:false};
SwitchGames.Account.validatePanel1=function(){
var sp=SwitchGames.Account.screen1ValidationParams;
var ea=SwitchGames.Account.screen1EntryAttempt;
var _5c2=Ext.get("verify-member-panel1error");
_5c2.update("");
if(sp.firstName&&sp.lastName&&sp.address&&sp.city&&sp.state&&sp.zip&&sp.areacode&&sp.prefix&&sp.suffix){
_5c2.update("");
Ext.fly("verify-member-right-scroller-btn").removeClass("right-scroller-btn-disable");
Ext.fly("verify-member-right-scroller-btn").addClass("right-scroller-btn-enable");
}else{
if(!sp.firstName&&ea.firstName){
Ext.fly("verify-member-ship-firstname").addClass("validation-failure");
_5c2.update(SwitchGames.Account.screen1ValidationMessages.firstName);
}else{
if(!sp.lastName&&ea.lastName){
Ext.fly("verify-member-ship-lastname").addClass("validation-failure");
_5c2.update(SwitchGames.Account.screen1ValidationMessages.lastName);
}else{
if(!sp.address&&ea.address){
Ext.fly("verify-member-ship-address").addClass("validation-failure");
_5c2.update(SwitchGames.Account.screen1ValidationMessages.address);
}else{
if(!sp.city&&ea.city){
Ext.fly("verify-member-ship-city").addClass("validation-failure");
_5c2.update(SwitchGames.Account.screen1ValidationMessages.city);
}else{
if(!sp.state&&ea.state){
Ext.fly("verify-member-ship-state").addClass("validation-failure");
_5c2.update(SwitchGames.Account.screen1ValidationMessages.state);
}else{
if(!sp.zip&&ea.zip){
Ext.fly("verify-member-ship-zip").addClass("validation-failure");
_5c2.update(SwitchGames.Account.screen1ValidationMessages.zip);
}else{
if(!sp.areacode&&ea.areacode){
Ext.fly("verify-member-ship-areacode").addClass("validation-failure");
_5c2.update(SwitchGames.Account.screen1ValidationMessages.areacode);
}else{
if(!sp.prefix&&ea.prefix){
Ext.fly("verify-member-ship-prefix").addClass("validation-failure");
_5c2.update(SwitchGames.Account.screen1ValidationMessages.prefix);
}else{
if(!sp.suffix&&ea.suffix){
Ext.fly("verify-member-ship-suffix").addClass("validation-failure");
_5c2.update(SwitchGames.Account.screen1ValidationMessages.suffix);
}
}
}
}
}
}
}
}
}
Ext.fly("verify-member-right-scroller-btn").removeClass("right-scroller-btn-enable");
Ext.fly("verify-member-right-scroller-btn").addClass("right-scroller-btn-disable");
}
};
Ext.fly("verify-member-ship-firstname").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,1,"firstName");
});
Ext.fly("verify-member-ship-lastname").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,1,"lastName");
});
Ext.fly("verify-member-ship-address").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,1,"address");
});
Ext.fly("verify-member-ship-city").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,1,"city");
});
Ext.fly("verify-member-ship-state").on("blur",function(e,t){
SwitchGames.Account.selectFieldValidation(t,1,"state");
});
Ext.fly("verify-member-ship-zip").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,1,"zip");
});
Ext.fly("verify-member-ship-areacode").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,1,"areacode");
});
Ext.fly("verify-member-ship-prefix").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,1,"prefix");
});
Ext.fly("verify-member-ship-suffix").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,1,"suffix");
});
SwitchGames.Account.screen2EntryAttempt={cardType:false,cardNumber:false,cardCVV2:false,cardMonth:false,cardYear:false,firstName:false,lastName:false,address:false,city:false,state:false,zip:false,areacode:false,prefix:false,suffix:false};
SwitchGames.Account.screen2ValidationMessages={cardType:"Please select your card type",cardNumber:"Please enter a valid card number",cardCVV2:"A valid security code is required",cardMonth:"Please select expiration month",cardYear:"Please select expiration year",firstName:"First name is required",lastName:"Last name is required",address:"Address is required",city:"City is required",state:"State is required",zip:"Zip is required",areacode:"Areacode is required",prefix:"A valid phone number is required",suffix:"A valid phone number is required"};
SwitchGames.Account.screen2ValidationParams={cardType:false,cardNumber:false,cardCVV2:false,cardMonth:false,cardYear:false,firstName:true,lastName:true,address:true,city:true,state:true,zip:true,areacode:true,prefix:true,suffix:true};
SwitchGames.Account.validatePanel2=function(){
var sp=SwitchGames.Account.screen2ValidationParams;
var ea=SwitchGames.Account.screen2EntryAttempt;
var _5d7=Ext.get("verify-member-panel2error");
_5d7.update("");
if(sp.cardType&&sp.cardNumber&&sp.cardCVV2&&sp.cardMonth&&sp.cardYear&&sp.firstName&&sp.lastName&&sp.address&&sp.city&&sp.state&&sp.zip&&sp.areacode&&sp.prefix&&sp.suffix){
_5d7.update("");
Ext.fly("verify-member-right-scroller-btn").removeClass("right-scroller-btn-disable");
Ext.fly("verify-member-right-scroller-btn").addClass("right-scroller-btn-enable");
}else{
if(!sp.cardType&&ea.cardType){
Ext.fly("verify-member-card-type").addClass("validation-failure");
_5d7.update(SwitchGames.Account.screen2ValidationMessages.cardType);
}else{
if(!sp.cardNumber&&ea.cardNumber){
Ext.fly("verify-member-card-number").addClass("validation-failure");
_5d7.update(SwitchGames.Account.screen2ValidationMessages.cardNumber);
}else{
if(!sp.cardCVV2&&ea.cardCVV2){
Ext.fly("verify-member-card-cvv2").addClass("validation-failure");
_5d7.update(SwitchGames.Account.screen2ValidationMessages.cardCVV2);
}else{
if(!sp.cardMonth&&ea.cardMonth){
Ext.fly("verify-member-card-expiry-month").addClass("validation-failure");
_5d7.update(SwitchGames.Account.screen2ValidationMessages.cardMonth);
}else{
if(!sp.cardYear&&ea.cardYear){
Ext.fly("verify-member-card-expiry-year").addClass("validation-failure");
_5d7.update(SwitchGames.Account.screen2ValidationMessages.cardYear);
}else{
if(!sp.firstName&&ea.firstName){
Ext.fly("verify-member-bill-firstname").addClass("validation-failure");
_5d7.update(SwitchGames.Account.screen2ValidationMessages.firstName);
}else{
if(!sp.lastName&&ea.lastName){
Ext.fly("verify-member-bill-lastname").addClass("validation-failure");
_5d7.update(SwitchGames.Account.screen2ValidationMessages.lastName);
}else{
if(!sp.areacode&&ea.areacode){
Ext.fly("verify-member-bill-areacode").addClass("validation-failure");
_5d7.update(SwitchGames.Account.screen2ValidationMessages.areacode);
}else{
if(!sp.prefix&&ea.prefix){
Ext.fly("verify-member-bill-prefix").addClass("validation-failure");
_5d7.update(SwitchGames.Account.screen2ValidationMessages.prefix);
}else{
if(!sp.suffix&&ea.suffix){
Ext.fly("verify-member-bill-suffix").addClass("validation-failure");
_5d7.update(SwitchGames.Account.screen2ValidationMessages.suffix);
}
}
}
}
}
}
}
}
}
}
Ext.fly("verify-member-right-scroller-btn").removeClass("right-scroller-btn-enable");
Ext.fly("verify-member-right-scroller-btn").addClass("right-scroller-btn-disable");
}
};
Ext.fly("verify-member-card-type").on("blur",function(e,t){
SwitchGames.Account.selectFieldValidation(t,2,"cardType");
});
Ext.fly("verify-member-card-type").on("change",function(e,t){
SwitchGames.Account.selectFieldValidation(t,2,"cardType");
});
Ext.fly("verify-member-card-number").on("blur",function(e,t){
SwitchGames.Account.cardNumberValidation(t,2,"cardNumber");
});
Ext.fly("verify-member-card-cvv2").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,2,"cardCVV2");
});
Ext.fly("verify-member-card-expiry-month").on("blur",function(e,t){
SwitchGames.Account.selectFieldValidation(t,2,"cardMonth");
});
Ext.fly("verify-member-card-expiry-month").on("change",function(e,t){
SwitchGames.Account.selectFieldValidation(t,2,"cardMonth");
});
Ext.fly("verify-member-card-expiry-year").on("blur",function(e,t){
SwitchGames.Account.selectFieldValidation(t,2,"cardYear");
});
Ext.fly("verify-member-card-expiry-year").on("change",function(e,t){
SwitchGames.Account.selectFieldValidation(t,2,"cardYear");
});
Ext.fly("verify-member-bill-firstname").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,2,"firstName");
});
Ext.fly("verify-member-bill-lastname").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,2,"lastName");
});
Ext.fly("verify-member-bill-areacode").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,2,"areacode");
});
Ext.fly("verify-member-bill-prefix").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,2,"prefix");
});
Ext.fly("verify-member-bill-suffix").on("blur",function(e,t){
SwitchGames.Account.simpleFieldValidation(t,2,"suffix");
});
SwitchGames.Account.simpleFieldValidation=function(t,_5f3,_5f4,ea,_5f6){
var _5f7=Ext.fly(t);
var _5f8=_5f7.getValue();
var _5f9=new RegExp(/(^\d{3}$)|(^\d{4}$)/);
var _5fa=new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
var _5fb=new RegExp(/(^\d{3}$)/);
var _5fc=new RegExp(/(^\d{4}$)/);
var _5fd="screen"+_5f3+"ValidationParams";
var _5fe="screen"+_5f3+"ValidationMessages";
var _5ff="screen"+_5f3+"EntryAttempt";
if(_5f8.length==0){
if(!ea){
SwitchGames.Account[_5ff][_5f4]=true;
}
SwitchGames.Account[_5fd][_5f4]=false;
}else{
if(_5f4=="cardCVV2"&&!_5f9.test(_5f8)){
if(!ea){
SwitchGames.Account[_5ff][_5f4]=true;
}
SwitchGames.Account[_5fd][_5f4]=false;
}else{
if((_5f4=="areacode"||_5f4=="prefix")&&!_5fb.test(_5f8)){
if(!ea){
SwitchGames.Account[_5ff][_5f4]=true;
}
SwitchGames.Account[_5fd][_5f4]=false;
}else{
if(_5f4=="suffix"&&!_5fc.test(_5f8)){
if(!ea){
SwitchGames.Account[_5ff][_5f4]=true;
}
SwitchGames.Account[_5fd][_5f4]=false;
}else{
if(_5f4=="zip"&&!_5fa.test(_5f8)){
if(!ea){
SwitchGames.Account[_5ff][_5f4]=true;
}
SwitchGames.Account[_5fd][_5f4]=false;
}else{
if(!ea){
SwitchGames.Account[_5ff][_5f4]=true;
}
SwitchGames.Account[_5fd][_5f4]=true;
_5f7.removeClass("validation-failure");
}
}
}
}
}
if(_5f6==undefined||_5f6==true){
SwitchGames.Account["validatePanel"+_5f3]();
}
};
SwitchGames.Account.selectFieldValidation=function(t,_601,_602,ea,_604){
var _605="screen"+_601+"ValidationParams";
var _606="screen"+_601+"ValidationMessages";
var _607="screen"+_601+"EntryAttempt";
var _608=Ext.get(t);
var _609=_608.dom.options[_608.dom.selectedIndex].text;
if(_609.length==0){
if(!ea){
SwitchGames.Account[_607][_602]=true;
}
SwitchGames.Account[_605][_602]=false;
}else{
if(!ea){
SwitchGames.Account[_607][_602]=true;
}
SwitchGames.Account[_605][_602]=true;
_608.removeClass("validation-failure");
}
if(_604==undefined||_604==true){
SwitchGames.Account["validatePanel"+_601]();
}
};
SwitchGames.Account.cardNumberValidation=function(t,_60b,_60c,ea,_60e){
var _60f=Ext.fly(t);
var _610=_60f.getValue();
var _611=new RegExp(/(^\d{13}$)|(^\d{15}$)|(^\d{16}$)/);
var _612="screen"+_60b+"ValidationParams";
var _613="screen"+_60b+"ValidationMessages";
var _614="screen"+_60b+"EntryAttempt";
if(!_611.test(_610)){
if(!ea){
SwitchGames.Account[_614][_60c]=true;
}
SwitchGames.Account[_612][_60c]=false;
}else{
j=_610.length/2;
k=Math.floor(j);
m=Math.ceil(j)-k;
c=0;
for(i=0;i<k;i++){
a=_610.charAt(i*2+m)*2;
c+=a>9?Math.floor(a/10+a%10):a;
}
for(i=0;i<k+m;i++){
c+=_610.charAt(i*2+1-m)*1;
}
if(c%10==0){
if(!ea){
SwitchGames.Account[_614][_60c]=true;
}
SwitchGames.Account[_612][_60c]=true;
_60f.removeClass("validation-failure");
}else{
if(!ea){
SwitchGames.Account[_614][_60c]=true;
}
SwitchGames.Account[_612][_60c]=false;
}
}
if(_60e==undefined||_60e==true){
SwitchGames.Account["validatePanel"+_60b]();
}
};
SwitchGames.Utility.panelLeftButtonCallbackFunction=function(_615,_616,_617,_618,_619){
if(_618==1){
Ext.fly("verify-member-right-scroller-btn").removeClass("right-scroller-btn-disable");
Ext.fly("verify-member-right-scroller-btn").addClass("right-scroller-btn-enable");
return true;
}
if(_618==2||_618==3){
SwitchGames.Utility.scrollPanelLeft(Ext.select("[@name=\"panel-scroller-root\"]",true,SwitchGames.Account.verifyMemberDialog.body.dom).elements[0],_618,_619,"slide",true);
Ext.fly("verify-member-left-scroller-container").setVisible(true);
SwitchGames.Account["validatePanel"+(_619)]();
return false;
}
return true;
};
SwitchGames.Utility.panelRightButtonCallbackFunction=function(_61a,_61b,_61c,_61d,_61e){
var _61f=_61c.query("div.right-scroller-btn-disable");
if(_61f.length>0&&_61d<3){
SwitchGames.Account["validatePanel"+_61d]();
if(SwitchGames.Account.doSaleTransId==null){
var _620="You must fill in all of the required fields before proceeding";
SwitchGames.Dialogs.showErrorDialog(_620);
}
return false;
}
if(_61d==1){
SwitchGames.Account.copyFormFields();
Ext.fly("verify-member-panel2error").update("");
}
if(_61d==0||_61d==1){
SwitchGames.Account["validatePanel"+(_61e)]();
}
if(_61d==2){
Ext.fly("verify-member-panel3error").update("");
Ext.fly("verify-member-right-scroller-btn").removeClass("right-scroller-btn-enable");
Ext.fly("verify-member-right-scroller-btn").addClass("right-scroller-btn-disable");
Ext.fly("verify-member-left-scroller-container").setVisible(false);
if(_61f.length==0){
SwitchGames.Account.verifyAddress();
}
return false;
}
if(_61d==3){
if(_61f.length==0){
Ext.fly("verify-member-right-scroller-btn").removeClass("right-scroller-btn-enable");
Ext.fly("verify-member-right-scroller-btn").addClass("right-scroller-btn-disable");
Ext.fly("verify-member-left-scroller-container").setVisible(false);
Ext.fly("verify-member-processing").setVisible(true);
SwitchGames.Account.doCapture();
return false;
}
return false;
}
return true;
};
SwitchGames.Account.copyFormFields=function(){
Ext.get("verify-member-bill-firstname").dom.value=Ext.get("verify-member-ship-firstname").getValue();
Ext.get("verify-member-bill-lastname").dom.value=Ext.get("verify-member-ship-lastname").getValue();
Ext.get("verify-member-bill-address").update(Ext.get("verify-member-ship-address").getValue());
Ext.get("verify-member-bill-apt").update(Ext.get("verify-member-ship-apt").getValue());
Ext.get("verify-member-bill-city").update(Ext.get("verify-member-ship-city").getValue());
Ext.get("verify-member-bill-state").update(Ext.get("verify-member-ship-state").getValue());
Ext.get("verify-member-bill-zip").update(Ext.get("verify-member-ship-zip").getValue());
Ext.get("verify-member-bill-country").update(Ext.get("verify-member-ship-country").getValue());
Ext.get("verify-member-bill-areacode").dom.value=Ext.get("verify-member-ship-areacode").getValue();
Ext.get("verify-member-bill-prefix").dom.value=Ext.get("verify-member-ship-prefix").getValue();
Ext.get("verify-member-bill-suffix").dom.value=Ext.get("verify-member-ship-suffix").getValue();
};
SwitchGames.Account.compareFormFields=function(){
if(Ext.get("verify-member-bill-firstname").getValue()==Ext.get("verify-member-ship-firstname").getValue()&&Ext.get("verify-member-bill-lastname").getValue()==Ext.get("verify-member-ship-lastname").getValue()&&Ext.get("verify-member-bill-areacode").getValue()==Ext.get("verify-member-ship-areacode").getValue()&&Ext.get("verify-member-bill-prefix").getValue()==Ext.get("verify-member-ship-prefix").getValue()&&Ext.get("verify-member-bill-suffix").getValue()==Ext.get("verify-member-ship-suffix").getValue()){
return true;
}else{
return false;
}
};
SwitchGames.Account.doSale=function(){
var _621=Ext.get("verify-member-panel3error");
if(SwitchGames.Account.doSaleTransId!=null){
return;
}
if(!SwitchGames.Account.compareFormFields()){
_621.update("The shipping &amp; billing information does not match.");
Ext.fly("verify-member-left-scroller-container").setVisible(true);
}else{
var _622={usehttps:"1",pane:"sale",card_type:Ext.get("verify-member-card-type").getValue(),card_number:Ext.get("verify-member-card-number").getValue(),card_cvv2:Ext.get("verify-member-card-cvv2").getValue(),card_expiry:Ext.get("verify-member-card-expiry-month").getValue()+Ext.get("verify-member-card-expiry-year").getValue(),firstname:Ext.get("verify-member-bill-firstname").getValue(),lastname:Ext.get("verify-member-bill-lastname").getValue(),address1:Ext.get("verify-member-ship-address").getValue(),address2:Ext.get("verify-member-ship-apt").getValue(),city:Ext.get("verify-member-ship-city").getValue(),state:Ext.get("verify-member-ship-state").getValue(),zip:Ext.get("verify-member-ship-zip").getValue(),country:Ext.get("verify-member-ship-country").getValue(),phone:Ext.get("verify-member-bill-areacode").getValue()+Ext.get("verify-member-bill-prefix").getValue()+Ext.get("verify-member-bill-suffix").getValue()};
SwitchGames.Account.doSaleTransId=SwitchGames.Utility.sendSecureRequest("data/account/verify_member.php",_622,function(_623){
var data=Ext.util.JSON.decode(_623.responseText);
if(data.error!=undefined){
Ext.fly("verify-member-processing").setVisible(false);
_621.update(data.error);
Ext.fly("verify-member-left-scroller-container").setVisible(true);
SwitchGames.Account.doSaleTransId=null;
}else{
Ext.fly("verify-member-processing").setVisible(false);
SwitchGames.Utility.scrollPanelRight(Ext.select("[@name=\"panel-scroller-root\"]",true,SwitchGames.Account.verifyMemberDialog.body.dom).elements[0],3,4,"slide",true);
_5b3=true;
SwitchGames.Account.doSaleTransId=null;
}
},function(_625){
SwitchGames.Dialogs.showErrorDialog(_625.statusText);
Ext.fly("verify-member-processing").setVisible(false);
_621.update(_625.statusText);
Ext.fly("verify-member-left-scroller-container").setVisible(true);
SwitchGames.Account.doSaleTransId=null;
});
}
};
SwitchGames.Account.verifyAddress=function(){
var _626=Ext.get("verify-member-panel2error");
if(SwitchGames.Account.verifyAddressTransId!=null){
return;
}
if(!SwitchGames.Account.compareFormFields()){
_626.update("The shipping &amp; billing information does not match.");
Ext.fly("verify-member-left-scroller-container").setVisible(true);
}else{
var _627={usehttps:"1",pane:"authorize",card_type:Ext.get("verify-member-card-type").getValue(),card_number:Ext.get("verify-member-card-number").getValue(),card_cvv2:Ext.get("verify-member-card-cvv2").getValue(),card_expiry:Ext.get("verify-member-card-expiry-month").getValue()+Ext.get("verify-member-card-expiry-year").getValue(),firstname:Ext.get("verify-member-bill-firstname").getValue(),lastname:Ext.get("verify-member-bill-lastname").getValue(),address1:Ext.get("verify-member-ship-address").getValue(),address2:Ext.get("verify-member-ship-apt").getValue(),city:Ext.get("verify-member-ship-city").getValue(),state:Ext.get("verify-member-ship-state").getValue(),zip:Ext.get("verify-member-ship-zip").getValue(),country:Ext.get("verify-member-ship-country").getValue(),phone:Ext.get("verify-member-bill-areacode").getValue()+Ext.get("verify-member-bill-prefix").getValue()+Ext.get("verify-member-bill-suffix").getValue(),oneClickSaveInfo:Ext.fly("verify-member-save-billing").dom.checked?1:0};
SwitchGames.Account.verifyAddressTransId=SwitchGames.Utility.sendSecureRequest("data/account/verify_member.php",_627,function(_628){
var data=Ext.util.JSON.decode(_628.responseText);
if(data.error!=undefined){
_626.update(data.error);
Ext.fly("verify-member-left-scroller-container").setVisible(true);
SwitchGames.Account.verifyAddressTransId=null;
SwitchGames.Dialogs.standardErrorDialog.hide();
}else{
Ext.get("verify-member-pnref").dom.value=data.PNREF;
SwitchGames.Dialogs.standardErrorDialog.hide();
SwitchGames.Account.verifyAddressTransId=null;
SwitchGames.Utility.scrollPanelRight(Ext.select("[@name=\"panel-scroller-root\"]",true,SwitchGames.Account.verifyMemberDialog.body.dom).elements[0],2,3,"slide",true);
Ext.fly("verify-member-right-scroller-btn").removeClass("right-scroller-btn-disable");
Ext.fly("verify-member-right-scroller-btn").addClass("right-scroller-btn-enable");
Ext.fly("verify-member-left-scroller-container").setVisible(false);
}
},function(_62a){
SwitchGames.Dialogs.showErrorDialog(_62a.statusText);
_626.update(_62a.statusText);
Ext.fly("verify-member-left-scroller-container").setVisible(true);
SwitchGames.Account.verifyAddressTransId=null;
});
}
};
SwitchGames.Account.doCapture=function(){
var _62b=Ext.get("verify-member-panel3error");
if(SwitchGames.Account.doCaptureTransId!=null){
return;
}
if(!SwitchGames.Account.compareFormFields()){
_62b.update("The shipping &amp; billing information does not match.");
Ext.fly("verify-member-left-scroller-container").setVisible(true);
}else{
var _62c={usehttps:"1",pane:"capture",first_name:Ext.get("verify-member-bill-firstname").getValue(),last_name:Ext.get("verify-member-bill-lastname").getValue(),origid:Ext.get("verify-member-pnref").getValue(),card_type:Ext.get("verify-member-card-type").getValue(),card_number:Ext.get("verify-member-card-number").getValue()};
SwitchGames.Account.doCaptureTransId=SwitchGames.Utility.sendSecureRequest("data/account/verify_member.php",_62c,function(_62d){
var data=Ext.util.JSON.decode(_62d.responseText);
if(data.error!=undefined){
Ext.fly("verify-member-processing").setVisible(false);
_62b.update(data.error);
Ext.fly("verify-member-left-scroller-container").setVisible(true);
SwitchGames.Account.doCaptureTransId=null;
}else{
Ext.fly("verify-member-processing").setVisible(false);
SwitchGames.Utility.scrollPanelRight(Ext.select("[@name=\"panel-scroller-root\"]",true,SwitchGames.Account.verifyMemberDialog.body.dom).elements[0],3,4,"slide",true);
_5b3=true;
SwitchGames.Account.doCaptureTransId=null;
SwitchGames.userInfo.verified=1;
}
},function(_62f){
SwitchGames.Dialogs.showErrorDialog(_62f.statusText);
Ext.fly("verify-member-processing").setVisible(false);
_62b.update(_62f.statusText);
Ext.fly("verify-member-left-scroller-container").setVisible(true);
SwitchGames.Account.doCaptureTransId=null;
});
}
};
SwitchGames.Utility.setupLeftRightScrolling(Ext.select(".panelcontrol",true,SwitchGames.Account.verifyMemberDialog.body.dom).elements[0],Ext.select("[@name=\"panel-scroller-left-arrow\"]",true,SwitchGames.Account.verifyMemberDialog.body.dom).elements[0],Ext.select("[@name=\"panel-scroller-right-arrow\"]",true,SwitchGames.Account.verifyMemberDialog.body.dom).elements[0],"slide",true,SwitchGames.Utility.panelLeftButtonCallbackFunction,SwitchGames.Utility.panelRightButtonCallbackFunction);
Ext.fly("verify-member-right-scroller-container").setVisible(true);
Ext.fly("verify-member-left-scroller-container").setVisible(false);
Ext.fly("verify-member-btn-ok").on("click",function(e,t){
SwitchGames.Account.verifyMemberDialog.hide();
});
SwitchGames.Account.loadShippingData();
};
});
Ext.onReady(function(){
Ext.namespace("SwitchGames","SwitchGames.USPS");
if(SwitchGames.USPS.uspsPostageDialog==null){
SwitchGames.USPS.uspsPostageDialog=SwitchGames.Dialogs.createDialog("Add Postage","usps-postage-dlg","",696,null,"sg-window",true);
}
SwitchGames.USPS.uspsPostageStep1=["<div class=\"usps-title\"><img src=\""+SwitchGames.imageUrl+"live_transcactions/usps-logo-bw.gif\"/><span class=\"usps-dots-container\"><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-blue.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/></span></div>","<div style=\"margin-left:10px;\">","<div class=\"usps-font-blue-small\" style=\"margin-top:10px;\">PACKAGE DETAILS<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 5px;\"/></div>","<div style=\"margin:0px 0px 0px 70px;\">","<!-- start form -->","<table class=\"table-form\" style=\"margin-top:30px;\">","<tr>","<td colspan=\"2\" class=\"usps-large-text\">Price: <span id=\"usps-price\"></span></td>","</tr>","<tr>","<td colspan=\"2\"><hr/></td>","</tr>","<tr>","<td style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">Mail Service</label>","</td>","<td>","<select id=\"usps-mailclass\" style=\"width:230px;\">","<option value=\"First\" default=\"1\">First Class</option>","<option value=\"MediaMail\">Media Mail</option>","<option value=\"Priority\">Priority Mail</option>","<option value=\"Express\">Express Mail</option>","</select>","</td>","</tr>","<tr>","<td style=\"padding-bottom: 15px;\">","<label class=\"label-caps\">weight (oz)</label>","</td>","<td style=\"padding-bottom: 15px;\">","<input id=\"usps-weight\" class=\"input-text-wh\" type=\"text\" size=\"5\"/><span style=\"font-size: 22px; color: #338AA5;\">*</span>","</td>","</tr>","<tr>","<td COLSPAN=\"2\" style=\"padding-bottom: 4px;\">","<div><input style=\"vertical-align: middle; height: 19px;\" id=\"usps-signature\" type=\"checkbox\" name=\"signature\"/>&nbsp;<label class=\"label-caps\">Signature Required</label> <label class=\"label\">(additional $2.20)</label></div>","<div style=\"font-size: 4px; height: 4px;\"></div>","<div><input style=\"vertical-align: middle; height: 19px;\" id=\"usps-delivery\" type=\"checkbox\" name=\"delivery\"/>&nbsp;<label class=\"label-caps\">Delivery Confirmation</label> <label class=\"label\">(additional .75&#162;)</label></div>","</td>","</tr>","<tr>","<td COLSPAN=\"2\" style=\"padding-bottom: 4px;\">","<div style=\"font-size: 14px; color: #338AA5; font-weight: bold;\">*&nbsp;ABOUT SHIPPING WEIGHT</div>","<div style=\"font-size: 12px; color: #FFFFFF;\">10oz is typically a safe weight for an average game in a small box or padded envelope.  However, we strongly suggest"+" you weigh your item before creating a label.  <span style=\"color: #AA0000;\">Disclaimer:</span>  We are in NO WAY responsible for the weight you enter above!</div>","</td>","</tr>","</table>","<!-- end form -->","<div id=\"usps-error-msg\" class=\"usps-error-text\"></div>","</div>","</div>"];
SwitchGames.USPS.uspsPostageStep_OneClick=["<div class=\"usps-title\"><img src=\""+SwitchGames.imageUrl+"live_transcactions/usps-logo-bw.gif\"/><span class=\"usps-dots-container\"><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-blue.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/></span></div>","<div style=\"margin-left:10px;\">","<div class=\"usps-font-blue-small\" style=\"margin-top:10px;\">BILLING INFORMATION<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 5px;\"/></div>","<div style=\"margin:0px 0px 0px 70px;\">","<div class=\"to-safe-trade-rb-wrapper\">","<div class=\"to-safe-trade-rb-top\"><div></div></div>","<div class=\"to-safe-trade-rb-body\">","<div class=\"to-safe-trade-number-title\"><img src=\""+SwitchGames.imageUrl+"common/numbers/number-blue-1.png\" align=\"absmiddle\" style=\"margin-top:-5px;\"/>&nbsp;Choose Payment Method<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" style=\"margin: -5px 5px 0px;\" align=\"absmiddle\"></div>","<!-- start radio buttons -->","<ul class=\"no-list-style to-safe-trade-medium-text-ul\" style=\"margin:10px 0px 0px 5px!important;\">","<li><input type=\"radio\" name=\"paymentType\" value=\"credit\" />&nbsp;Use my SwitchGames account ($<span id=\"usps-sg-account\"></span> avail.)</li>","<li><input type=\"radio\" name=\"paymentType\" value=\"cc\" />&nbsp;Use my Credit Card on file (ends in <span class=\"usps-oneclick-cc-last4\"></span>)</li>","<li><input type=\"radio\" name=\"paymentType\" value=\"new\" />&nbsp;Enter new billing information</li>","</ul>","<!-- end radio buttons -->","</div>","<div class=\"to-safe-trade-rb-bottom\"><div></div></div>","</div>","<div class=\"to-safe-trade-rb-wrapper usps-oneclick-password-container\">","<div class=\"to-safe-trade-rb-top\"><div></div></div>","<div class=\"to-safe-trade-rb-body\">","<div class=\"to-safe-trade-number-title\"><img src=\""+SwitchGames.imageUrl+"common/numbers/number-blue-2.png\" align=\"absmiddle\" style=\"margin-top:-5px;\"/>&nbsp;Password Confirmation<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" style=\"margin: -5px 5px 0px;\" align=\"absmiddle\"></div>","<div style=\"margin:10px 0px 0px 5px;color:#ccc;\">SwitchGames Password:&nbsp;<input class=\"input-text-wh\" type=\"password\" size=\"15\"/></div>","</div>","<div class=\"to-safe-trade-rb-bottom\"><div></div></div>","</div>","<div id=\"usps-error-msg\" class=\"usps-error-text\"></div>","</div>","</div>"];
SwitchGames.USPS.uspsPostageStep2=["<div class=\"usps-title\"><img src=\""+SwitchGames.imageUrl+"live_transcactions/usps-logo-bw.gif\"/><span class=\"usps-dots-container\"><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-blue.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/></span></div>","<div style=\"margin-left:10px;\">","<div class=\"usps-font-blue-small\" style=\"margin-top:10px;\">BILLING INFORMATION<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 5px;\"/><a href=\"https://sealinfo.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&dn=WWW.SWITCHGAMES.COM&lang=en\" target=\"_blank\"><img src=\""+SwitchGames.imageUrl+"common/icons/icon-thawte.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 0px;\"/></a><span id=\"usps-cc-error-msg\" class=\"usps-error-text\"></span></div>","<!-- start form -->","<table class=\"table-form\" style=\"margin-top:10px;\">","<tr>","<td class=\"label-rt\" width=\"130\">","<label class=\"label-caps\">payment method</label>","</td>","<td>","<select id=\"usps-cc-type\">","<option></option>","<option value=\"visa\">Visa</option>","<option value=\"mastercard\">MasterCard</option>","<option value=\"discover\">Discover</option>","<option value=\"amex\">American Express</option>","</select>","</td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" valign=\"top\">","<label class=\"label-caps\">card number</label>","</td>","<td><input id=\"usps-cc-number\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">cid</label>","</td>","<td><input id=\"usps-cc-cid\" class=\"input-text-wh\" type=\"text\" size=\"4\"/></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" valign=\"top\">","<label class=\"label-caps\">expiration</label>","</td>","<td>","<select id=\"usps-cc-expiry-month\">","<option></option>","<option value=\"01\">01</option>","<option value=\"02\">02</option>","<option value=\"03\">03</option>","<option value=\"04\">04</option>","<option value=\"05\">05</option>","<option value=\"06\">06</option>","<option value=\"07\">07</option>","<option value=\"08\">08</option>","<option value=\"09\">09</option>","<option value=\"10\">10</option>","<option value=\"11\">11</option>","<option value=\"12\">12</option>","</select> "," <select id=\"usps-cc-expiry-year\">","<option></option>","<option value=\"10\">2010</option>","<option value=\"11\">2011</option>","<option value=\"12\">2012</option>","<option value=\"13\">2013</option>","<option value=\"14\">2014</option>","<option value=\"15\">2015</option>","<option value=\"16\">2016</option>","<option value=\"17\">2017</option>","<option value=\"18\">2018</option>","<option value=\"19\">2019</option>","<option value=\"20\">2020</option>","<option value=\"21\">2021</option>","</select>","</td>","<td></td>","</tr>","<tr>","<td colspan=\"4\" style=\"height:15px;\"></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\">","<label class=\"label-caps\">first name</label>","</td>","<td><input id=\"usps-cc-firstname\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\">","<label class=\"label-caps\">last name</label>","</td>","<td><input id=\"usps-cc-lastname\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\">","<label class=\"label-caps\">address</label>","</td>","<td colspan=\"3\"><input id=\"usps-cc-address1\" class=\"input-text-wh\" type=\"text\" size=\"40\"/></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\">","<label class=\"label-caps\">suite/apartment</label>","</td>","<td><input id=\"usps-cc-address2\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\">","<label class=\"label-caps\">city</label>","</td>","<td><input id=\"usps-cc-city\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">state</label>","</td>","<td>","<select id=\"usps-cc-state\">","<option></option>","<option value=\"AK\">AK</option>","<option value=\"AL\">AL</option>","<option value=\"AR\">AR</option>","<option value=\"AZ\">AZ</option>","<option value=\"CA\">CA</option>","<option value=\"CO\">CO</option>","<option value=\"CT\">CT</option>","<option value=\"DC\">DC</option>","<option value=\"DE\">DE</option>","<option value=\"FL\">FL</option>","<option value=\"GA\">GA</option>","<option value=\"HI\">HI</option>","<option value=\"IA\">IA</option>","<option value=\"ID\">ID</option>","<option value=\"IL\">IL</option>","<option value=\"IN\">IN</option>","<option value=\"KS\">KS</option>","<option value=\"KY\">KY</option>","<option value=\"LA\">LA</option>","<option value=\"MA\">MA</option>","<option value=\"MD\">MD</option>","<option value=\"ME\">ME</option>","<option value=\"MI\">MI</option>","<option value=\"MN\">MN</option>","<option value=\"MO\">MO</option>","<option value=\"MS\">MS</option>","<option value=\"MT\">MT</option>","<option value=\"NC\">NC</option>","<option value=\"ND\">ND</option>","<option value=\"NE\">NE</option>","<option value=\"NH\">NH</option>","<option value=\"NJ\">NJ</option>","<option value=\"NM\">NM</option>","<option value=\"NV\">NV</option>","<option value=\"NY\">NY</option>","<option value=\"OH\">OH</option>","<option value=\"OK\">OK</option>","<option value=\"OR\">OR</option>","<option value=\"PA\">PA</option>","<option value=\"RI\">RI</option>","<option value=\"SC\">SC</option>","<option value=\"SD\">SD</option>","<option value=\"TN\">TN</option>","<option value=\"TX\">TX</option>","<option value=\"UT\">UT</option>","<option value=\"VA\">VA</option>","<option value=\"VT\">VT</option>","<option value=\"WA\">WA</option>","<option value=\"WI\">WI</option>","<option value=\"WV\">WV</option>","<option value=\"WY\">WY</option>","</select>","</td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\">","<label class=\"label-caps\">zip</label>","</td>","<td><input id=\"usps-cc-zip\" class=\"input-text-wh\" type=\"text\" maxlength=\"10\" size=\"10\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">country</label>","</td>","<td>","<select>","<option>USA</option>","</select>","</td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\">","<label class=\"label-caps\">phone number</label>","</td>","<td><input id=\"usps-cc-phone1\" class=\"input-text-wh\" type=\"text\" maxlength=\"3\" size=\"3\"/>-<input id=\"usps-cc-phone2\" class=\"input-text-wh\" type=\"text\" maxlength=\"3\" size=\"3\"/>-<input id=\"usps-cc-phone3\" class=\"input-text-wh\" type=\"text\" maxlength=\"4\" size=\"4\"/></td>","<td colspan=\"2\"><span class=\"usps-font-blue-small\"><b>MUST</b> be the number on file!</span></div></td>","</tr>","<tr>","<td></td>","<td style=\"padding-top: 10px;\" colspan=\"3\"><input id=\"usps-cc-saveInfo\" type=\"checkbox\" /><label>&nbsp;Save this information for one-click purchases on SwitchGames</label></td>","</tr>","</table>","<!-- end form -->","</div>"];
SwitchGames.USPS.uspsPostageStep3=["<div class=\"usps-title\"><img src=\""+SwitchGames.imageUrl+"live_transcactions/usps-logo-bw.gif\"/><span class=\"usps-dots-container\"><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-white.gif\"/><img src=\""+SwitchGames.imageUrl+"account_info/verify-dot-blue.gif\"/></span></div>","<div class=\"usps-font-blue-small\" style=\"margin:10px 0px 0px 10px;\">CONFIRM &amp; PROCESS<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 5px;\"/></div>","<div style=\"text-align:center;\">","<div class=\"usps-large-text\" style=\"margin-top:55px;\">You will be charged <span id=\"usps-final-price\"></span></div>","<div class=\"usps-large-text\" style=\"margin-top:15px;\">for the shipping label.</div>","<!-- processing image (visibility of this div can be shown/hidden) -->","<div id=\"usps-processing\" class=\"usps-processing-text\" style=\"margin-top:25px; visibility: hidden;\"><img src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" align=\"absmiddle\"/>&nbsp;&nbsp;Processing...</div>","<div id=\"usps-final-error-msg\" class=\"usps-error-text\" style=\"margin-top:15px;\"></div>","</div>"];
SwitchGames.USPS.uspsPostageStep4=["<div class=\"usps-title\"><img src=\""+SwitchGames.imageUrl+"live_transcactions/usps-logo-bw.gif\"/></div>","<div style=\"text-align:center;\">","<div class=\"usps-font-blue-large\" style=\"margin-top:85px;\">Postage Added!</div>","<div class=\"usps-medium-text\" style=\"margin-top:15px;\">(close this window and print label)</div>","<img id=\"usps-ok-button\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-ok.png\" style=\"margin-top:35px;cursor:pointer;\"/>","</div>"];
SwitchGames.USPS.nxtBtnTxt="NEXT";
SwitchGames.USPS.uspsPostageTpl=["<div name=\"panel-scroller-root\" class=\"verify-dialog-body\" style=\"position: relative;\">","<div class=\"verify-dialog-body-left-col\" style=\"\">","<div id=\"usps-left-scroller-container\" name=\"panel-scroller-left-arrow\" style=\"position: relative; top: 130px; left: 0px;\">","<div id=\"usps-left-scroller-btn\" class=\"left-scroller-btn-enable\"></div><span style=\"position: relative; top: 5px; left: 10px;\">PREV</span>","</div>","</div>","<div class=\"verify-dialog-body-center-col\" style=\"\">","<div name=\"panel-scroller-content-root\" totalpanels=\"5\" currentpanel=\"0\" class=\"panelcontrol\">","<div name=\"panel-scroller-content\">"+SwitchGames.USPS.uspsPostageStep1.join("")+"</div>","<div name=\"panel-scroller-content\" style=\"display:none\">"+SwitchGames.USPS.uspsPostageStep_OneClick.join("")+"</div>","<div name=\"panel-scroller-content\" style=\"display:none\">"+SwitchGames.USPS.uspsPostageStep2.join("")+"</div>","<div name=\"panel-scroller-content\" style=\"display:none\">"+SwitchGames.USPS.uspsPostageStep3.join("")+"</div>","<div name=\"panel-scroller-content\" style=\"display:none\">"+SwitchGames.USPS.uspsPostageStep4.join("")+"</div>","</div>","</div>","<div  class=\"verify-dialog-body-right-col\" style=\"\">","<div id=\"usps-right-scroller-container\" name=\"panel-scroller-right-arrow\" style=\"position: relative; top: 130px; left: 15px;\">","<div id=\"usps-right-scroller-btn\" class=\"right-scroller-btn-disable\"></div><span style=\"position: relative; top: 5px; left: 10px;\">"+SwitchGames.USPS.nxtBtnTxt+"</span>","</div>","</div>","</div>"];
SwitchGames.USPS.simpleFieldValidation=function(_632,type){
var _634=new RegExp(/(^\d{3}$)|(^\d{4}$)/);
var _635=new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
var _636=new RegExp(/(^\d{3}$)/);
var _637=new RegExp(/(^\d{4}$)/);
var _638=new RegExp(/(^\d+$)/);
if(_632.length==0){
return false;
}else{
if(type=="cid"&&!_634.test(_632)){
return false;
}else{
if((type=="areacode"||type=="prefix")&&!_636.test(_632)){
return false;
}else{
if(type=="suffix"&&!_637.test(_632)){
return false;
}else{
if(type=="zip"&&!_635.test(_632)){
return false;
}else{
if(type=="numeric"&&!_638.test(_632)){
return false;
}
}
}
}
}
}
return true;
};
SwitchGames.USPS.validatePanel1=function(){
var _639=Ext.get("usps-error-msg");
var _63a=Ext.get("usps-weight").getValue();
if(_63a.length==0){
_639.update("You must specify a weight for the item to be sent.");
Ext.fly("usps-right-scroller-btn").removeClass("right-scroller-btn-enable");
Ext.fly("usps-right-scroller-btn").addClass("right-scroller-btn-disable");
return false;
}
if(_63a=="0"){
_639.update("The weight must be greater than 0");
Ext.fly("usps-right-scroller-btn").removeClass("right-scroller-btn-enable");
Ext.fly("usps-right-scroller-btn").addClass("right-scroller-btn-disable");
return false;
}else{
if(SwitchGames.USPS.simpleFieldValidation(_63a,"numeric")==false){
_639.update("Invalid weight specified");
Ext.fly("usps-right-scroller-btn").removeClass("right-scroller-btn-enable");
Ext.fly("usps-right-scroller-btn").addClass("right-scroller-btn-disable");
return false;
}else{
_639.update("");
Ext.fly("usps-right-scroller-btn").removeClass("right-scroller-btn-disable");
Ext.fly("usps-right-scroller-btn").addClass("right-scroller-btn-enable");
return true;
}
}
};
SwitchGames.USPS.panel2Params={type:"",number:"",cid:"",expirymonth:"",expiryyear:"",firstname:"",lastname:"",address1:"",address2:"",city:"",state:"",zip:"",country:"USA",phone1:"",phone2:"",phone3:""};
SwitchGames.USPS.panel2Validation={type:false,number:false,cid:false,expirymonth:false,expiryyear:false,firstname:false,lastname:false,address1:false,city:false,state:false,zip:false,country:true,phone1:false,phone2:false,phone3:false};
SwitchGames.USPS.validatePanel2=function(){
var _63b=true;
for(var _63c in SwitchGames.USPS.panel2Validation){
if(SwitchGames.USPS.panel2Validation.hasOwnProperty(_63c)){
if(SwitchGames.USPS.panel2Validation[_63c]==false){
_63b=false;
break;
}
}
}
if(_63b==true){
Ext.fly("usps-right-scroller-btn").removeClass("right-scroller-btn-disable");
Ext.fly("usps-right-scroller-btn").addClass("right-scroller-btn-enable");
}else{
Ext.fly("usps-right-scroller-btn").removeClass("right-scroller-btn-enable");
Ext.fly("usps-right-scroller-btn").addClass("right-scroller-btn-disable");
}
return _63b;
};
SwitchGames.USPS.mailclass="First Class";
SwitchGames.USPS.weight="";
SwitchGames.USPS.signature=false;
SwitchGames.USPS.delivery=false;
SwitchGames.USPS.amount=0;
SwitchGames.USPS.updatePrice=function(el){
var _63e=Ext.fly("usps-weight").getValue();
var _63f=Ext.fly("usps-mailclass");
var _640=Ext.fly("usps-mailclass").getValue();
var _641=Ext.fly("usps-signature").dom.checked==true?"ON":"OFF";
var _642=Ext.fly("usps-delivery").dom.checked==true?"ON":"OFF";
if(_641==SwitchGames.USPS.signature&&_642==SwitchGames.USPS.delivery&&_640==SwitchGames.USPS.mailclass&&_63e==SwitchGames.USPS.weight){
return;
}
SwitchGames.USPS.mailclass=_640;
SwitchGames.USPS.weight=_63e;
SwitchGames.USPS.signature=_641;
SwitchGames.USPS.delivery=_642;
var _643={usehttps:"1",pane:"get_price",dealid:SwitchGames.USPS.dealid,mailclass:SwitchGames.USPS.mailclass,signature:SwitchGames.USPS.signature,delivery:SwitchGames.USPS.delivery,weight:SwitchGames.USPS.weight};
SwitchGames.Utility.sendSecureRequest("data/common/endicia.php",_643,function(_644){
var _645=Ext.get("usps-error-msg");
var data=Ext.util.JSON.decode(_644.responseText);
if(data.error!=undefined){
_645.update(data.error);
Ext.fly("usps-right-scroller-btn").addClass("right-scroller-btn-disable");
Ext.fly("usps-right-scroller-btn").removeClass("right-scroller-btn-enable");
SwitchGames.USPS.amount=0;
}else{
var _647=Ext.get(el);
_647.update("$"+data.rate);
var _648=Ext.get("usps-final-price");
_648.update("$"+data.rate);
Ext.fly("usps-right-scroller-btn").removeClass("right-scroller-btn-disable");
Ext.fly("usps-right-scroller-btn").addClass("right-scroller-btn-enable");
_645.update("");
SwitchGames.USPS.amount=data.rate;
}
},function(_649){
var _64a=Ext.get("usps-error-msg");
SwitchGames.Dialogs.showErrorDialog(_649.statusText);
_64a.update(_649.statusText);
Ext.fly("left-scroller-container").setVisible(true);
});
};
SwitchGames.USPS.uspsPostageDialog.body.update(SwitchGames.USPS.uspsPostageTpl.join(""));
Ext.fly("usps-ok-button").on("click",function(e,t){
SwitchGames.USPS.uspsPostageDialog.hide();
if(SwitchGames.USPS.successCallback!=null){
SwitchGames.USPS.successCallback();
}
SwitchGames.Utility.scrollPanelLeft(Ext.select("[@name=\"panel-scroller-root\"]",true,SwitchGames.USPS.uspsPostageDialog.body.dom).elements[0],4,0,"slide",true);
});
Ext.fly("usps-mailclass").on("blur",function(e,t){
if(SwitchGames.USPS.validatePanel1()==true){
SwitchGames.USPS.updatePrice("usps-price");
}
});
Ext.fly("usps-mailclass").on("change",function(e,t){
if(SwitchGames.USPS.validatePanel1()==true){
SwitchGames.USPS.updatePrice("usps-price");
}
});
Ext.fly("usps-weight").on("blur",function(e,t){
if(SwitchGames.USPS.validatePanel1()==true){
SwitchGames.USPS.updatePrice("usps-price");
}
});
Ext.fly("usps-signature").on("blur",function(e,t){
if(SwitchGames.USPS.validatePanel1()==true){
SwitchGames.USPS.updatePrice("usps-price");
}
});
Ext.fly("usps-signature").on("click",function(e,t){
if(SwitchGames.USPS.validatePanel1()==true){
SwitchGames.USPS.updatePrice("usps-price");
}
});
Ext.fly("usps-delivery").on("blur",function(e,t){
if(SwitchGames.USPS.validatePanel1()==true){
SwitchGames.USPS.updatePrice("usps-price");
}
});
Ext.fly("usps-delivery").on("click",function(e,t){
if(SwitchGames.USPS.validatePanel1()==true){
SwitchGames.USPS.updatePrice("usps-price");
}
});
Ext.fly("usps-cc-type").on("blur",function(e,t){
SwitchGames.USPS.panel2Params.type=Ext.fly(t).getValue();
var _65d=Ext.get("usps-cc-error-msg");
if(SwitchGames.USPS.panel2Params.type==""){
_65d.update("You must select a credit card type");
SwitchGames.USPS.panel2Validation.type=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.type=true;
_65d.update("");
SwitchGames.USPS.validatePanel2();
}
});
Ext.fly("usps-cc-type").on("change",function(e,t){
SwitchGames.USPS.panel2Params.type=Ext.fly(t).getValue();
var _660=Ext.get("usps-cc-error-msg");
if(SwitchGames.USPS.panel2Params.type==""){
_660.update("You must select a credit card type");
SwitchGames.USPS.panel2Validation.type=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.type=true;
_660.update("");
SwitchGames.USPS.validatePanel2();
}
});
Ext.fly("usps-cc-number").on("blur",function(e,t){
var _663=Ext.get("usps-cc-error-msg");
SwitchGames.USPS.panel2Params.number=Ext.fly(t).getValue();
if(SwitchGames.USPS.panel2Params.type==""){
_663.update("You must select a credit card type first");
SwitchGames.USPS.panel2Validation.number=false;
SwitchGames.USPS.validatePanel2();
}
if(SwitchGames.USPS.panel2Params.number==""){
_663.update("You must enter a credit card number");
SwitchGames.USPS.panel2Validation.number=false;
SwitchGames.USPS.validatePanel2();
}else{
if(SwitchGames.Utility.creditCardNumberValidation(SwitchGames.USPS.panel2Params.number,SwitchGames.USPS.panel2Params.type)==false){
_663.update("Invalid card type/number");
SwitchGames.USPS.panel2Validation.number=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.number=true;
_663.update("");
SwitchGames.USPS.validatePanel2();
}
}
});
Ext.fly("usps-cc-expiry-month").on("blur",function(e,t){
SwitchGames.USPS.panel2Params.expirymonth=Ext.fly(t).getValue();
var _666=Ext.get("usps-cc-error-msg");
if(SwitchGames.USPS.panel2Params.expirymonth==""){
_666.update("You must select the month your card expires");
SwitchGames.USPS.panel2Validation.expirymonth=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.expirymonth=true;
_666.update("");
SwitchGames.USPS.validatePanel2();
}
});
Ext.fly("usps-cc-expiry-month").on("change",function(e,t){
SwitchGames.USPS.panel2Params.expirymonth=Ext.fly(t).getValue();
var _669=Ext.get("usps-cc-error-msg");
if(SwitchGames.USPS.panel2Params.expirymonth==""){
_669.update("You must select the month your card expires");
SwitchGames.USPS.panel2Validation.expirymonth=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.expirymonth=true;
_669.update("");
SwitchGames.USPS.validatePanel2();
}
});
Ext.fly("usps-cc-expiry-year").on("blur",function(e,t){
SwitchGames.USPS.panel2Params.expiryyear=Ext.fly(t).getValue();
var _66c=Ext.get("usps-cc-error-msg");
if(SwitchGames.USPS.panel2Params.expiryyear==""){
_66c.update("You must select the year your card expires");
SwitchGames.USPS.panel2Validation.expiryyear=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.expiryyear=true;
_66c.update("");
SwitchGames.USPS.validatePanel2();
}
});
Ext.fly("usps-cc-expiry-year").on("change",function(e,t){
SwitchGames.USPS.panel2Params.expiryyear=Ext.fly(t).getValue();
var _66f=Ext.get("usps-cc-error-msg");
if(SwitchGames.USPS.panel2Params.expiryyear==""){
_66f.update("You must select the year your card expires");
SwitchGames.USPS.panel2Validation.expiryyear=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.expiryyear=true;
_66f.update("");
SwitchGames.USPS.validatePanel2();
}
});
Ext.fly("usps-cc-cid").on("blur",function(e,t){
var _672=Ext.get("usps-cc-error-msg");
SwitchGames.USPS.panel2Params.cid=Ext.fly(t).getValue();
if(SwitchGames.USPS.panel2Params.cid==""){
_672.update("You must enter a CID");
SwitchGames.USPS.panel2Validation.cid=false;
SwitchGames.USPS.validatePanel2();
}else{
if(SwitchGames.USPS.simpleFieldValidation(SwitchGames.USPS.panel2Params.cid,"cid")==false){
_672.update("The CID you entered does not appear to be valid");
SwitchGames.USPS.panel2Validation.cid=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.cid=true;
_672.update("");
SwitchGames.USPS.validatePanel2();
}
}
});
Ext.fly("usps-cc-firstname").on("blur",function(e,t){
var _675=Ext.get("usps-cc-error-msg");
SwitchGames.USPS.panel2Params.firstname=Ext.fly(t).getValue();
if(SwitchGames.USPS.panel2Params.firstname==""){
_675.update("You must enter a first name");
SwitchGames.USPS.panel2Validation.firstname=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.firstname=true;
_675.update("");
SwitchGames.USPS.validatePanel2();
}
});
Ext.fly("usps-cc-lastname").on("blur",function(e,t){
var _678=Ext.get("usps-cc-error-msg");
SwitchGames.USPS.panel2Params.lastname=Ext.fly(t).getValue();
if(SwitchGames.USPS.panel2Params.lastname==""){
_678.update("You must enter a last name");
SwitchGames.USPS.panel2Validation.lastname=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.lastname=true;
_678.update("");
SwitchGames.USPS.validatePanel2();
}
});
Ext.fly("usps-cc-address1").on("blur",function(e,t){
var _67b=Ext.get("usps-cc-error-msg");
SwitchGames.USPS.panel2Params.address1=Ext.fly(t).getValue();
if(SwitchGames.USPS.panel2Params.address1==""){
_67b.update("You must enter at least the first address line");
SwitchGames.USPS.panel2Validation.address1=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.address1=true;
_67b.update("");
SwitchGames.USPS.validatePanel2();
}
});
Ext.fly("usps-cc-city").on("blur",function(e,t){
var _67e=Ext.get("usps-cc-error-msg");
SwitchGames.USPS.panel2Params.city=Ext.fly(t).getValue();
if(SwitchGames.USPS.panel2Params.city==""){
_67e.update("You must enter a city");
SwitchGames.USPS.panel2Validation.city=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.city=true;
_67e.update("");
SwitchGames.USPS.validatePanel2();
}
});
Ext.fly("usps-cc-state").on("blur",function(e,t){
var _681=Ext.get("usps-cc-error-msg");
SwitchGames.USPS.panel2Params.state=Ext.fly(t).getValue();
if(SwitchGames.USPS.panel2Params.state==""){
_681.update("You must select a state");
SwitchGames.USPS.panel2Validation.state=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.state=true;
_681.update("");
SwitchGames.USPS.validatePanel2();
}
});
Ext.fly("usps-cc-state").on("change",function(e,t){
var _684=Ext.get("usps-cc-error-msg");
SwitchGames.USPS.panel2Params.state=Ext.fly(t).getValue();
if(SwitchGames.USPS.panel2Params.state==""){
_684.update("You must select a state");
SwitchGames.USPS.panel2Validation.state=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.state=true;
_684.update("");
SwitchGames.USPS.validatePanel2();
}
});
Ext.fly("usps-cc-zip").on("blur",function(e,t){
var _687=Ext.get("usps-cc-error-msg");
SwitchGames.USPS.panel2Params.zip=Ext.fly(t).getValue();
if(SwitchGames.USPS.panel2Params.zip==""){
_687.update("You must enter a zip code");
SwitchGames.USPS.panel2Validation.zip=false;
SwitchGames.USPS.validatePanel2();
}else{
if(SwitchGames.USPS.simpleFieldValidation(SwitchGames.USPS.panel2Params.zip,"zip")==false){
_687.update("Invalid zip code");
SwitchGames.USPS.panel2Validation.zip=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.zip=true;
_687.update("");
SwitchGames.USPS.validatePanel2();
}
}
});
Ext.fly("usps-cc-phone1").on("blur",function(e,t){
var _68a=Ext.get("usps-cc-error-msg");
SwitchGames.USPS.panel2Params.phone1=Ext.fly(t).getValue();
if(SwitchGames.USPS.panel2Params.phone1==""){
_68a.update("You must enter an area code");
SwitchGames.USPS.panel2Validation.phone1=false;
SwitchGames.USPS.validatePanel2();
}else{
if(SwitchGames.USPS.simpleFieldValidation(SwitchGames.USPS.panel2Params.phone1,"areacode")==false){
_68a.update("Invalid area code");
SwitchGames.USPS.panel2Validation.phone1=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.phone1=true;
_68a.update("");
SwitchGames.USPS.validatePanel2();
}
}
});
Ext.fly("usps-cc-phone2").on("blur",function(e,t){
var _68d=Ext.get("usps-cc-error-msg");
SwitchGames.USPS.panel2Params.phone2=Ext.fly(t).getValue();
if(SwitchGames.USPS.panel2Params.phone2==""){
_68d.update("You must enter a phone number");
SwitchGames.USPS.panel2Validation.phone2=false;
SwitchGames.USPS.validatePanel2();
}else{
if(SwitchGames.USPS.simpleFieldValidation(SwitchGames.USPS.panel2Params.phone2,"prefix")==false){
_68d.update("Invalid phone number");
SwitchGames.USPS.panel2Validation.phone2=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.phone2=true;
_68d.update("");
SwitchGames.USPS.validatePanel2();
}
}
});
Ext.fly("usps-cc-phone3").on("blur",function(e,t){
var _690=Ext.get("usps-cc-error-msg");
SwitchGames.USPS.panel2Params.phone3=Ext.fly(t).getValue();
if(SwitchGames.USPS.panel2Params.phone3==""){
_690.update("You must enter a phone number");
SwitchGames.USPS.panel2Validation.phone3=false;
SwitchGames.USPS.validatePanel2();
}else{
if(SwitchGames.USPS.simpleFieldValidation(SwitchGames.USPS.panel2Params.phone3,"suffix")==false){
_690.update("Invalid phone number");
SwitchGames.USPS.panel2Validation.phone3=false;
SwitchGames.USPS.validatePanel2();
}else{
SwitchGames.USPS.panel2Validation.phone3=true;
_690.update("");
SwitchGames.USPS.validatePanel2();
}
}
});
SwitchGames.USPS.uspsPostageDialog.body.on("click",function(e,t){
var _693=Ext.query(".usps-oneclick-password-container",SwitchGames.USPS.uspsPostageDialog.body.dom)[0];
if(t.value=="cc"||t.value=="credit"){
_693.style.display="";
}else{
_693.style.display="none";
}
},null,{delegate:"input[name=\"paymentType\"]"});
SwitchGames.USPS.panelLeftButtonCallbackFunction=function(_694,_695,_696,_697,_698){
var _699=_696.findParent("div[@name=\"panel-scroller-root\"]",10,true);
if(_697==1){
SwitchGames.USPS.validatePanel1();
return true;
}else{
if(_697==2){
if(SwitchGames.USPS.oneClickParams.cc===true||SwitchGames.USPS.hasSGCredit===true){
return true;
}else{
SwitchGames.Utility.scrollPanelLeft(_699,_697,0,"slide",null,SwitchGames.USPS.afterScrollCallback);
return false;
}
}else{
if(_697==3){
if(SwitchGames.USPS.oneClickParams.paymentType=="cc"||SwitchGames.USPS.oneClickParams.paymentType=="credit"){
SwitchGames.Utility.scrollPanelLeft(_699,_697,1,"slide",null,SwitchGames.USPS.afterScrollCallback);
return false;
}else{
var _69a=Ext.get("usps-final-error-msg");
_69a.update("");
SwitchGames.USPS.validatePanel2();
return true;
}
}
}
}
return true;
};
SwitchGames.USPS.afterScrollCallback=function(_69b){
var _69c=_69b.findParent("[@name=\"panel-scroller-content-root\"]",20,false);
if(_69c){
var _69d=_69c.getAttribute("currentPanel");
if(_69d==1){
if(SwitchGames.USPS.hasSGCredit===true){
Ext.DomQuery.selectNode("input[name=\"paymentType\"][value=\"credit\"]",SwitchGames.USPS.uspsPostageDialog.body.dom).checked=true;
Ext.DomQuery.selectNode(".usps-oneclick-password-container",SwitchGames.USPS.uspsPostageDialog.body.dom).style.display="";
}else{
if(SwitchGames.USPS.oneClickParams.paymentType=="cc"){
Ext.DomQuery.selectNode("input[name=\"paymentType\"][value=\"cc\"]",SwitchGames.USPS.uspsPostageDialog.body.dom).checked=true;
Ext.DomQuery.selectNode(".usps-oneclick-password-container",SwitchGames.USPS.uspsPostageDialog.body.dom).style.display="";
}else{
Ext.DomQuery.selectNode("input[name=\"paymentType\"][value=\"new\"]",SwitchGames.USPS.uspsPostageDialog.body.dom).checked=true;
Ext.DomQuery.selectNode(".usps-oneclick-password-container",SwitchGames.USPS.uspsPostageDialog.body.dom).style.display="none";
}
}
}
}
};
SwitchGames.USPS.panelRightButtonCallbackFunction=function(_69e,_69f,_6a0,_6a1,_6a2,_6a3){
var _6a4=_6a0.findParent("div[@name=\"panel-scroller-root\"]",10,true);
if(_6a1==0){
if(SwitchGames.USPS.validatePanel1()==false){
SwitchGames.Dialogs.showErrorDialog("You must fill in all of the required fields before proceeding");
return false;
}
if(SwitchGames.USPS.oneClickParams.cc!==true&&SwitchGames.USPS.hasSGCredit!==true){
SwitchGames.USPS.oneClickParams.paymentType="new";
SwitchGames.USPS.validatePanel2();
SwitchGames.Utility.scrollPanelRight(_6a4,_6a1,2,"slide",null,SwitchGames.USPS.afterScrollCallback);
return false;
}else{
SwitchGames.USPS.enableRightButton();
}
}else{
if(_6a1==1){
var _6a5=Ext.DomQuery.selectNode("input[name=\"paymentType\"]:checked",SwitchGames.USPS.uspsPostageDialog.body.dom);
if(_6a5.value==="cc"||_6a5.value==="credit"){
var _6a6=Ext.DomQuery.selectNode(".usps-oneclick-password-container input[type=\"password\"]",SwitchGames.USPS.uspsPostageDialog.body.dom);
_6a6=_6a6.value;
var _6a7={};
_6a7.pane="check_password";
_6a7.password=_6a6;
SwitchGames.Utility.sendSecureRequest("data/common/utilities.php",_6a7,function(_6a8){
var data=Ext.util.JSON.decode(_6a8.responseText);
if(data.error!=null){
SwitchGames.Dialogs.showErrorDialog(data.error);
}else{
if(data.success===true){
SwitchGames.USPS.oneClickParams.paymentType=_6a5.value;
SwitchGames.USPS.oneClickParams.password=_6a6;
SwitchGames.Utility.scrollPanelRight(_6a4,_6a1,3,"slide",null,SwitchGames.USPS.afterScrollCallback);
}else{
SwitchGames.Dialogs.showErrorDialog("The password you entered was incorrect!");
}
}
},function(_6aa){
SwitchGames.Dialogs.showErrorDialog(_6aa.statusText);
});
return false;
}else{
SwitchGames.USPS.oneClickParams.paymentType="new";
SwitchGames.USPS.validatePanel2();
}
}else{
if(_6a1==2){
if(SwitchGames.USPS.validatePanel2()==false){
SwitchGames.Dialogs.showErrorDialog("You must fill in all of the required fields before proceeding");
return false;
}
}else{
if(_6a1==3){
Ext.fly("usps-processing").setVisible(true);
if(SwitchGames.USPS.oneClickParams.paymentType=="credit"){
SwitchGames.USPS.creditPurchase();
}else{
SwitchGames.USPS.authorizePurchase();
}
return false;
}
}
}
}
return true;
};
SwitchGames.USPS.enableRightButton=function(){
Ext.fly("usps-right-scroller-btn").removeClass("right-scroller-btn-disable");
Ext.fly("usps-right-scroller-btn").addClass("right-scroller-btn-enable");
};
SwitchGames.USPS.disableRightButton=function(){
Ext.fly("usps-right-scroller-btn").removeClass("right-scroller-btn-enable");
Ext.fly("usps-right-scroller-btn").addClass("right-scroller-btn-disable");
};
SwitchGames.USPS.creditPurchase=function(){
var _6ab=Ext.get("usps-final-error-msg");
_6ab.update("");
if(parseFloat(SwitchGames.USPS.balance)<parseFloat(SwitchGames.USPS.amount)){
SwitchGames.Dialogs.showErrorDialog("You do not have sufficient funds for this purchase.");
}else{
params={usehttps:"1",pane:"sgCreditPurchase",firstname:SwitchGames.USPS.panel2Params.firstname,lastname:SwitchGames.USPS.panel2Params.lastname,address1:SwitchGames.USPS.panel2Params.address1,address2:SwitchGames.USPS.panel2Params.address2,city:SwitchGames.USPS.panel2Params.city,state:SwitchGames.USPS.panel2Params.state,zip:SwitchGames.USPS.panel2Params.zip,country:"USA",phone:SwitchGames.USPS.panel2Params.phone1+SwitchGames.USPS.panel2Params.phone2+SwitchGames.USPS.panel2Params.phone3,amount:SwitchGames.USPS.amount,dealid:SwitchGames.USPS.dealid,mailclass:SwitchGames.USPS.mailclass,signature:SwitchGames.USPS.signature,delivery:SwitchGames.USPS.delivery,weight:SwitchGames.USPS.weight};
SwitchGames.Utility.sendSecureRequest("data/common/endicia.php",params,function(_6ac){
Ext.fly("usps-processing").setVisible(false);
var data=Ext.util.JSON.decode(_6ac.responseText);
if(data.error!=undefined){
Ext.fly("usps-processing").setVisible(false);
_6ab.update(data.error);
}else{
_6ab.update(data.success);
SwitchGames.Utility.scrollPanelRight(Ext.select("[@name=\"panel-scroller-root\"]",true,SwitchGames.USPS.uspsPostageDialog.body.dom).elements[0],3,4,"slide",true,SwitchGames.USPS.afterScrollCallback);
}
},function(_6ae){
Ext.fly("usps-processing").setVisible(false);
SwitchGames.Dialogs.showErrorDialog(_6ae.statusText);
_6ab.update(_6ae.statusText);
Ext.fly("left-scroller-container").setVisible(true);
});
}
Ext.fly("usps-processing").setVisible(false);
return false;
};
SwitchGames.USPS.authorizePurchase=function(){
var _6af=Ext.get("usps-final-error-msg");
_6af.update("");
var _6b0={usehttps:"1",pane:"authorize",card_type:SwitchGames.USPS.panel2Params.type,card_number:SwitchGames.USPS.panel2Params.number,card_cvv2:SwitchGames.USPS.panel2Params.cid,card_expiry:SwitchGames.USPS.panel2Params.expirymonth+SwitchGames.USPS.panel2Params.expiryyear,firstname:SwitchGames.USPS.panel2Params.firstname,lastname:SwitchGames.USPS.panel2Params.lastname,address1:SwitchGames.USPS.panel2Params.address1,address2:SwitchGames.USPS.panel2Params.address2,city:SwitchGames.USPS.panel2Params.city,state:SwitchGames.USPS.panel2Params.state,zip:SwitchGames.USPS.panel2Params.zip,country:"USA",phone:SwitchGames.USPS.panel2Params.phone1+SwitchGames.USPS.panel2Params.phone2+SwitchGames.USPS.panel2Params.phone3,amount:SwitchGames.USPS.amount,dealid:SwitchGames.USPS.dealid,mailclass:SwitchGames.USPS.mailclass,signature:SwitchGames.USPS.signature,delivery:SwitchGames.USPS.delivery,weight:SwitchGames.USPS.weight,oneClickPaymentType:SwitchGames.USPS.oneClickParams.paymentType,oneClickPassword:SwitchGames.USPS.oneClickParams.password,oneClickSaveInfo:Ext.fly("usps-cc-saveInfo").dom.checked};
SwitchGames.Utility.sendSecureRequest("data/common/endicia.php",_6b0,function(_6b1){
var data=Ext.util.JSON.decode(_6b1.responseText);
if(data.error!=undefined){
Ext.fly("usps-processing").setVisible(false);
_6af.update(data.error);
}else{
SwitchGames.USPS.pnref=data.PNREF;
SwitchGames.USPS.capturePurchase();
}
},function(_6b3){
Ext.fly("usps-processing").setVisible(false);
SwitchGames.Dialogs.showErrorDialog(_6b3.statusText);
_6af.update(_6b3.statusText);
Ext.fly("left-scroller-container").setVisible(true);
});
};
SwitchGames.USPS.capturePurchase=function(){
var _6b4=Ext.get("usps-cc-error-msg");
var _6b5={usehttps:"1",pane:"capture",dealid:SwitchGames.USPS.dealid,origid:SwitchGames.USPS.pnref,card_number:SwitchGames.USPS.oneClickParams.paymentType=="cc"?SwitchGames.USPS.oneClickParams.cc_last4:SwitchGames.USPS.panel2Params.number,card_type:SwitchGames.USPS.oneClickParams.paymentType=="cc"?SwitchGames.USPS.oneClickParams.cc_type:SwitchGames.USPS.panel2Params.type,amount:SwitchGames.USPS.amount};
SwitchGames.Utility.sendSecureRequest("data/common/endicia.php",_6b5,function(_6b6){
var data=Ext.util.JSON.decode(_6b6.responseText);
Ext.fly("usps-processing").setVisible(false);
if(data.error!=undefined){
_6b4.update(data.error);
Ext.fly("left-scroller-container").setVisible(true);
}else{
_6b4.update(data.success);
SwitchGames.Utility.scrollPanelRight(Ext.select("[@name=\"panel-scroller-root\"]",true,SwitchGames.USPS.uspsPostageDialog.body.dom).elements[0],3,4,"slide",true,SwitchGames.USPS.afterScrollCallback);
}
},function(_6b8){
SwitchGames.Dialogs.showErrorDialog(_6b8.statusText);
_6b4.update(_6b8.statusText);
Ext.fly("left-scroller-container").setVisible(true);
});
};
SwitchGames.Utility.setupLeftRightScrolling(Ext.select(".panelcontrol",true,SwitchGames.USPS.uspsPostageDialog.body.dom).elements[0],Ext.select("[@name=\"panel-scroller-left-arrow\"]",true,SwitchGames.USPS.uspsPostageDialog.body.dom).elements[0],Ext.select("[@name=\"panel-scroller-right-arrow\"]",true,SwitchGames.USPS.uspsPostageDialog.body.dom).elements[0],"slide",true,SwitchGames.USPS.panelLeftButtonCallbackFunction,SwitchGames.USPS.panelRightButtonCallbackFunction,SwitchGames.USPS.afterScrollCallback);
SwitchGames.USPS.showPostageDialog=function(_6b9,_6ba){
SwitchGames.USPS.successCallback=_6ba;
SwitchGames.USPS.panel2Params={type:"",number:"",cid:"",expirymonth:"",expiryyear:"",firstname:"",lastname:"",address1:"",address2:"",city:"",state:"",zip:"",country:"USA",phone1:"",phone2:"",phone3:""};
SwitchGames.USPS.panel2Validation={type:false,number:false,cid:false,expirymonth:false,expiryyear:false,firstname:false,lastname:false,address1:false,city:false,state:false,zip:false,country:true,phone1:false,phone2:false,phone3:false};
SwitchGames.USPS.mailclass="First Class";
SwitchGames.USPS.weight=0;
SwitchGames.USPS.signature=false;
SwitchGames.USPS.delivery=false;
SwitchGames.USPS.amount=0;
SwitchGames.USPS.dealid=_6b9;
Ext.fly("usps-price").update("");
Ext.fly("usps-mailclass").dom.value="First";
Ext.fly("usps-weight").dom.value="";
Ext.fly("usps-signature").dom.checked=false;
Ext.fly("usps-delivery").dom.checked=false;
Ext.fly("usps-cc-type").dom.selectedIndex=0;
Ext.fly("usps-cc-number").dom.value="";
Ext.fly("usps-cc-saveInfo").dom.checked=true;
Ext.DomQuery.selectNode("input[name=\"paymentType\"][value=\"credit\"]",SwitchGames.USPS.uspsPostageDialog.body.dom).checked=true;
Ext.DomQuery.selectNode(".usps-oneclick-password-container",SwitchGames.USPS.uspsPostageDialog.body.dom).style.display="";
Ext.DomQuery.selectNode(".usps-oneclick-password-container input[type=\"password\"]",SwitchGames.USPS.uspsPostageDialog.body.dom).value="";
var _6bb=Ext.get("usps-cc-error-msg");
var _6bc={usehttps:"1",pane:"get_member_info"};
SwitchGames.Utility.sendSecureRequest("data/common/endicia.php",_6bc,function(_6bd){
var data=Ext.util.JSON.decode(_6bd.responseText);
if(data.error!=undefined){
}else{
var _6bf=data.first_name;
var _6c0=data.last_name;
var _6c1=data.address1;
var _6c2=data.address2;
var city=data.city;
var _6c4=data.state;
var zip=data.zip;
var _6c6=data.phone;
var _6c7,_6c8,_6c9;
var _6ca=data.balance;
if(_6bf==null||_6bf=="null"||_6bf==""){
_6bf="";
}else{
SwitchGames.USPS.panel2Validation.firstname=true;
}
if(_6c0==null||_6c0=="null"||_6c0==""){
_6c0="";
}else{
SwitchGames.USPS.panel2Validation.lastname=true;
}
if(_6c1==null||_6c1=="null"||_6c1==""){
_6c1="";
}else{
SwitchGames.USPS.panel2Validation.address1=true;
}
if(_6c2==null||_6c2=="null"||_6c2==""){
_6c2="";
}
if(city==null||city=="null"||city==""){
city="";
}else{
SwitchGames.USPS.panel2Validation.city=true;
}
if(_6c4==null||_6c4=="null"||_6c4==""){
_6c4="";
}else{
SwitchGames.USPS.panel2Validation.state=true;
}
if(zip==null||zip=="null"||zip==""){
zip="";
}else{
SwitchGames.USPS.panel2Validation.zip=true;
}
if(_6c6==null||_6c6=="null"||_6c6==""){
_6c7="";
_6c8="";
_6c9="";
}else{
_6c7=_6c6.substring(0,3);
_6c8=_6c6.substring(3,6);
_6c9=_6c6.substring(6,10);
SwitchGames.USPS.panel2Validation.phone1=true;
SwitchGames.USPS.panel2Validation.phone2=true;
SwitchGames.USPS.panel2Validation.phone3=true;
}
SwitchGames.USPS.panel2Params={type:"",number:"",cid:"",expirymonth:"",expiryyear:"",firstname:_6bf,lastname:_6c0,address1:_6c1,address2:_6c2,city:city,state:_6c4,zip:zip,country:"USA",phone1:_6c7,phone2:_6c8,phone3:_6c9};
Ext.fly("usps-cc-firstname").dom.value=_6bf;
Ext.fly("usps-cc-lastname").dom.value=_6c0;
Ext.fly("usps-cc-address1").dom.value=_6c1;
Ext.fly("usps-cc-address2").dom.value=_6c2;
Ext.fly("usps-cc-city").dom.value=city;
Ext.fly("usps-cc-state").dom.value=_6c4;
Ext.fly("usps-cc-zip").dom.value=zip;
Ext.fly("usps-cc-phone1").dom.value=_6c7;
Ext.fly("usps-cc-phone2").dom.value=_6c8;
Ext.fly("usps-cc-phone3").dom.value=_6c9;
Ext.fly("usps-sg-account").update(_6ca);
if(_6ca>3){
SwitchGames.USPS.hasSGCredit=true;
SwitchGames.USPS.balance=_6ca;
}else{
SwitchGames.USPS.hasSGCredit=false;
}
SwitchGames.USPS.oneClickParams={cc:data.oneclick_cc,cc_last4:data.oneclick_cc_last4,cc_type:data.oneclick_cc_type,paymentType:data.oneclick_cc?"cc":"new"};
Ext.query(".usps-oneclick-cc-last4",SwitchGames.USPS.uspsPostageDialog.body.dom)[0].innerHTML=data.oneclick_cc_last4;
var _6cb=Ext.select(".panelcontrol",true,SwitchGames.USPS.uspsPostageDialog.body.dom).elements[0].dom.getAttribute("currentPanel");
if(_6cb!="0"){
SwitchGames.Utility.scrollPanelLeft(Ext.select("[@name=\"panel-scroller-root\"]",true,SwitchGames.USPS.uspsPostageDialog.body.dom).elements[0],_6cb,0,"fade",true);
}
SwitchGames.USPS.uspsPostageDialog.show();
}
},function(_6cc){
SwitchGames.Dialogs.showErrorDialog(_6cc.statusText);
_6bb.update(_6cc.statusText);
Ext.fly("left-scroller-container").setVisible(true);
});
};
});
Ext.onReady(function(){
Ext.namespace("SwitchGames.TradeOffer","SwitchGames.TradeOfferDD");
SwitchGames.SafeTradeOfferDD.init();
SwitchGames.TradeOffer.safeTradeOfferPanel0Template=new Ext.XTemplate("<div style=\"text-align:center;\">","<div class=\"to-safe-trade-large-text\" style=\"margin-top:7px;\">Make This A <img src=\""+SwitchGames.imageUrl+"trade_offer/logo-safetrade-medium.png\" align=\"absmiddle\" style=\"margin-top:-7px;\"/> Offer</div>","<div class=\"to-safe-trade-large1-text\" style=\"margin-top:15px;\">Secure, Fast, and Easy Trades for Just $5.95</div>","</div>","<div class=\"to-safe-trade-small-text\" style=\"margin:30px 0px 0px 25px; width:400px;\">","<b class=\"to-safe-trade-brightgreen-text\">No Up Front Cost or Risk</b><br/>","You only pay the $5.95 fee if this member accepts your SafeTrade offer.","<br/><br/>","<b class=\"to-safe-trade-brightgreen-text\">You Are Safe</b><br/>","In a SafeTrade transaction, SwitchGames guarantees the full coverage of your game if it is lost in the mail or stolen by a fraudulent user.","<br/><br/>","<b class=\"to-safe-trade-brightgreen-text\">FREE First Class Shipping Label</b><br/>","In a SafeTrade, you receive a pre-paid, automatic First Class USPS shipping label that includes tracking.  First Class mail means quick delivery by the postal service too.","<br/><br/>","<b class=\"to-safe-trade-brightgreen-text\">Track Packages in Real-time</b><br/>","No need to ask the member you are trading with for their package tracking number, it is provided for you in the Live Transactions interface.","</div>","<div style=\"text-align:center;\">","<img name=\"safetrade-insurance-btn\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-safetrade-insurance-yes.png\" style=\"cursor:pointer;margin-top:30px;\"/>","<img id=\"no-safetrade-insurance-btn\" name=\"no-safetrade-insurance-btn\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-safetrade-insurance-no.png\" style=\"cursor:pointer;margin-top:15px;display:none;\"/>","</div>");
SwitchGames.TradeOffer.safeTradeOfferPanel1Template=new Ext.XTemplate("<div style=\"text-align:center;\">","<div class=\"to-safe-trade-large-text\" style=\"margin-top:7px;\">Authorize <img src=\""+SwitchGames.imageUrl+"trade_offer/logo-safetrade-medium.png\" align=\"absmiddle\" style=\"margin-top:-7px;\"/> Charge</div>","</div>","<div style=\"text-align:center; padding-bottom: 25px;\">","<div class=\"to-safe-trade-large1-text\">You will <strong><u>ONLY</u></strong> be charged $5.95 if offer is accepted.</div>","</div>","<div class=\"to-safe-trade-rb-wrapper\">","<div class=\"to-safe-trade-rb-top\"><div></div></div>","<div class=\"to-safe-trade-rb-body\">","<div class=\"to-safe-trade-number-title\"><img src=\""+SwitchGames.imageUrl+"common/numbers/number-green-1.png\" align=\"absmiddle\" style=\"margin-top:-5px;\"/>&nbsp;Choose Payment Method<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" style=\"margin: -5px 5px 0px;\" align=\"absmiddle\"></div>","<!-- start radio buttons -->","<ul class=\"no-list-style to-safe-trade-medium-text-ul\" style=\"margin:10px 0px 0px 5px!important;\">","<li><input {[5.95 > parseFloat(values.balance) ? \"DISABLED\" : \"CHECKED\"]} id=\"st-payment-use-credit\" type=\"radio\" name=\"paymentType\"/><span style=\"color: {[5.95 > parseFloat(values.balance) ? \"#777777\" : \"#FFFFFF\"]};\">&nbsp;Use my SwitchGames account (${balance} avail.)</span></li>","<li><input {[values.stored_cc_last4 != null ? \"CHECKED\" : \"DISABLED\"]} id=\"st-payment-use-existing\" type=\"radio\" name=\"paymentType\"/><span style=\"color: {[values.stored_cc_last4 == null ? \"#777777\" : \"#FFFFFF\"]};\">&nbsp;Use my Credit Card on file {[values.stored_cc_last4 == null ? \"\" : \"(ends in \" + values.stored_cc_last4 + \")\"]}</span></li>","<li><input id=\"st-payment-enter-new\" type=\"radio\" name=\"paymentType\"/>&nbsp;Enter new billing information</li>","</ul>","<!-- end radio buttons -->","</div>","<div class=\"to-safe-trade-rb-bottom\"><div></div></div>","</div>","<div class=\"to-safe-trade-rb-wrapper\">","<div class=\"to-safe-trade-rb-top\"><div></div></div>","<div class=\"to-safe-trade-rb-body\">","<div class=\"to-safe-trade-number-title\"><img src=\""+SwitchGames.imageUrl+"common/numbers/number-green-2.png\" align=\"absmiddle\" style=\"margin-top:-5px;\"/>&nbsp;Password Confirmation<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" style=\"margin: -5px 5px 0px;\" align=\"absmiddle\"></div>","<div style=\"margin:10px 0px 0px 5px;color:#ccc;\">SwitchGames Password:&nbsp;<input id=\"st-password\" class=\"input-text-wh\" type=\"password\" size=\"15\"/></div>","</div>","<div class=\"to-safe-trade-rb-bottom\"><div></div></div>","</div>","<div style=\"text-align:center;\">","<!-- error message -->","<div id=\"safetrade-account-error\" class=\"to-safe-trade-error-text\" style=\"margin-top:15px;\"></div>","<!-- ajax form processing image -->","<div id=\"st-account-processing\" style=\"visibility: hidden;\" class=\"to-safe-trade-processing-text\" style=\"margin:15px 0px 10px 0px;\"><img src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" align=\"absmiddle\"/>&nbsp;&nbsp;Processing...</div>","</div>","<div style=\"text-align:center;\">","<table width=\"10\" border=\"0\" cellspacing=\"0\" align=\"center\">","<tr>","<td></td>","<td colspan=\"3\">","<table border=\"0\" cellspacing=\"0\">","<tr>","<td>","<script src=\"https://siteseal.thawte.com/cgi/server/thawte_seal_generator.exe\"></script>","</td>","</tr>","<tr>","<td>","<a href=\"https://sealinfo.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&dn=WWW.SWITCHGAMES.COM&lang=en\" target=\"_blank\"><img src=\""+SwitchGames.imageUrl+"common/buttons/thawte_stamp.gif\" border=\"0\"/></a>","</td>","</tr>","</table>","</td>","</tr>","</table>","</div>");
SwitchGames.TradeOffer.safeTradeOfferPanel2Template=new Ext.XTemplate("<div style=\"text-align:center;\">","<div class=\"to-safe-trade-large-text\" style=\"margin-top:7px;\">Authorize <img src=\""+SwitchGames.imageUrl+"trade_offer/logo-safetrade-medium.png\" align=\"absmiddle\" style=\"margin-top:-7px;\"/> Charge</div>","</div>","<div style=\"text-align:center;\">","<div class=\"to-safe-trade-large1-text\">You will <strong><u>ONLY</u></strong> be charged $5.95 if offer is accepted.</div>","</div>","<div class=\"to-safe-trade-rb-wrapper\">","<div class=\"to-safe-trade-rb-top\"><div></div></div>","<div class=\"to-safe-trade-rb-body\">","<table class=\"table-form\" style=\"margin-top:10px;\">","<tr>","<td style=\"padding-top: 0px; padding-bottom: 10px;\" colspan=\"4\">","<div class=\"usps-font-blue-small\" style=\"margin-top:10px;\">Payment Method<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 5px;\"/><a href=\"https://sealinfo.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&dn=WWW.SWITCHGAMES.COM&lang=en\" target=\"_blank\"><img src=\""+SwitchGames.imageUrl+"common/icons/icon-thawte.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 0px;\"/></a><span id=\"usps-cc-error-msg\" class=\"usps-error-text\"></span></div>","</td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">payment method</label>","</td>","<td>","<select id=\"safetrade-cc-type\">","<option></option>","<option value=\"visa\">Visa</option>","<option value=\"mastercard\">MasterCard</option>","<option value=\"discover\">Discover</option>","<option value=\"amex\">American Express</option>","</select>","</td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" valign=\"top\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">card number</label>","</td>","<td><input id=\"safetrade-cc-number\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">cid</label>","</td>","<td><input id=\"safetrade-cc-cid\" class=\"input-text-wh\" type=\"text\" size=\"4\"/></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" valign=\"top\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">expiration</label>","</td>","<td>","<select id=\"safetrade-cc-expiry-month\">","<option></option>","<option value=\"01\">01</option>","<option value=\"02\">02</option>","<option value=\"03\">03</option>","<option value=\"04\">04</option>","<option value=\"05\">05</option>","<option value=\"06\">06</option>","<option value=\"07\">07</option>","<option value=\"08\">08</option>","<option value=\"09\">09</option>","<option value=\"10\">10</option>","<option value=\"11\">11</option>","<option value=\"12\">12</option>","</select> "," <select id=\"safetrade-cc-expiry-year\">","<option></option>","<option value=\"10\">2010</option>","<option value=\"11\">2011</option>","<option value=\"12\">2012</option>","<option value=\"13\">2013</option>","<option value=\"14\">2014</option>","<option value=\"15\">2015</option>","<option value=\"16\">2016</option>","<option value=\"17\">2017</option>","<option value=\"18\">2018</option>","<option value=\"19\">2019</option>","<option value=\"20\">2020</option>","<option value=\"21\">2021</option>","</select>","</td>","<td></td>","</tr>","<tr>","<td colspan=\"4\" style=\"height:15px;\"></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">first name</label>","</td>","<td><input id=\"safetrade-cc-firstname\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">last name</label>","</td>","<td><input id=\"safetrade-cc-lastname\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">address</label>","</td>","<td colspan=\"3\"><input id=\"safetrade-cc-address1\" class=\"input-text-wh\" type=\"text\" size=\"40\"/></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">suite/apartment</label>","</td>","<td><input id=\"safetrade-cc-address2\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">city</label>","</td>","<td><input id=\"safetrade-cc-city\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">state</label>","</td>","<td>","<select id=\"safetrade-cc-state\">","<option></option>","<option value=\"AK\">AK</option>","<option value=\"AL\">AL</option>","<option value=\"AR\">AR</option>","<option value=\"AZ\">AZ</option>","<option value=\"CA\">CA</option>","<option value=\"CO\">CO</option>","<option value=\"CT\">CT</option>","<option value=\"DC\">DC</option>","<option value=\"DE\">DE</option>","<option value=\"FL\">FL</option>","<option value=\"GA\">GA</option>","<option value=\"HI\">HI</option>","<option value=\"IA\">IA</option>","<option value=\"ID\">ID</option>","<option value=\"IL\">IL</option>","<option value=\"IN\">IN</option>","<option value=\"KS\">KS</option>","<option value=\"KY\">KY</option>","<option value=\"LA\">LA</option>","<option value=\"MA\">MA</option>","<option value=\"MD\">MD</option>","<option value=\"ME\">ME</option>","<option value=\"MI\">MI</option>","<option value=\"MN\">MN</option>","<option value=\"MO\">MO</option>","<option value=\"MS\">MS</option>","<option value=\"MT\">MT</option>","<option value=\"NC\">NC</option>","<option value=\"ND\">ND</option>","<option value=\"NE\">NE</option>","<option value=\"NH\">NH</option>","<option value=\"NJ\">NJ</option>","<option value=\"NM\">NM</option>","<option value=\"NV\">NV</option>","<option value=\"NY\">NY</option>","<option value=\"OH\">OH</option>","<option value=\"OK\">OK</option>","<option value=\"OR\">OR</option>","<option value=\"PA\">PA</option>","<option value=\"RI\">RI</option>","<option value=\"SC\">SC</option>","<option value=\"SD\">SD</option>","<option value=\"TN\">TN</option>","<option value=\"TX\">TX</option>","<option value=\"UT\">UT</option>","<option value=\"VA\">VA</option>","<option value=\"VT\">VT</option>","<option value=\"WA\">WA</option>","<option value=\"WI\">WI</option>","<option value=\"WV\">WV</option>","<option value=\"WY\">WY</option>","</select>","</td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">zip</label>","</td>","<td><input id=\"safetrade-cc-zip\" class=\"input-text-wh\" type=\"text\" maxlength=\"10\" size=\"10\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">country</label>","</td>","<td>","<select>","<option>USA</option>","</select>","</td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">phone number</label>","</td>","<td colspan=\"3\"><input id=\"safetrade-cc-phone1\" class=\"input-text-wh\" type=\"text\" maxlength=\"3\" size=\"3\"/>-<input id=\"safetrade-cc-phone2\" class=\"input-text-wh\" type=\"text\" maxlength=\"3\" size=\"3\"/>-<input id=\"safetrade-cc-phone3\" class=\"input-text-wh\" type=\"text\" maxlength=\"4\" size=\"4\"/></td>","</tr>","<tr>","<td style=\"padding-top: 10px;\" colspan=\"4\"><input id=\"safetrade-cc-save\" type=\"checkbox\"/><label>&nbsp;Save this information for one-click purchases on SwitchGames</label></td>","</tr>","</table>","</div>","<div class=\"to-safe-trade-rb-bottom\"><div></div></div>","</div>","<div style=\"text-align:center;\">","<!-- error message -->","<div id=\"safetrade-cc-error\" class=\"to-safe-trade-error-text\" style=\"margin-top:15px;\"></div>","<!-- ajax form processing image -->","<div id=\"st-cc-processing\" class=\"to-safe-trade-processing-text\" style=\"margin:15px 0px 10px 0px; visibility: hidden;\"><img src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" align=\"absmiddle\"/>&nbsp;&nbsp;Processing...</div>","</div>");
SwitchGames.TradeOffer.safeTradeOfferPanel3Template=new Ext.XTemplate("<div style=\"text-align:center; height: 45px;\">","<div class=\"to-safe-trade-large-text\" style=\"margin-top:7px;\">Protected By <img src=\""+SwitchGames.imageUrl+"trade_offer/logo-safetrade-medium.png\" align=\"absmiddle\" style=\"margin-top:-7px;\"/></div>","</div>","<div class=\"to-dialog-offering-top-wrapper\">","<div class=\"rb-box-dg\">","<div class=\"rb-box-dg-top\"><div></div></div>","<div class=\"rb-box-dg-content sg-dg-watermark\">","<div class=\"to-dialog-top-inner-wrapper\" style=\"height: 160px;\">","<div class=\"to-dialog-top-inner-wrapper-left\">","<div class=\"to-dialog-user-header-making-offer\">Making an offer to:</div>","<img class=\"\" src=\"{[SwitchGames.Utility.getAvatarValue(values.avatar)]}\" />","<div class=\"to-dialog-user-name\">{screen_name}</div>","</div>","<div class=\"to-dialog-top-inner-wrapper-right\">","<div class=\"to-dialog-user-header-for-item\">For this item:</div>","<img class=\"\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\" />","<div class=\"to-dialog-product-name\">{name}</div>","</div>","</div>","</div>","<div class=\"rb-box-dg-bottom\"><div></div></div>","</div>","</div>","<div class=\"to-dialog-offering-middle-wrapper\">","<div class=\"to-dialog-middle-inner-left\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\" style=\"text-align: center;\">Your Stuff</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\" style=\"height: 200px;\">","<img style=\"visibility: hidden\" class=\"to-scroll-box-btn-up\" src=\""+SwitchGames.imageUrl+"trade_offer/to-sm-btn-up.png\" height=\"20\" width=\"20\" alt=\"scroll up button\"/>","<div id=\"st-drag-container\" name=\"drop-element\" class=\"to-scroll-box-wrapper\">","<tpl for=\"mystuff\">","<div name=\"drag-element\" itemid=\"{id}\" class=\"to-scroll-box-item-wrapper\">","<div class=\"to-scroll-box-item-body\">","<div class=\"to-scroll-box-item-body-inner\">","{[SwitchGames.TradeOffer.getItemMarkup(values)]}","</div>","</div>","</div>","</tpl>","</div>","<img {[SwitchGames.Utility.getDownArrowVisibility(values.mystuff.length)]} class=\"to-scroll-box-btn-down\" src=\""+SwitchGames.imageUrl+"trade_offer/to-sm-btn-down.png\" height=\"20\" width=\"20\" alt=\"scroll down button\"/>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","<img class=\"to-scroll-box-area-drag-area\" src=\""+SwitchGames.imageUrl+"trade_offer/to-drag-arrow.gif\" width=\"49\" height=\"41\" alt=\"drag arrow graphic\" />","<div class=\"to-dialog-middle-inner-right\">","<!-- What You Are Offering Box -->","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\" style=\"text-align: center;\">What You Are Offering</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\" style=\"height: 200px;\">","<img style=\"visibility: hidden\" class=\"to-scroll-box-btn-up\" src=\""+SwitchGames.imageUrl+"trade_offer/to-sm-btn-up.png\" height=\"20\" width=\"20\" alt=\"scroll up button\"/>","<div id=\"st-offer-container\" name=\"drop-element\" class=\"to-scroll-box-wrapper\">","</div>","<img style=\"visibility: hidden\" class=\"to-scroll-box-btn-down\" src=\""+SwitchGames.imageUrl+"trade_offer/to-sm-btn-down.png\" height=\"20\" width=\"20\" alt=\"scroll down button\"/>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","</div>","<div class=\"to-dialog-offering-bottom-wrapper\">","<div class=\"rb-box-dg\">","<div class=\"rb-box-dg-top\"><div></div></div>","<div class=\"rb-box-dg-content\" style=\"text-align: center;\">","<span>This offer will expire in: </span>","<span><select id=\"st-time-expiration\"><option value=\"1\">1 Day</option><option value=\"2\">2 Days</option><option value=\"3\">3 Days</option><option value=\"4\">4 Days</option><option value=\"5\">5 Days</option><option value=\"6\">6 Days</option><option value=\"7\" selected>7 Days</option></select></span>","</div>","<div class=\"rb-box-dg-bottom\"><div></div></div>","</div>","</div>");
SwitchGames.TradeOffer.safeTradeOfferPanel4Template=new Ext.XTemplate("<div style=\"margin-top:25px; margin-bottom: 30px; font-size: 34px; text-align: center;\">96% of members prefer trading with Verified Members</div>","<div class=\"verify-title\" style=\"overflow: hidden; zoom: 1 !important; font-weight: bold; font-size: 30px;\"><img src=\""+SwitchGames.imageUrl+"common/badges/badge-verified-large.png\" align=\"absmiddle\"/>&nbsp;Get The Badge Instantly!</div>","<ul class=\"no-list-style\" style=\"margin:20px 0px 0px 0px!important;\">","<li class=\"nl-1\">Credit card required for verification</li>","<li class=\"nl-2\">Your mailing address must match billing info</li>","<li class=\"nl-3\">$4.95 processing fee applies</li>","<li class=\"nl-4\">Immediately earn more trust from others</li>","</ul>","<div style=\"text-align:center;margin-top:25px;\">","<img src=\""+SwitchGames.imageUrl+"common/buttons/btn-verify.png\" style=\"cursor:pointer;\" onclick=\"SwitchGames.Account.VerifyMember(SwitchGames.TradeOffer.safeTradeVerifiedDialogCallback);\" />","</div>","<div style=\"text-align:center;margin-top:25px; font-size: 18px;\">(You <span style=\"font-weight: bold;\">will not</span> lose your place in this trade offer)</div>");
SwitchGames.TradeOffer.safeTradeOfferPanel5Template=new Ext.XTemplate("<div style=\"text-align:center; height: 45px;\">","<div class=\"to-safe-trade-large-text\" style=\"margin-top:7px;\">Protected By <img src=\""+SwitchGames.imageUrl+"trade_offer/logo-safetrade-medium.png\" align=\"absmiddle\" style=\"margin-top:-7px;\"/></div>","</div>","<div class=\"to-review-trade-offer-center-col\">","<div id=\"st-dialog-panel2-body\" class=\"to-dialog-offering-bottom-wrapper\">","<div class=\"rb-box-dg\">","<div class=\"rb-box-dg-top\"><div></div></div>","<div class=\"rb-box-dg-content\" style=\"text-align: center;\">","<span class=\"to-header-top\">Review this SafeTrade offer</span>","</div>","<div class=\"rb-box-dg-bottom\"><div></div></div>","</div>","</div>","<div class=\"to-dialog-offering-top-wrapper\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\">Issuing offer to:</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\">","<div class=\"to-wrapper\">","<div class=\"to-avatar \">","<img src=\"{[SwitchGames.Utility.getAvatarValue(values.avatar)]}\" alt=\"avatar image\" width=\"60\" height=\"59\" />","</div>","<div class=\"to-ratings-wrapper\">","<div class=\"to-ratings\">","<span class=\"to-ratings-plus\">+{ratings_positive}</span>","<span class=\"to-ratings-minus\">-{ratings_negative}</span>","</div>","<div  class=\"to-user-name\">","{screen_name}","</div>","</div>","<div  class=\"to-badges-wraper\">","<div class=\"to-badge-tenure-{tenure_badge}\" {[SwitchGames.Utility.getTenureTooltip(values.tenure_badge)]}></div>","<div class=\"to-badge-transactions-{transaction_badge}\" {[SwitchGames.Utility.getTransactionTooltip(values.transaction_badge)]}></div>","<div class=\"to-badge-philanthropy-{philanthropy_badge}\" {[SwitchGames.Utility.getPhilanthropyTooltip(values.philanthropy_badge)]}></div>","<br/>","<div class=\"to-badge-rating-{ratings_star_badge}\" {[SwitchGames.Utility.getRatingsStarTooltip(values.ratings_star_badge)]}></div>","<div class=\"to-badge-plus-member-{plus_badge}\" {[SwitchGames.Utility.getPlusTooltip(values.plus_badge)]}></div>","<div class=\"to-badge-verified-{verified_badge}\" name=\"verified-badge\" verified=\"{verified_badge}\" memberVerified=\"{member_verified}\"></div>","</div>","</div>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","<div class=\"to-dialog-offering-middle-wrapper\">","<div class=\"to-dialog-middle-inner-left\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\">Your Stuff:</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\" style=\"height: 200px;\">","<img {[SwitchGames.Utility.getDownArrowVisibility(0)]} class=\"to-scroll-box-btn-up\" src=\""+SwitchGames.imageUrl+"trade_offer/to-sm-btn-up.png\" height=\"20\" width=\"20\" alt=\"scroll up button\"/>","<div id=\"st-review-container\" class=\"to-scroll-box-wrapper\">","</div>","<img {[SwitchGames.Utility.getDownArrowVisibility(0)]} class=\"to-scroll-box-btn-down\" src=\""+SwitchGames.imageUrl+"trade_offer/to-sm-btn-down.png\" height=\"20\" width=\"20\" alt=\"scroll down button\"/>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","<div class=\"to-dialog-middle-inner-right\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\" >For:</div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\" style=\"height: 200px; text-align: center;\">","<img class=\"to-dialog-for-game-box\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\" height=\"110\" width=\"95\" alt=\"Game Cover Devil May Cry\" />","<div class=\"to-dialog-for-game-description\">","<div class=\"to-dialog-for-game-title\">{name}</div>","<div class=\"to-dialog-for-game-platform\">{platform_name}</div>","</div>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","</div>","</div>","<div style=\"text-align:center;\">","<!-- error message -->","<div id=\"safetrade-account-error\" class=\"to-safe-trade-error-text\" style=\"margin-top:15px;\"></div>","<!-- ajax form processing image -->","<div id=\"st-review-processing\" style=\"visibility: hidden;\" class=\"to-safe-trade-processing-text\" style=\"margin:15px 0px 10px 0px;\"><img src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" align=\"absmiddle\"/>&nbsp;&nbsp;Processing...</div>","</div>");
SwitchGames.TradeOffer.safeTradeOfferPanel6Template=new Ext.XTemplate("<div class=\"rb-box-dg\">","<div class=\"rb-box-dg-top\"><div></div></div>","<div class=\"rb-box-dg-content\" style=\"text-align: center;\">","<span class=\"to-header-top\">trade offer sent!</span>","</div>","<div class=\"rb-box-dg-bottom\"><div></div></div>","</div>","<div class=\"to-banner-ad-wrapper\">","<div id=\"st-ad-banner\" class=\"to-banner-ad-300x250-show\">","</div>","</div>");
SwitchGames.TradeOffer.upClickRepeaters=[];
SwitchGames.TradeOffer.downClickRepeaters=[];
SwitchGames.TradeOffer.safeTradeVerifiedDialogCallback=function(_6cd){
if(_6cd==true){
SwitchGames.TradeOffer.verifiedMembershipComplete=1;
SwitchGames.Utility.updateVerifiedMemberElements();
SwitchGames.TradeOffer.safeTradePanel.scroll("right","st-review");
}
};
Ext.namespace("SwitchGames.TradeOffer.SafeTrade");
SwitchGames.TradeOffer.SafeTrade.ccFieldList=[{name:"credit card type",paramName:"card_type",id:"safetrade-cc-type",type:"combo",validationFn:SwitchGames.Validation.ccTypeValidation,validated:false,value:"",valueType:null},{name:"credit card number",paramName:"card_number",id:"safetrade-cc-number",type:"text",validationFn:SwitchGames.Validation.ccNumberValidation,validated:false,value:"",valueType:null,refField:"safetrade-cc-type"},{name:"CID",paramName:"card_cvv2",id:"safetrade-cc-cid",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"cid"},{name:"expiry month",paramName:null,id:"safetrade-cc-expiry-month",type:"combo",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"expiry year",paramName:null,id:"safetrade-cc-expiry-year",type:"combo",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"first name",paramName:"firstname",id:"safetrade-cc-firstname",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"last name",paramName:"lastname",id:"safetrade-cc-lastname",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"address",paramName:"address1",id:"safetrade-cc-address1",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"address",paramName:"address2",id:"safetrade-cc-address2",type:"text",validationFn:null,validated:true,value:"",valueType:null},{name:"city",paramName:"city",id:"safetrade-cc-city",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"state",paramName:"state",id:"safetrade-cc-state",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"zip code",paramName:"zip",id:"safetrade-cc-zip",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"zip"},{name:"area code",paramName:null,id:"safetrade-cc-phone1",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"areacode"},{name:"phone number",paramName:null,id:"safetrade-cc-phone2",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"prefix"},{name:"phone number",paramName:null,id:"safetrade-cc-phone3",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"suffix"},{name:"save",paramName:null,id:"safetrade-cc-save",type:"text",validationFn:null,validated:true,value:"",valueType:null}];
SwitchGames.TradeOffer.SafeTrade.ccFormSetup=false;
SwitchGames.TradeOffer.ccFieldValidationCallback=function(_6ce){
var _6cf=Ext.get("safetrade-cc-error");
if(_6ce==true){
_6cf.update("");
}else{
_6cf.update(_6ce);
}
};
SwitchGames.TradeOffer.ccFormValidationCallback=function(_6d0){
if(_6d0==true){
SwitchGames.TradeOffer.safeTradePanel.enableRightSlide();
}else{
SwitchGames.TradeOffer.safeTradePanel.disableRightSlide();
}
};
SwitchGames.TradeOffer.getOfferItemCount=function(el){
var _6d2=Ext.get(el);
var _6d3=_6d2.query("[@name=\"drag-element\"]");
return (_6d3.length);
};
SwitchGames.TradeOffer.safeTradeDropNotification=function(){
var _6d4=SwitchGames.TradeOffer.getOfferItemCount("st-offer-container");
if(_6d4==0){
SwitchGames.TradeOffer.safeTradePanel.disableRightSlide();
}else{
SwitchGames.TradeOffer.safeTradePanel.enableRightSlide();
}
};
SwitchGames.TradeOffer.safeTrade=function(_6d5,_6d6,_6d7,_6d8){
var _6d8=_6d8||false;
var _6d7=_6d7||null;
SwitchGames.TradeOffer.switchBot=_6d7;
SwitchGames.TradeOffer.listingId=_6d5;
SwitchGames.TradeOffer.yourListingId=_6d6;
SwitchGames.TradeOffer.stSuccess=false;
SwitchGames.TradeOffer.safeTradePassword="";
SwitchGames.TradeOffer.passwordValidated=false;
delete SwitchGames.TradeOffer.SafeTrade.useExisting;
delete SwitchGames.TradeOffer.SafeTrade.enterNew;
delete SwitchGames.TradeOffer.SafeTrade.useCredit;
if(SwitchGames.TradeOffer.safeTradeOfferDialog==null){
SwitchGames.TradeOffer.safeTradeOfferDialog=SwitchGames.Dialogs.createDialog("","safetrade-offer-dlg","SafeTrade Offer",600,520,"sg-window");
SwitchGames.TradeOffer.safeTradeOfferDialog.body.on("click",function(){
SwitchGames.TradeOffer.safeTradePanel.scroll("right");
},this,{delegate:"img[@name=\"safetrade-insurance-btn\"]"});
SwitchGames.TradeOffer.safeTradeOfferDialog.body.on("click",function(){
SwitchGames.TradeOffer.safeTradeOfferDialog.hide();
if(SwitchGames.TradeOffer.switchBot!=null){
SwitchGames.TradeOffer.switchbotTrade(SwitchGames.TradeOffer.listingId,SwitchGames.TradeOffer.yourListingId);
}else{
SwitchGames.TradeOffer.trade(SwitchGames.TradeOffer.listingId);
}
},this,{delegate:"img[@name=\"no-safetrade-insurance-btn\"]"});
SwitchGames.TradeOffer.safeTradeOfferDialog.body.on("keydown",function(e,t){
var _6db=Ext.fly(t).getValue();
SwitchGames.TradeOffer.passwordValidated=false;
if(_6db.length>2){
SwitchGames.TradeOffer.safeTradePanel.enableRightSlide();
}else{
SwitchGames.TradeOffer.safeTradePanel.disableRightSlide();
}
},this,{delegate:"input#st-password"});
}
var _6dc;
var url;
if(_6d7!=null){
url="data/switch_center/trade_offer_request.php";
_6dc={pane:"switchbot_safetrade",their_listing_id:_6d5,your_listing_id:_6d6};
}else{
url="data/switch_center/trade_offer_request.php";
_6dc={usehttps:"1",pane:"safetrade",listing_id:_6d5};
}
SwitchGames.Utility.sendSecureRequest(url,_6dc,function(_6de){
var i,j,_6e1,_6e2;
SwitchGames.TradeOffer.listingInfo=Ext.util.JSON.decode(_6de.responseText);
if(SwitchGames.TradeOffer.listingInfo.error!=undefined){
SwitchGames.Dialogs.showErrorDialog(SwitchGames.TradeOffer.listingInfo.error);
return;
}else{
SwitchGames.TradeOffer.verifiedMember=SwitchGames.TradeOffer.listingInfo.member_verified;
SwitchGames.TradeOffer.verifiedMembershipComplete=SwitchGames.TradeOffer.listingInfo.member_verified;
SwitchGames.Utility.removeVerifiedTooltips(SwitchGames.TradeOffer);
SwitchGames.TradeOffer.reviewInfo=SwitchGames.Utility.deepCopy(SwitchGames.TradeOffer.listingInfo);
delete SwitchGames.TradeOffer.reviewInfo.mystuff;
SwitchGames.TradeOffer.reviewInfo.buyer_listing_ids="";
var _6e3=SwitchGames.TradeOffer.safeTradeOfferPanel0Template.apply({});
var _6e4=SwitchGames.TradeOffer.safeTradeOfferPanel1Template.apply(SwitchGames.TradeOffer.listingInfo);
var _6e5=SwitchGames.TradeOffer.safeTradeOfferPanel2Template.apply({});
var _6e6=SwitchGames.TradeOffer.safeTradeOfferPanel3Template.apply(SwitchGames.TradeOffer.listingInfo);
var _6e7=SwitchGames.TradeOffer.safeTradeOfferPanel4Template.apply({});
var _6e8=SwitchGames.TradeOffer.safeTradeOfferPanel5Template.apply(SwitchGames.TradeOffer.reviewInfo);
var _6e9=SwitchGames.TradeOffer.safeTradeOfferPanel6Template.apply({});
var _6ea=[{autoHeight:true,html:_6e3,id:"st-title",listeners:{"beforeslidein":function(_6eb,item,_6ed){
_6eb.hideRightSlide();
}}},{autoHeight:true,html:_6e4,id:"st-payment-type",leftSlideText:"PREV",rightSlideText:"NEXT",listeners:{"afterslidein":function(_6ee,item,_6f0){
if(SwitchGames.TradeOffer.SafeTrade.useExisting==undefined){
if(SwitchGames.TradeOffer.listingInfo.balance>=5.95){
Ext.get("st-payment-use-existing").dom.checked=false;
Ext.get("st-payment-enter-new").dom.checked=false;
Ext.get("st-payment-use-credit").dom.checked=true;
SwitchGames.TradeOffer.SafeTrade.useExisting=false;
SwitchGames.TradeOffer.SafeTrade.enterNew=false;
SwitchGames.TradeOffer.SafeTrade.useCredit=true;
}else{
if(SwitchGames.TradeOffer.listingInfo.stored_cc_last4!=null){
Ext.get("st-payment-use-existing").dom.checked=true;
Ext.get("st-payment-enter-new").dom.checked=false;
Ext.get("st-payment-use-credit").dom.checked=false;
SwitchGames.TradeOffer.SafeTrade.useExisting=true;
SwitchGames.TradeOffer.SafeTrade.enterNew=false;
SwitchGames.TradeOffer.SafeTrade.useCredit=false;
}else{
Ext.get("st-payment-use-existing").dom.checked=false;
Ext.get("st-payment-enter-new").dom.checked=true;
Ext.get("st-payment-use-credit").dom.checked=false;
SwitchGames.TradeOffer.SafeTrade.useExisting=false;
SwitchGames.TradeOffer.SafeTrade.enterNew=true;
SwitchGames.TradeOffer.SafeTrade.useCredit=false;
}
}
}else{
Ext.get("st-payment-use-existing").dom.checked=SwitchGames.TradeOffer.SafeTrade.useExisting;
Ext.get("st-payment-enter-new").dom.checked=SwitchGames.TradeOffer.SafeTrade.enterNew;
Ext.get("st-payment-use-credit").dom.checked=SwitchGames.TradeOffer.SafeTrade.useCredit;
}
var _6f1=Ext.get("st-password").getValue();
if(_6f1.length<3||SwitchGames.TradeOffer.passwordValidated==false){
SwitchGames.TradeOffer.safeTradePanel.disableRightSlide();
}else{
SwitchGames.TradeOffer.safeTradePanel.enableRightSlide();
}
},"beforeslideout":function(_6f2,item,_6f4){
if(_6f4.direction==="right"){
SwitchGames.TradeOffer.safeTradeOfferDialog.setHeight(600);
var _6f5=Ext.get("st-password").getValue();
SwitchGames.TradeOffer.SafeTrade.useExisting=Ext.get("st-payment-use-existing").dom.checked;
SwitchGames.TradeOffer.SafeTrade.enterNew=Ext.get("st-payment-enter-new").dom.checked;
SwitchGames.TradeOffer.SafeTrade.useCredit=Ext.get("st-payment-use-credit").dom.checked;
var _6f6="";
if(SwitchGames.TradeOffer.SafeTrade.useExisting==true||SwitchGames.TradeOffer.SafeTrade.useCredit==true){
if(_6d7!=null){
_6f6="st-review";
}else{
_6f6="st-trade";
}
}else{
_6f6="st-cc-info";
}
if(SwitchGames.TradeOffer.passwordValidated==true){
_6f4.targetItem=_6f6;
return true;
}else{
var _6f7={usehttps:"1",pane:"check_password",password:_6f5};
var _6f8=Ext.get("st-account-processing");
_6f8.setVisible(true);
SwitchGames.Utility.sendSecureRequest("data/common/utilities.php",_6f7,function(_6f9){
_6f8.setVisible(false);
var _6fa=Ext.util.JSON.decode(_6f9.responseText);
if(_6fa.error!=undefined||_6fa.success==false){
SwitchGames.TradeOffer.passwordValidated=false;
if(_6fa.success!=null){
Ext.get("safetrade-account-error").update("Incorrect or Invalid Password");
}else{
Ext.get("safetrade-account-error").update(_6fa.error);
}
}else{
Ext.get("safetrade-account-error").update("");
SwitchGames.TradeOffer.passwordValidated=true;
SwitchGames.TradeOffer.safeTradePanel.scroll("right");
}
});
return false;
}
}
}}},{autoHeight:true,html:_6e5,id:"st-cc-info",leftSlideText:"PREV",rightSlideText:"NEXT",listeners:{"afterslidein":function(_6fb,_6fc,_6fd){
if(SwitchGames.TradeOffer.SafeTrade.ccFormSetup==true){
SwitchGames.TradeOffer.ccFormValidationCallback(SwitchGames.Utility.validateForm(SwitchGames.TradeOffer.SafeTrade.ccFieldList));
}else{
Ext.fly("safetrade-cc-firstname").dom.value=SwitchGames.TradeOffer.listingInfo.member_info.first_name||"";
Ext.fly("safetrade-cc-lastname").dom.value=SwitchGames.TradeOffer.listingInfo.member_info.last_name||"";
Ext.fly("safetrade-cc-address1").dom.value=SwitchGames.TradeOffer.listingInfo.member_info.address1||"";
Ext.fly("safetrade-cc-address2").dom.value=SwitchGames.TradeOffer.listingInfo.member_info.address2||"";
Ext.fly("safetrade-cc-city").dom.value=SwitchGames.TradeOffer.listingInfo.member_info.city||"";
Ext.fly("safetrade-cc-state").dom.value=SwitchGames.TradeOffer.listingInfo.member_info.state||"";
Ext.fly("safetrade-cc-zip").dom.value=SwitchGames.TradeOffer.listingInfo.member_info.zip||"";
if(SwitchGames.TradeOffer.listingInfo.member_info.phone==null||SwitchGames.TradeOffer.listingInfo.member_info.phone=="null"||SwitchGames.TradeOffer.listingInfo.member_info.phone==""){
Ext.fly("safetrade-cc-phone1").dom.value="";
Ext.fly("safetrade-cc-phone2").dom.value="";
Ext.fly("safetrade-cc-phone3").dom.value="";
}else{
Ext.fly("safetrade-cc-phone1").dom.value=SwitchGames.TradeOffer.listingInfo.member_info.phone.substring(0,3);
Ext.fly("safetrade-cc-phone2").dom.value=SwitchGames.TradeOffer.listingInfo.member_info.phone.substring(3,6);
Ext.fly("safetrade-cc-phone3").dom.value=SwitchGames.TradeOffer.listingInfo.member_info.phone.substring(6,10);
}
var _6fe=_6fc.getEl();
SwitchGames.Utility.setupFormValidation(SwitchGames.TradeOffer.SafeTrade.ccFieldList,_6fe,SwitchGames.TradeOffer.ccFieldValidationCallback,SwitchGames.TradeOffer.ccFormValidationCallback);
SwitchGames.TradeOffer.SafeTrade.ccFormSetup=true;
}
},"beforeslideout":function(_6ff,_700,_701){
if(_6d7!=null){
_701.targetItem="st-review";
}
}}},{autoHeight:true,html:_6e6,id:"st-trade",leftSlideText:"PREV",rightSlideText:"NEXT",listeners:{"afterslidein":function(_702){
if(_702.sgInitialized!=null){
SwitchGames.TradeOffer.safeTradeDropNotification();
}else{
_702.sgInitialized=true;
var body=_702.getEl();
SwitchGames.Utility.createVerifiedBadgeTooltips(SwitchGames.TradeOffer.safeTradeOfferDialog.body,SwitchGames.TradeOffer,"SwitchGames.TradeOffer.safeTradeVerifiedDialogCallback");
var _704=Ext.select("div[@name=\"drag-element\"]",true,body.dom);
myDragElementList=_704;
var _705=Ext.select("div[@name=\"drop-element\"]",true,body.dom);
myDropElementList=_705;
SwitchGames.SafeTradeOfferDD.removeDragTargets();
SwitchGames.SafeTradeOfferDD.removeDropTargets();
SwitchGames.SafeTradeOfferDD.addDragTargets(_704.elements);
SwitchGames.SafeTradeOfferDD.addDropTargets(_705.elements);
var i,_707;
if(SwitchGames.TradeOffer.stUpClickRepeaters!=null){
for(i=0,_707=SwitchGames.TradeOffer.stUpClickRepeaters.length;i<_707;i++){
Ext.destroy(SwitchGames.TradeOffer.stUpClickRepeaters[i]);
}
}
if(SwitchGames.TradeOffer.stDownClickRepeaters!=null){
for(i=0,_707=SwitchGames.TradeOffer.stDownClickRepeaters.length;i<_707;i++){
Ext.destroy(SwitchGames.TradeOffer.stDownClickRepeaters[i]);
}
}
SwitchGames.TradeOffer.stUpClickRepeaters=[];
SwitchGames.TradeOffer.stDownClickRepeaters=[];
var _708=Ext.select("img.to-scroll-box-btn-up",true,body.dom);
var _709;
for(i=0;i<_708.elements.length;i++){
SwitchGames.TradeOffer.stUpClickRepeaters.push(_709=new Ext.util.ClickRepeater(_708.elements[i].dom,{accelerate:false,el:_708.elements[i]}));
_709.on("click",function(e){
var upEl=Ext.get(e.el);
var _70c=upEl.next().next();
var _70d=upEl.next();
_70d.stopFx();
var _70e=_70d.scroll("up",81,{duration:0.1,callback:function(el){
if(el.dom.scrollTop==0){
upEl.setVisible(false);
}
}});
if(!_70e){
upEl.setVisible(false);
}
if(_70d.dom.scrollHeight!=_70d.dom.offsetHeight){
_70c.setVisible(true);
}
},_709,{preventDefault:true});
}
var _710=Ext.select("img.to-scroll-box-btn-down",true,body.dom);
for(i=0;i<_710.elements.length;i++){
SwitchGames.TradeOffer.stDownClickRepeaters.push(_709=new Ext.util.ClickRepeater(_710.elements[i].dom,{accelerate:false,el:_710.elements[i]}));
_709.on("click",function(e){
var _712=Ext.get(e.el);
var upEl=_712.prev().prev();
var _714=_712.prev();
_714.stopFx();
var _715=_714.scroll("down",81,{duration:0.1,callback:function(el){
if(el.dom.scrollTop+el.dom.offsetHeight>=el.dom.scrollHeight){
_712.setVisible(false);
}
}});
_712.setVisible(_715);
if(_714.dom.scrollHeight!=_714.dom.offsetHeight){
upEl.setVisible(true);
}
},_709,{preventDefault:true});
}
SwitchGames.TradeOffer.safeTradeDropNotification();
}
},"beforeslideout":function(_717,item,_719){
if(_719.direction==="right"){
if(SwitchGames.TradeOffer.verifiedMember==1||SwitchGames.TradeOffer.verifiedMembershipComplete==1){
_719.targetItem="st-review";
}
var _71a=Ext.get("st-offer-container");
var _71b=_71a.query("[@name=\"drag-element\"]");
var _71c=SwitchGames.TradeOffer.getOfferItemCount("st-offer-container");
if(_71c!=0){
var _71d=Ext.get("st-review-container");
_71d.update("");
Ext.DomHelper.useDom=true;
SwitchGames.TradeOffer.reviewInfo.mystuff="";
var _71e=[];
for(var i=0;i<_71b.length;i++){
_71e.push(_71b[i].getAttribute("itemid"));
var _720=_71b[i].cloneNode(true);
_71d.dom.appendChild(_720);
}
SwitchGames.TradeOffer.reviewInfo.buyer_listing_ids=_71e.join(",");
if(_71b.length>2){
_71d.prev().setVisible(true);
}
}else{
SwitchGames.Dialogs.showErrorDialog("Drag some items into the offer");
return (false);
}
}else{
var _721="";
if(SwitchGames.TradeOffer.SafeTrade.useExisting==true){
_719.targetItem="st-payment-type";
}else{
_719.targetItem="st-cc-info";
}
}
}}},{autoHeight:true,html:_6e7,id:"st-verified",leftSlideText:"PREV",rightSlideText:"SKIP"},{autoHeight:true,html:_6e8,id:"st-review",leftSlideText:"PREV",rightSlideText:"FINISH",stSuccess:false,listeners:{"beforeslidein":function(_722,item,_724){
if(_6d7!=null){
var _725=Ext.get("st-drag-container");
var _726=_725.query("[@name=\"drag-element\"]");
var _727=SwitchGames.TradeOffer.getOfferItemCount("st-drag-container");
if(_727!=0){
var _728=Ext.get("st-review-container");
_728.update("");
Ext.DomHelper.useDom=true;
SwitchGames.TradeOffer.reviewInfo.mystuff="";
var _729=[];
for(var i=0;i<_726.length;i++){
_729.push(_726[i].getAttribute("itemid"));
var _72b=_726[i].cloneNode(true);
_728.dom.appendChild(_72b);
}
SwitchGames.TradeOffer.reviewInfo.buyer_listing_ids=_729.join(",");
if(_726.length>2){
_728.prev().setVisible(true);
}
}
}
},"beforeslideout":function(_72c,item,_72e){
if(SwitchGames.TradeOffer.stSuccess==true){
return;
}
if(_72e.direction==="left"){
if(SwitchGames.TradeOffer.verifiedMember==1||SwitchGames.TradeOffer.verifiedMembershipComplete==1){
if(_6d7!=null){
if(SwitchGames.TradeOffer.SafeTrade.useExisting==true||SwitchGames.TradeOffer.SafeTrade.useCredit==true){
_72e.targetItem="st-payment-type";
}else{
_72e.targetItem="st-cc-info";
}
}else{
_72e.targetItem="st-trade";
}
}
}else{
var _72f={};
_72f.buyer_member_id=SwitchGames.TradeOffer.reviewInfo.your_member_id;
_72f.seller_member_id=SwitchGames.TradeOffer.reviewInfo.member_id;
_72f.seller_listing_id=SwitchGames.TradeOffer.reviewInfo.listing_id;
_72f.buyer_listing_ids=SwitchGames.TradeOffer.reviewInfo.buyer_listing_ids;
_72f.expiry=Ext.fly("st-time-expiration").dom.value;
_72f.oneClickPassword=Ext.get("st-password").getValue();
if(SwitchGames.TradeOffer.SafeTrade.useCredit==true){
_72f.method="credit";
}else{
if(SwitchGames.TradeOffer.SafeTrade.useExisting==true){
_72f.oneClickPaymentType="cc";
_72f.method="existing";
}else{
_72f.method="new";
for(var i=0,_731=SwitchGames.TradeOffer.SafeTrade.ccFieldList.length;i<_731;i++){
var _732=SwitchGames.TradeOffer.SafeTrade.ccFieldList[i];
if(_732.paramName!=null){
_72f[_732.paramName]=Ext.fly(_732.id).getValue();
}
}
_72f.phone=Ext.fly("safetrade-cc-phone1").getValue()+Ext.fly("safetrade-cc-phone2").getValue()+Ext.fly("safetrade-cc-phone3").getValue();
_72f.card_expiry=Ext.fly("safetrade-cc-expiry-month").getValue()+Ext.fly("safetrade-cc-expiry-year").getValue();
if(Ext.fly("safetrade-cc-save").dom.checked){
_72f.oneClickSaveInfo=1;
}
}
}
_72f.pane="add_deal";
_72f.type="safetrade";
var _733=Ext.get("st-review-processing");
_733.setVisible(true);
SwitchGames.Utility.sendSecureRequest("data/switch_center/live_transactions.php",_72f,function(_734){
var ret=Ext.util.JSON.decode(_734.responseText);
if(ret.error!=undefined){
SwitchGames.Dialogs.showErrorDialog(ret.error);
SwitchGames.TradeOffer.safeTradePanel.enableRightSlide();
SwitchGames.TradeOffer.safeTradePanel.enableLeftSlide();
_733.setVisible(false);
return;
}else{
SwitchGames.TradeOffer.stSuccess=true;
SwitchGames.TradeOffer.safeTradePanel.scroll("right");
_733.setVisible(false);
}
});
return (false);
}
}}},{autoHeight:true,html:_6e9,id:"st-final",listeners:{"beforeslidein":function(_736,item,_738){
_736.hideLeftSlide();
_736.hideRightSlide();
SwitchGames.Ads.AdManager.appendAd(Ext.getDom("st-ad-banner"),"transactional","tradeoffersent");
}}}];
if(SwitchGames.TradeOffer.safeTradePanel!=null){
Ext.destroy(SwitchGames.TradeOffer.safeTradePanel);
}
SwitchGames.TradeOffer.safeTradePanel=new SwitchGames.Components.SlidePanel({activeItem:0,renderTo:SwitchGames.TradeOffer.safeTradeOfferDialog.body,height:550,items:_6ea,listeners:{"afterlayout":function(_739,_73a){
},"beforedestroy":function(_73b){
if(SwitchGames.TradeOffer.stUpClickRepeaters!=null){
for(i=0,count=SwitchGames.TradeOffer.stUpClickRepeaters.length;i<count;i++){
Ext.destroy(SwitchGames.TradeOffer.stUpClickRepeaters[i]);
}
}
if(SwitchGames.TradeOffer.stDownClickRepeaters!=null){
for(i=0,count=SwitchGames.TradeOffer.stDownClickRepeaters.length;i<count;i++){
Ext.destroy(SwitchGames.TradeOffer.stDownClickRepeaters[i]);
}
}
delete SwitchGames.TradeOffer.stUpClickRepeaters;
delete SwitchGames.TradeOffer.stDownClickRepeaters;
}}});
if(_6d8!=true){
SwitchGames.TradeOffer.safeTradeOfferDialog.setHeight(600);
Ext.fly("no-safetrade-insurance-btn").setStyle("display","");
}else{
SwitchGames.TradeOffer.safeTradeOfferDialog.setHeight(520);
Ext.fly("no-safetrade-insurance-btn").setStyle("display","none");
}
var _73c=false;
SwitchGames.Utility.createVerifiedBadgeTooltips(SwitchGames.TradeOffer.safeTradeOfferDialog.body,SwitchGames.TradeOffer,"SwitchGames.TradeOffer.safeTradeVerifiedDialogCallback");
SwitchGames.TradeOffer.safeTradeOfferDialog.show();
}
},function(_73d,_73e){
SwitchGames.Dialogs.standardErrorDialog("Error connecting to web server");
});
};
});
Ext.onReady(function(){
Ext.namespace("SwitchGames","SwitchGames.LiveTransactions");
SwitchGames.SafeTradeOfferDD.init();
SwitchGames.LiveTransactions.safeTradeAcceptPanel0Template=new Ext.XTemplate("<div style=\"text-align:center;\">","<img src=\""+SwitchGames.imageUrl+"trade_offer/logo-safetrade-large.png\"/>","</div>","<div style=\"text-align:center;\">","<div class=\"to-safe-trade-large1-text\"><span class=\"to-safe-trade-brightgreen-text\">$5.95</span> Fee Required to Accept SafeTrade Offer</div>","<div class=\"to-safe-trade-small-text\">(your guaranteed safety includes a free USPS postage label)</div>","</div>","<div class=\"to-safe-trade-rb-wrapper\">","<div class=\"to-safe-trade-rb-top\"><div></div></div>","<div class=\"to-safe-trade-rb-body\">","<div class=\"to-safe-trade-number-title\"><img src=\""+SwitchGames.imageUrl+"common/numbers/number-green-1.png\" align=\"absmiddle\" style=\"margin-top:-5px;\"/>&nbsp;Choose Payment Method<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" style=\"margin: -5px 5px 0px;\" align=\"absmiddle\"></div>","<!-- start radio buttons -->","<ul class=\"no-list-style to-safe-trade-medium-text-ul\" style=\"margin:10px 0px 0px 5px!important;\">","<li><input {[5.95 > values.balance ? \"DISABLED\" : \"CHECKED\"]} id=\"ast-payment-use-credit\" type=\"radio\" name=\"paymentType\"/>&nbsp;Use my SwitchGames account (${balance} avail.)</li>","<li><input {[values.stored_cc_last4 != null ? \"CHECKED\" : \"DISABLED\"]} id=\"ast-payment-use-existing\" type=\"radio\" name=\"paymentType\"/><span style=\"color: {[values.stored_cc_last4 == null ? \"#777777\" : \"#FFFFFF\"]};\">&nbsp;Use my Credit Card on file {[values.stored_cc_last4 == null ? \"\" : \"(ends in \" + values.stored_cc_last4 + \")\"]}</span></li>","<li><input id=\"ast-payment-enter-new\" type=\"radio\" name=\"paymentType\"/>&nbsp;Enter new billing information</li>","</ul>","<!-- end radio buttons -->","</div>","<div class=\"to-safe-trade-rb-bottom\"><div></div></div>","</div>","<div class=\"to-safe-trade-rb-wrapper\">","<div class=\"to-safe-trade-rb-top\"><div></div></div>","<div class=\"to-safe-trade-rb-body\">","<div class=\"to-safe-trade-number-title\"><img src=\""+SwitchGames.imageUrl+"common/numbers/number-green-2.png\" align=\"absmiddle\" style=\"margin-top:-5px;\"/>&nbsp;Password Confirmation<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" style=\"margin: -5px 5px 0px;\" align=\"absmiddle\"></div>","<div style=\"margin:10px 0px 0px 5px;color:#ccc;\">SwitchGames Password:&nbsp;<input id=\"ast-password\" class=\"input-text-wh\" type=\"password\" size=\"15\"/></div>","</div>","<div class=\"to-safe-trade-rb-bottom\"><div></div></div>","</div>","<div style=\"text-align:center;\">","<!-- error message -->","<div id=\"ast-account-error\" class=\"to-safe-trade-error-text\" style=\"margin-top:15px;\"></div>","<!-- ajax form processing image -->","<div id=\"ast-account-processing\" style=\"visibility: hidden;\" class=\"to-safe-trade-processing-text\" style=\"margin:15px 0px 10px 0px;\"><img src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" align=\"absmiddle\"/>&nbsp;&nbsp;Processing...</div>","</div>","<div style=\"text-align:center;\">","<table width=\"10\" border=\"0\" cellspacing=\"0\" align=\"center\">","<tr>","<td>","<script src=\"https://siteseal.thawte.com/cgi/server/thawte_seal_generator.exe\"></script>","</td>","</tr>","<tr>","<td height=\"0\" align=\"center\">","<a style=\"color:#AD0034\" target=\"_new\" href=\"http://www.thawte.com/digital-certificates/\">","<span style=\"font-family:arial; font-size:8px; color:#AD0034\">ABOUT SSL CERTIFICATES</span>","</a>","</td>","</tr>","</table>","</div>");
SwitchGames.LiveTransactions.safeTradeAcceptPanel1Template=new Ext.XTemplate("<div style=\"text-align:center;\">","<div class=\"to-safe-trade-large-text\" style=\"margin-top:7px;\">Authorize <img src=\""+SwitchGames.imageUrl+"trade_offer/logo-safetrade-medium.png\" align=\"absmiddle\" style=\"margin-top:-7px;\"/> Charge</div>","</div>","<div style=\"text-align:center;\">","<div class=\"to-safe-trade-large1-text\">You will <strong><u>ONLY</u></strong> be charged $5.95 if offer is accepted.</div>","</div>","<div class=\"to-safe-trade-rb-wrapper\">","<div class=\"to-safe-trade-rb-top\"><div></div></div>","<div class=\"to-safe-trade-rb-body\">","<table class=\"table-form\" style=\"margin-top:10px;\">","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">payment method</label>","</td>","<td>","<select id=\"ast-cc-type\">","<option></option>","<option value=\"visa\">Visa</option>","<option value=\"mastercard\">MasterCard</option>","<option value=\"discover\">Discover</option>","<option value=\"amex\">American Express</option>","</select>","</td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" valign=\"top\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">card number</label>","</td>","<td><input id=\"ast-cc-number\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">cid</label>","</td>","<td><input id=\"ast-cc-cid\" class=\"input-text-wh\" type=\"text\" size=\"4\"/></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" valign=\"top\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">expiration</label>","</td>","<td>","<select id=\"ast-cc-expiry-month\">","<option></option>","<option value=\"01\">01</option>","<option value=\"02\">02</option>","<option value=\"03\">03</option>","<option value=\"04\">04</option>","<option value=\"05\">05</option>","<option value=\"06\">06</option>","<option value=\"07\">07</option>","<option value=\"08\">08</option>","<option value=\"09\">09</option>","<option value=\"10\">10</option>","<option value=\"11\">11</option>","<option value=\"12\">12</option>","</select> "," <select id=\"ast-cc-expiry-year\">","<option></option>","<option value=\"10\">2010</option>","<option value=\"11\">2011</option>","<option value=\"12\">2012</option>","<option value=\"13\">2013</option>","<option value=\"14\">2014</option>","<option value=\"15\">2015</option>","<option value=\"16\">2016</option>","<option value=\"17\">2017</option>","<option value=\"18\">2018</option>","<option value=\"19\">2019</option>","<option value=\"20\">2020</option>","<option value=\"21\">2021</option>","</select>","</td>","<td></td>","</tr>","<tr>","<td colspan=\"4\" style=\"height:15px;\"></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">first name</label>","</td>","<td><input id=\"ast-cc-firstname\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">last name</label>","</td>","<td><input id=\"ast-cc-lastname\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">address</label>","</td>","<td colspan=\"3\"><input id=\"ast-cc-address1\" class=\"input-text-wh\" type=\"text\" size=\"40\"/></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">suite/apartment</label>","</td>","<td><input id=\"ast-cc-address2\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">city</label>","</td>","<td><input id=\"ast-cc-city\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">state</label>","</td>","<td>","<select id=\"ast-cc-state\">","<option></option>","<option value=\"AK\">AK</option>","<option value=\"AL\">AL</option>","<option value=\"AR\">AR</option>","<option value=\"AZ\">AZ</option>","<option value=\"CA\">CA</option>","<option value=\"CO\">CO</option>","<option value=\"CT\">CT</option>","<option value=\"DC\">DC</option>","<option value=\"DE\">DE</option>","<option value=\"FL\">FL</option>","<option value=\"GA\">GA</option>","<option value=\"HI\">HI</option>","<option value=\"IA\">IA</option>","<option value=\"ID\">ID</option>","<option value=\"IL\">IL</option>","<option value=\"IN\">IN</option>","<option value=\"KS\">KS</option>","<option value=\"KY\">KY</option>","<option value=\"LA\">LA</option>","<option value=\"MA\">MA</option>","<option value=\"MD\">MD</option>","<option value=\"ME\">ME</option>","<option value=\"MI\">MI</option>","<option value=\"MN\">MN</option>","<option value=\"MO\">MO</option>","<option value=\"MS\">MS</option>","<option value=\"MT\">MT</option>","<option value=\"NC\">NC</option>","<option value=\"ND\">ND</option>","<option value=\"NE\">NE</option>","<option value=\"NH\">NH</option>","<option value=\"NJ\">NJ</option>","<option value=\"NM\">NM</option>","<option value=\"NV\">NV</option>","<option value=\"NY\">NY</option>","<option value=\"OH\">OH</option>","<option value=\"OK\">OK</option>","<option value=\"OR\">OR</option>","<option value=\"PA\">PA</option>","<option value=\"RI\">RI</option>","<option value=\"SC\">SC</option>","<option value=\"SD\">SD</option>","<option value=\"TN\">TN</option>","<option value=\"TX\">TX</option>","<option value=\"UT\">UT</option>","<option value=\"VA\">VA</option>","<option value=\"VT\">VT</option>","<option value=\"WA\">WA</option>","<option value=\"WI\">WI</option>","<option value=\"WV\">WV</option>","<option value=\"WY\">WY</option>","</select>","</td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">zip</label>","</td>","<td><input id=\"ast-cc-zip\" class=\"input-text-wh\" type=\"text\" maxlength=\"10\" size=\"10\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">country</label>","</td>","<td>","<select>","<option>USA</option>","</select>","</td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">phone number</label>","</td>","<td colspan=\"3\"><input id=\"ast-cc-phone1\" class=\"input-text-wh\" type=\"text\" maxlength=\"3\" size=\"3\"/>-<input id=\"ast-cc-phone2\" class=\"input-text-wh\" type=\"text\" maxlength=\"3\" size=\"3\"/>-<input id=\"ast-cc-phone3\" class=\"input-text-wh\" type=\"text\" maxlength=\"4\" size=\"4\"/></td>","</tr>","<tr>","<td style=\"padding-top: 10px;\" colspan=\"4\"><input id=\"ast-cc-save\" type=\"checkbox\"/><label>&nbsp;Save this information for one-click purchases on SwitchGames</label></td>","</tr>","</table>","</div>","<div class=\"to-safe-trade-rb-bottom\"><div></div></div>","</div>","<div style=\"text-align:center;\">","<!-- error message -->","<div id=\"ast-cc-error\" class=\"to-safe-trade-error-text\" style=\"margin-top:15px;\"></div>","<!-- ajax form processing image -->","<div id=\"ast-cc-processing\" class=\"to-safe-trade-processing-text\" style=\"margin:15px 0px 10px 0px; visibility: hidden;\"><img src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" align=\"absmiddle\"/>&nbsp;&nbsp;Processing...</div>","</div>");
SwitchGames.LiveTransactions.safeTradeAcceptPanel2Template=new Ext.XTemplate("<div style=\"text-align:center;\">","<img src=\""+SwitchGames.imageUrl+"trade_offer/logo-safetrade-underway.png\"/>","</div>","<div style=\"text-align:center;\">","<div style=\"margin-top:40px;\" class=\"to-safe-trade-large-text\">What Next?</div>","</div>","<ul class=\"no-list-style\" style=\"margin:30px 0px 0px 20px!important;\">","<li><img src=\""+SwitchGames.imageUrl+"common/numbers/number-white-1.gif\" align=\"absmiddle\"/><span class=\"to-safe-trade-large1-text\"> Print the pre-paid USPS label waiting for you</span></li>","<li><img src=\""+SwitchGames.imageUrl+"common/numbers/number-white-2.gif\" align=\"absmiddle\"/><span class=\"to-safe-trade-large1-text\"> Affix mailing label to your package</span></li>","<li><img src=\""+SwitchGames.imageUrl+"common/numbers/number-white-3.gif\" align=\"absmiddle\"/><span class=\"to-safe-trade-large1-text\"> Mail package</span></li>","<li><img src=\""+SwitchGames.imageUrl+"common/numbers/number-white-4.gif\" align=\"absmiddle\"/><span class=\"to-safe-trade-large1-text\"> Manage & track progress in Live Transactions</span></span></li>","</ul>","<div style=\"text-align:center;\">","<div class=\"to-safe-trade-large1-text to-safe-trade-brightgreen-text\" style=\"margin-top:30px;\">If you encounter ANY trouble during this SafeTrade, contact Customer Service immediately.</div>","</div>","<div style=\"text-align:center;\">","<img id=\"ast-golive-btn\" style=\"margin-top:40px;cursor:pointer;\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-gotolivetransactions.png\"/>","</div>");
SwitchGames.LiveTransactions.verifiedDialogCallback=function(_73f){
if(_73f==true){
SwitchGames.LiveTransactions.verifiedMembershipComplete=true;
leftButtonEl=Ext.select("div[@name=\"panel-scroller-left-arrow\"]",true,SwitchGames.LiveTransactions.tradeOfferDialog.body.dom).elements[0];
rightButtonEl=Ext.select("div[@name=\"panel-scroller-right-arrow\"]",true,SwitchGames.LiveTransactions.tradeOfferDialog.body.dom).elements[0];
SwitchGames.Utility.updateVerifiedMemberElements();
SwitchGames.Utility.scrollPanelRight(rightButtonEl.findParent("[@name=\"panel-scroller-root\"]",20,true),1,2,"slide",true,null);
var _740=Ext.select("span",true,rightButtonEl.dom).elements[0];
_740.update("FINISH!");
}
};
Ext.namespace("SwitchGames.LiveTransactions.SafeTrade");
SwitchGames.LiveTransactions.SafeTrade.ccFieldList=[{name:"credit card type",paramName:"card_type",id:"ast-cc-type",type:"combo",validationFn:SwitchGames.Validation.ccTypeValidation,validated:false,value:"",valueType:null},{name:"credit card number",paramName:"card_number",id:"ast-cc-number",type:"text",validationFn:SwitchGames.Validation.ccNumberValidation,validated:false,value:"",valueType:null,refField:"ast-cc-type"},{name:"CID",paramName:"card_cvv2",id:"ast-cc-cid",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"cid"},{name:"expiry month",paramName:null,id:"ast-cc-expiry-month",type:"combo",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"expiry year",paramName:null,id:"ast-cc-expiry-year",type:"combo",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"first name",paramName:"firstname",id:"ast-cc-firstname",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"last name",paramName:"lastname",id:"ast-cc-lastname",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"address",paramName:"address1",id:"ast-cc-address1",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"address",paramName:"address2",id:"ast-cc-address2",type:"text",validationFn:null,validated:true,value:"",valueType:null},{name:"city",paramName:"city",id:"ast-cc-city",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"state",paramName:"state",id:"ast-cc-state",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"zip code",paramName:"zip",id:"ast-cc-zip",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"zip"},{name:"area code",paramName:null,id:"ast-cc-phone1",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"areacode"},{name:"phone number",paramName:null,id:"ast-cc-phone2",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"prefix"},{name:"phone number",paramName:null,id:"ast-cc-phone3",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"suffix"},{name:"save",paramName:null,id:"ast-cc-save",type:"text",validationFn:null,validated:true,value:"",valueType:null}];
SwitchGames.LiveTransactions.SafeTrade.ccFormSetup=false;
SwitchGames.LiveTransactions.ccFieldValidationCallback=function(_741){
var _742=Ext.get("ast-cc-error");
if(_741==true){
_742.update("");
}else{
_742.update(_741);
}
};
SwitchGames.LiveTransactions.ccFormValidationCallback=function(_743){
if(_743==true){
SwitchGames.LiveTransactions.acceptSafeTradePanel.enableRightSlide();
}else{
SwitchGames.LiveTransactions.acceptSafeTradePanel.disableRightSlide();
}
};
SwitchGames.LiveTransactions.acceptSafeTrade=function(_744){
var _744=_744;
SwitchGames.LiveTransactions.stSuccess=false;
SwitchGames.LiveTransactions.safeTradePassword="";
SwitchGames.LiveTransactions.passwordValidated=false;
if(SwitchGames.LiveTransactions.safeTradeAcceptDialog==null){
SwitchGames.LiveTransactions.safeTradeAcceptDialog=SwitchGames.Dialogs.createDialog("","ast-dlg","SafeTrade Accept",600,null,"sg-window");
SwitchGames.LiveTransactions.safeTradeAcceptDialog.body.on("click",function(){
SwitchGames.LiveTransactions.safeTradeAcceptDialog.hide();
},this,{delegate:"img#ast-golive-btn"});
SwitchGames.LiveTransactions.safeTradeAcceptDialog.body.on("keydown",function(e,t){
var _747=Ext.fly(t).getValue();
if(_747.length>2){
SwitchGames.LiveTransactions.acceptSafeTradePanel.enableRightSlide();
}else{
SwitchGames.LiveTransactions.acceptSafeTradePanel.disableRightSlide();
}
},this,{delegate:"input#ast-password"});
}
SwitchGames.LiveTransactions.verifiedMembershipComplete=false;
var _748={usehttps:"1",pane:"get_member_info"};
SwitchGames.Utility.sendSecureRequest("data/switch_center/live_transactions.php",_748,function(_749){
var ret=Ext.util.JSON.decode(_749.responseText);
if(ret.error!=undefined){
SwitchGames.Dialogs.showErrorDialog(ret.error);
return;
}else{
SwitchGames.LiveTransactions.verifiedMember=ret.member_verified;
SwitchGames.Utility.removeVerifiedTooltips(SwitchGames.LiveTransactions.SafeTrade);
var _74b=SwitchGames.LiveTransactions.safeTradeAcceptPanel0Template.apply(ret);
var _74c=SwitchGames.LiveTransactions.safeTradeAcceptPanel1Template.apply(ret);
var _74d=SwitchGames.LiveTransactions.safeTradeAcceptPanel2Template.apply({});
var _74e=[{autoHeight:true,html:_74b,id:"ast-payment-type",leftSlideText:"PREV",rightSlideText:"NEXT",listeners:{"afterslidein":function(_74f,item,_751){
var _752=Ext.get("ast-password").getValue();
if(_752.length==0){
SwitchGames.LiveTransactions.acceptSafeTradePanel.disableRightSlide();
}
},"beforeslideout":function(_753,item,_755){
if(_755.processComplete!=null){
return true;
}
if(_755.direction==="right"){
var _756=Ext.get("ast-password").getValue();
var _757=Ext.get("ast-payment-use-existing").dom.checked;
var _758=Ext.get("ast-payment-enter-new").dom.checked;
var _759=Ext.get("ast-payment-use-credit").dom.checked;
var _75a="";
var _75b;
if(_757==true){
_75b="existing";
}else{
if(_759==true){
_75b="credit";
}
}
if(_757==true||_759==true){
_75a="ast-final";
var _75c={pane:"edit_deal",seller_approved:1,deal_id:_744,status:"in_progress",method:_75b};
_75c.oneClickPassword=_756;
if(_757==true){
_75c.oneClickPaymentType="cc";
}
var _75d=Ext.get("ast-account-processing");
_75d.setVisible(true);
SwitchGames.Utility.sendSecureRequest("data/switch_center/live_transactions.php",_75c,function(_75e){
_75d.setVisible(false);
var _75f=Ext.util.JSON.decode(_75e.responseText);
if(_75f.error!=undefined){
Ext.get("ast-account-error").update(_75f.error);
}else{
Ext.get("ast-account-error").update("");
SwitchGames.LiveTransactions.acceptSafeTradePanel.scroll("right","ast-final",{processComplete:true});
}
});
return false;
}else{
return true;
}
}
}}},{autoHeight:true,html:_74c,id:"ast-cc-info",leftSlideText:"PREV",rightSlideText:"NEXT",listeners:{"beforeslideout":function(_760,item,_762){
if(_762.processComplete!=null){
return true;
}
if(_762.direction=="left"){
return true;
}
var _763={pane:"edit_deal",seller_approved:1,deal_id:_744,status:"in_progress",method:"new"};
for(var i=0,_765=SwitchGames.LiveTransactions.SafeTrade.ccFieldList.length;i<_765;i++){
var _766=SwitchGames.LiveTransactions.SafeTrade.ccFieldList[i];
if(_766.paramName!=null){
_763[_766.paramName]=Ext.fly(_766.id).getValue();
}
}
_763.phone=Ext.fly("ast-cc-phone1").getValue()+Ext.fly("ast-cc-phone2").getValue()+Ext.fly("ast-cc-phone3").getValue();
_763.card_expiry=Ext.fly("ast-cc-expiry-month").getValue()+Ext.fly("ast-cc-expiry-year").getValue();
_763.oneClickPassword=Ext.get("ast-password").getValue();
if(Ext.fly("ast-cc-save").dom.checked){
_763.oneClickSaveInfo=1;
}
var _767=Ext.get("ast-cc-processing");
_767.setVisible(true);
SwitchGames.Utility.sendSecureRequest("data/switch_center/live_transactions.php",_763,function(_768){
_767.setVisible(false);
var _769=Ext.util.JSON.decode(_768.responseText);
if(_769.error!=undefined){
Ext.get("ast-cc-error").update(_769.error);
}else{
Ext.get("ast-cc-error").update("");
SwitchGames.LiveTransactions.acceptSafeTradePanel.scroll("right","ast-final",{processComplete:true});
}
});
return (false);
},"afterslidein":function(_76a,_76b,_76c){
if(SwitchGames.LiveTransactions.SafeTrade.ccFormSetup==true){
SwitchGames.LiveTransactions.ccFormValidationCallback(SwitchGames.Utility.validateForm(SwitchGames.LiveTransactions.SafeTrade.ccFieldList));
}else{
Ext.fly("ast-cc-firstname").dom.value=ret.first_name||"";
Ext.fly("ast-cc-lastname").dom.value=ret.last_name||"";
Ext.fly("ast-cc-address1").dom.value=ret.address1||"";
Ext.fly("ast-cc-address2").dom.value=ret.address2||"";
Ext.fly("ast-cc-city").dom.value=ret.city||"";
Ext.fly("ast-cc-state").dom.value=ret.state||"";
Ext.fly("ast-cc-zip").dom.value=ret.zip||"";
if(ret.phone==null||ret.phone=="null"||ret.phone==""){
Ext.fly("ast-cc-phone1").dom.value="";
Ext.fly("ast-cc-phone2").dom.value="";
Ext.fly("ast-cc-phone3").dom.value="";
}else{
Ext.fly("ast-cc-phone1").dom.value=ret.phone.substring(0,3);
Ext.fly("ast-cc-phone2").dom.value=ret.phone.substring(3,6);
Ext.fly("ast-cc-phone3").dom.value=ret.phone.substring(6,10);
}
var _76d=_76b.getEl();
SwitchGames.Utility.setupFormValidation(SwitchGames.LiveTransactions.SafeTrade.ccFieldList,_76d,SwitchGames.LiveTransactions.ccFieldValidationCallback,SwitchGames.LiveTransactions.ccFormValidationCallback);
SwitchGames.LiveTransactions.SafeTrade.ccFormSetup=true;
}
}}},{autoHeight:true,html:_74d,id:"ast-final",listeners:{"beforeslidein":function(_76e,item,_770){
_76e.hideLeftSlide();
_76e.hideRightSlide();
},"afterslidein":function(_771,item,_773){
if(SwitchGames.LiveTransactions.load!=null){
SwitchGames.LiveTransactions.load();
}
}}}];
if(SwitchGames.LiveTransactions.acceptSafeTradePanel!=null){
Ext.destroy(SwitchGames.LiveTransactions.acceptSafeTradePanel);
}
SwitchGames.LiveTransactions.acceptSafeTradePanel=new SwitchGames.Components.SlidePanel({activeItem:0,renderTo:SwitchGames.LiveTransactions.safeTradeAcceptDialog.body,height:550,items:_74e});
SwitchGames.Utility.createVerifiedBadgeTooltips(SwitchGames.LiveTransactions.safeTradeAcceptDialog.body,SwitchGames.LiveTransactions.SafeTrade,"SwitchGames.Utility.verifiedMemberCallback");
SwitchGames.LiveTransactions.safeTradeAcceptDialog.show();
}
},function(_774,_775){
SwitchGames.Dialogs.standardErrorDialog("Error connecting to web server");
});
};
});
Ext.onReady(function(){
Ext.namespace("SwitchGames.Buy");
if(SwitchGames.Buy==null){
SwitchGames.Buy={};
}
SwitchGames.Buy.purchasePanel0Template=new Ext.XTemplate("<div style=\"text-align:center;\">","<div class=\"to-safe-trade-large-text\" style=\"margin-top: 7px;\"><img src=\""+SwitchGames.imageUrl+"buy_logo.png\" align=\"absmiddle\" /> Buying is Always Safe and Easy</div>","</div>","<div class=\"buy-small-text\" style=\"margin: 30px 0px 0px 60px; width: 400px;\">","<b class=\"buy-brightblue-text\">You Cannot Lose Your Money</b><br/>","In the event your game does not arrive after purchasing it,<br/>","SwitchGames will issue a full refund of the purchase price.","<br/><br/>","<b class=\"buy-brightblue-text\">FREE Shipping on all Purchases!</b><br/>","Every single purchase on SwitcGames includes free shipping.<br/>","The price you see is the price you pay.","<br/><br/>","<b class=\"buy-brightblue-text\">Track Your Purchase Online (FREE)</b><br/>","No need to ask the seller for a package tracking number.&nbsp; Online<br/>","tracking is provided for you in the Live Transactions interface for<br/>","every purchase on SwitchGames.","<br/><br/>","<b class=\"buy-brightblue-text\">Get It Fast</b><br/>","Sellers are motivated to get you the game quickly because they<br/>","don't get paid until you get your game.&nbsp; Additionally, purchases<br/>","typically get to you sooner than standard trades because sellers<br/>","receive automated shipping labels with First Class U.S. postage.","</div>","<div style=\"text-align: center; margin-top: 40px;\">","<img name=\"sg-buy-continue-btn\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-buy-continue.png\" style=\"cursor:pointer;\"/>","</div>");
SwitchGames.Buy.purchasePanel1Template=new Ext.XTemplate("<div style=\"text-align: center; height: 45px;\">","<div class=\"to-safe-trade-large-text\" style=\"margin-top: 7px;\"><img src=\""+SwitchGames.imageUrl+"buy_logo.png\" align=\"absmiddle\" /> <b>Purchase Details</b></div>","</div>","<div class=\"to-review-trade-offer-center-col\">","<div class=\"to-dialog-offering-top-wrapper\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\"><b>Purchasing from:</b></div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\">","<div class=\"to-wrapper\">","<div class=\"to-avatar \">","<img src=\"{[SwitchGames.Utility.getAvatarValue(values.avatar)]}\" alt=\"avatar image\" width=\"60\" height=\"59\" />","</div>","<div class=\"to-ratings-wrapper\">","<div class=\"to-ratings\">","<span class=\"to-ratings-plus\">+{ratings_positive}</span>","<span class=\"to-ratings-minus\">-{ratings_negative}</span>","</div>","<div class=\"to-user-name\">","{screen_name}","</div>","</div>","<div class=\"to-badges-wraper\">","<div class=\"to-badge-tenure-{tenure_badge}\" {[SwitchGames.Utility.getTenureTooltip(values.tenure_badge)]}></div>","<div class=\"to-badge-transactions-{transaction_badge}\" {[SwitchGames.Utility.getTransactionTooltip(values.transaction_badge)]}></div>","<div class=\"to-badge-philanthropy-{philanthropy_badge}\" {[SwitchGames.Utility.getPhilanthropyTooltip(values.philanthropy_badge)]}></div>","<br/>","<div class=\"to-badge-rating-{ratings_star_badge}\" {[SwitchGames.Utility.getRatingsStarTooltip(values.ratings_star_badge)]}></div>","<div class=\"to-badge-plus-member-{plus_badge}\" {[SwitchGames.Utility.getPlusTooltip(values.plus_badge)]}></div>","<div class=\"to-badge-verified-{verified_badge}\" name=\"verified-badge\" verified=\"{verified_badge}\" memberVerified=\"{member_verified}\"></div>","</div>","</div>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","<div class=\"to-dialog-offering-middle-wrapper\">","<div class=\"to-dialog-middle-inner-left\">","<div class=\"sg-live-transactions-round-box-wrapper\">","<div class=\"sg-live-transactions-round-box-header\">","<div class=\"sg-live-transactions-round-box-header-inner\"><b>You are purchasing:</b></div>","</div>","<div class=\"sg-live-transactions-round-box-body\">","<div class=\"sg-live-transactions-round-box-body-inner\" style=\"height: 200px;\">","<div id=\"sg-buy-review-container\" class=\"buy-game-image-container\">","<img id=\"sg-buy-game-cover\" style=\"border: 1px solid #999999;\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\" alt=\"\" />","</div>","<div style=\"text-align: center; font-weight: bold; font-size: 14px; margin-top: 5px;\">{game_name}</div>","<div style=\"text-align: center; font-size: 12px;\">{platform_name}</div>","</div>","</div>","<div class=\"sg-live-transactions-round-box-footer\">","<div class=\"sg-live-transactions-round-box-footer-inner\"></div>","</div>","</div>","</div>","<div class=\"to-dialog-middle-inner-right\">","<div>Item Price:&nbsp; ${price}</div>","<div>Shipping:&nbsp; Free!</div>","<hr style=\"width: 160px; height: 2px; background-color: #ffffff; float: left;\"/>","<div style=\"font-size: 24px; font-weight: bold;\">Total: ${price}</div>","<div class=\"buy-small-text\" style=\"margin-top: 10px;\"><b>Overall condition:</b>&nbsp; {[SwitchGames.Utility.getGameCondition(values.condition).toUpperCase()]}</div>","<div class=\"buy-small-text\"><b>Opened?</b>&nbsp; {[values.brand_new==1 ? \"NO\" : \"YES\"]}</div>","<div class=\"buy-small-text\"><b>Has Manual / Packaging?</b>&nbsp; {[values.original_box==1 ? \"YES\" : \"NO\"]}</div>","<div class=\"buy-small-text\"><b>Scratches present?</b>&nbsp; {[values.scratches==1 ? \"YES\" : \"NO\"]}</div>","<div class=\"buy-small-text\" style=\"margin-top: 13px;\"><b>Comments from {screen_name}:</b></div>","<div><textarea class=\"buy-comments-textarea\" READONLY>{notes}</textarea></div>","</div>","</div>","</div>");
SwitchGames.Buy.purchasePanel2Template=new Ext.XTemplate("<div style=\"text-align:center;\">","<div class=\"to-safe-trade-large-text\" style=\"margin-top:7px;\"><img src=\""+SwitchGames.imageUrl+"buy_logo.png\" align=\"absmiddle\" /> Choose Payment Method</div>","</div>","<div class=\"to-safe-trade-rb-wrapper\">","<div class=\"to-safe-trade-rb-top\"><div></div></div>","<div class=\"to-safe-trade-rb-body\">","<div class=\"to-safe-trade-number-title\"><img src=\""+SwitchGames.imageUrl+"common/numbers/number-blue-1.png\" align=\"absmiddle\" style=\"margin-top:-5px;\"/>&nbsp;Choose Payment Method<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" style=\"margin: -5px 5px 0px;\" align=\"absmiddle\"></div>","<tpl for=\"member_info\">","<ul class=\"no-list-style to-safe-trade-medium-text-ul\" style=\"margin:10px 0px 0px 5px!important;\">","<li><input {[parseFloat(parent.price) > parseFloat(values.balance) ? \"DISABLED\" : \"CHECKED\"]} id=\"sg-buy-payment-use-sgcredit\" type=\"radio\" name=\"sg-buy-paymentType\" value=\"credit\" /><span style=\"color: {[parseFloat(parent.price) > parseFloat(values.balance) ? \"#777777\" : \"#FFFFFF\"]};\">&nbsp;Use my SwitchGames account (${balance} avail.)</span></li>","<li><input {[values.stored_cc_last4 != null ? \"CHECKED\" : \"DISABLED\"]} id=\"sg-buy-payment-use-existing\" type=\"radio\" name=\"sg-buy-paymentType\" value=\"cc\" /><span style=\"color: {[values.stored_cc_last4 == null ? \"#777777\" : \"#FFFFFF\"]};\">&nbsp;Use my Credit Card on file {[values.stored_cc_last4 == null ? \"\" : \"(ends in \" + values.stored_cc_last4 + \")\"]}</span></li>","<li><input id=\"sg-buy-payment-enter-new\" type=\"radio\" name=\"sg-buy-paymentType\" value=\"new\" />&nbsp;Enter new billing information</li>","</ul>","</tpl>","</div>","<div class=\"to-safe-trade-rb-bottom\"><div></div></div>","</div>","<div class=\"to-safe-trade-rb-wrapper\">","<div class=\"to-safe-trade-rb-top\"><div></div></div>","<div class=\"to-safe-trade-rb-body\">","<div class=\"to-safe-trade-number-title\"><img src=\""+SwitchGames.imageUrl+"common/numbers/number-blue-2.png\" align=\"absmiddle\" style=\"margin-top:-5px;\"/>&nbsp;Password Confirmation<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" style=\"margin: -5px 5px 0px;\" align=\"absmiddle\"></div>","<div style=\"margin:10px 0px 0px 5px; color: #ccc;\">SwitchGames Password:&nbsp;<input id=\"sg-buy-password\" class=\"input-text-wh\" type=\"password\" size=\"15\"/></div>","</div>","<div class=\"to-safe-trade-rb-bottom\"><div></div></div>","</div>","<div style=\"text-align: center;\">","<!-- error message -->","<div id=\"sg-buy-account-error\" class=\"to-safe-trade-error-text\" style=\"margin-top:15px;\"></div>","<!-- ajax form processing image -->","<div id=\"sg-buy-account-processing\" style=\"visibility: hidden;\" class=\"to-safe-trade-processing-text\" style=\"margin:15px 0px 10px 0px;\"><img src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" align=\"absmiddle\"/>&nbsp;&nbsp;Processing...</div>","</div>","<div style=\"text-align:center;\">","<div id=\"sg-buy-confirmation\" style=\"font-weight: bold; font-size: 14px; margin: 10px 0 50px 0; visibility: hidden;\">By clicking the NEXT button, you authorize SwitchGames<br/>to charge ${price} to your payment method selected above.</div>","<table width=\"10\" border=\"0\" cellspacing=\"0\" align=\"center\">","<tr>","<td></td>","<td colspan=\"3\">","<table border=\"0\" cellspacing=\"0\">","<tr>","<td>","<script src=\"https://siteseal.thawte.com/cgi/server/thawte_seal_generator.exe\"></script>","</td>","</tr>","<tr>","<td>","<a href=\"https://sealinfo.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&dn=WWW.SWITCHGAMES.COM&lang=en\" target=\"_blank\"><img src=\""+SwitchGames.imageUrl+"common/buttons/thawte_stamp.gif\" border=\"0\"/></a>","</td>","</tr>","</table>","</td>","</tr>","</table>","</div>");
SwitchGames.Buy.purchasePanel3Template=new Ext.XTemplate("<div style=\"text-align:center;\">","<div class=\"to-safe-trade-large-text\" style=\"margin-top:7px;\"><img src=\""+SwitchGames.imageUrl+"buy_logo.png\" align=\"absmiddle\" /> New Billing Information</div>","</div>","<div class=\"to-safe-trade-rb-wrapper\">","<div class=\"to-safe-trade-rb-top\"><div></div></div>","<div class=\"to-safe-trade-rb-body\">","<table class=\"table-form\" style=\"margin-top:10px;\">","<tr>","<td style=\"padding-top: 0px; padding-bottom: 10px;\" colspan=\"4\">","<div class=\"usps-font-blue-small\" style=\"margin-top:10px;\">Payment Method<img src=\""+SwitchGames.imageUrl+"common/icons/icon-ssl.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 5px;\"/><a href=\"https://sealinfo.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&dn=WWW.SWITCHGAMES.COM&lang=en\" target=\"_blank\"><img src=\""+SwitchGames.imageUrl+"common/icons/icon-thawte.png\" align=\"absmiddle\" style=\"margin:-5px 5px 0px 0px;\"/></a><span id=\"sg-buy-usps-cc-error-msg\" class=\"usps-error-text\"></span></div>","</td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">payment method</label>","</td>","<td>","<select id=\"sg-buy-cc-type\">","<option></option>","<option value=\"visa\">Visa</option>","<option value=\"mastercard\">MasterCard</option>","<option value=\"discover\">Discover</option>","<option value=\"amex\">American Express</option>","</select>","</td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" valign=\"top\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">card number</label>","</td>","<td><input id=\"sg-buy-cc-number\" class=\"input-text-wh\" type=\"text\" maxlength=\"16\" size=\"20\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">cid</label>","</td>","<td><input id=\"sg-buy-cc-cid\" class=\"input-text-wh\" type=\"text\" size=\"4\"/></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" valign=\"top\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">expiration</label>","</td>","<td>","<select id=\"sg-buy-cc-expiry-month\">","<option></option>","<option value=\"01\">01</option>","<option value=\"02\">02</option>","<option value=\"03\">03</option>","<option value=\"04\">04</option>","<option value=\"05\">05</option>","<option value=\"06\">06</option>","<option value=\"07\">07</option>","<option value=\"08\">08</option>","<option value=\"09\">09</option>","<option value=\"10\">10</option>","<option value=\"11\">11</option>","<option value=\"12\">12</option>","</select> "," <select id=\"sg-buy-cc-expiry-year\">","<option></option>","<option value=\"10\">2010</option>","<option value=\"11\">2011</option>","<option value=\"12\">2012</option>","<option value=\"13\">2013</option>","<option value=\"14\">2014</option>","<option value=\"15\">2015</option>","<option value=\"16\">2016</option>","<option value=\"17\">2017</option>","<option value=\"18\">2018</option>","<option value=\"19\">2019</option>","<option value=\"20\">2020</option>","<option value=\"21\">2021</option>","</select>","</td>","<td></td>","</tr>","<tr>","<td colspan=\"4\" style=\"height:15px;\"></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">first name</label>","</td>","<td><input id=\"sg-buy-cc-firstname\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">last name</label>","</td>","<td><input id=\"sg-buy-cc-lastname\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">address</label>","</td>","<td colspan=\"3\"><input id=\"sg-buy-cc-address1\" class=\"input-text-wh\" type=\"text\" size=\"40\"/></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">suite/apartment</label>","</td>","<td><input id=\"sg-buy-cc-address2\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td></td>","<td></td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">city</label>","</td>","<td><input id=\"sg-buy-cc-city\" class=\"input-text-wh\" type=\"text\" size=\"20\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">state</label>","</td>","<td>","<select id=\"sg-buy-cc-state\">","<option></option>","<option value=\"AK\">AK</option>","<option value=\"AL\">AL</option>","<option value=\"AR\">AR</option>","<option value=\"AZ\">AZ</option>","<option value=\"CA\">CA</option>","<option value=\"CO\">CO</option>","<option value=\"CT\">CT</option>","<option value=\"DC\">DC</option>","<option value=\"DE\">DE</option>","<option value=\"FL\">FL</option>","<option value=\"GA\">GA</option>","<option value=\"HI\">HI</option>","<option value=\"IA\">IA</option>","<option value=\"ID\">ID</option>","<option value=\"IL\">IL</option>","<option value=\"IN\">IN</option>","<option value=\"KS\">KS</option>","<option value=\"KY\">KY</option>","<option value=\"LA\">LA</option>","<option value=\"MA\">MA</option>","<option value=\"MD\">MD</option>","<option value=\"ME\">ME</option>","<option value=\"MI\">MI</option>","<option value=\"MN\">MN</option>","<option value=\"MO\">MO</option>","<option value=\"MS\">MS</option>","<option value=\"MT\">MT</option>","<option value=\"NC\">NC</option>","<option value=\"ND\">ND</option>","<option value=\"NE\">NE</option>","<option value=\"NH\">NH</option>","<option value=\"NJ\">NJ</option>","<option value=\"NM\">NM</option>","<option value=\"NV\">NV</option>","<option value=\"NY\">NY</option>","<option value=\"OH\">OH</option>","<option value=\"OK\">OK</option>","<option value=\"OR\">OR</option>","<option value=\"PA\">PA</option>","<option value=\"RI\">RI</option>","<option value=\"SC\">SC</option>","<option value=\"SD\">SD</option>","<option value=\"TN\">TN</option>","<option value=\"TX\">TX</option>","<option value=\"UT\">UT</option>","<option value=\"VA\">VA</option>","<option value=\"VT\">VT</option>","<option value=\"WA\">WA</option>","<option value=\"WI\">WI</option>","<option value=\"WV\">WV</option>","<option value=\"WY\">WY</option>","</select>","</td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">zip</label>","</td>","<td><input id=\"sg-buy-cc-zip\" class=\"input-text-wh\" type=\"text\" maxlength=\"10\" size=\"10\"/></td>","<td class=\"label-rt\">","<label class=\"label-caps\">country</label>","</td>","<td>","<select>","<option>USA</option>","</select>","</td>","</tr>","<tr>","<td class=\"label-rt\" width=\"130\" style=\"padding-bottom: 4px;\">","<label class=\"label-caps\">phone number</label>","</td>","<td colspan=\"3\"><input id=\"sg-buy-cc-phone1\" class=\"input-text-wh\" type=\"text\" maxlength=\"3\" size=\"3\"/>-<input id=\"sg-buy-cc-phone2\" class=\"input-text-wh\" type=\"text\" maxlength=\"3\" size=\"3\"/>-<input id=\"sg-buy-cc-phone3\" class=\"input-text-wh\" type=\"text\" maxlength=\"4\" size=\"4\"/></td>","</tr>","<tr>","<td style=\"padding-top: 10px;\" colspan=\"4\"><input id=\"sg-buy-cc-save\" type=\"checkbox\"/><label>&nbsp;Save this information for one-click purchases on SwitchGames</label></td>","</tr>","</table>","</div>","<div class=\"to-safe-trade-rb-bottom\"><div></div></div>","</div>","<div style=\"text-align:center;\">","<!-- error message -->","<div id=\"sg-buy-cc-error\" class=\"to-safe-trade-error-text\" style=\"margin-top:15px;\"></div>","<!-- ajax form processing image -->","<div id=\"sg-buy-cc-processing\" class=\"to-safe-trade-processing-text\" style=\"margin:15px 0px 10px 0px; display: none;\"><img src=\""+SwitchGames.imageUrl+"common/ajax-loader.gif\" align=\"absmiddle\"/>&nbsp;&nbsp;Processing...</div>","<div id=\"sg-buy-cc-confirmation\" style=\"font-weight: bold; font-size: 14px;\">By clicking the NEXT button, you authorize SwitchGames<br/>to charge ${price} to your credit card entered above.</div>","</div>");
SwitchGames.Buy.purchasePanel4Template=new Ext.XTemplate("<div style=\"text-align: center;\">","<div class=\"to-safe-trade-large-text\" style=\"margin-top:7px;\"><img src=\""+SwitchGames.imageUrl+"buy_logo.png\" align=\"absmiddle\" /> Purchase Complete!</div>","</div>","<div style=\"margin-top: 40px;\">","<div style=\"height: 200px;\">","<img id=\"sg-buy-complete-game-cover\" style=\"border: 1px solid #999999;\" src=\"{[SwitchGames.Utility.getCoverValue(values.photo_cover)]}\" alt=\"\" />","</div>","</div>","<div style=\"text-align: center; font-size: 14px; margin-top: 30px;\">","<div style=\"font-size: 24px;\">Total Sale: <b>${price}</b></div>","<div style=\"margin-top: 15px;\">SELLER HAS BEEN NOTIFIED TO SHIP ITEM</div>","<div style=\"margin-top: 10px;\">A RECEIPT HAS BEEN EMAILED TO YOU</div>","<div style=\"margin-top: 30px;\"><img name=\"sg-buy-complete-ok\" src=\""+SwitchGames.imageUrl+"common/buttons/btn-ok.png\" style=\"cursor: pointer;\"/></div>","</div>");
SwitchGames.Buy.ccFieldList=[{name:"credit card type",paramName:"card_type",id:"sg-buy-cc-type",type:"combo",validationFn:SwitchGames.Validation.ccTypeValidation,validated:false,value:"",valueType:null},{name:"credit card number",paramName:"card_number",id:"sg-buy-cc-number",type:"text",validationFn:SwitchGames.Validation.ccNumberValidation,validated:false,value:"",valueType:null,refField:"sg-buy-cc-type"},{name:"CID",paramName:"card_cvv2",id:"sg-buy-cc-cid",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"cid"},{name:"expiry month",paramName:null,id:"sg-buy-cc-expiry-month",type:"combo",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"expiry year",paramName:null,id:"sg-buy-cc-expiry-year",type:"combo",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"first name",paramName:"firstname",id:"sg-buy-cc-firstname",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"last name",paramName:"lastname",id:"sg-buy-cc-lastname",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"address",paramName:"address1",id:"sg-buy-cc-address1",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"address",paramName:"address2",id:"sg-buy-cc-address2",type:"text",validationFn:null,validated:true,value:"",valueType:null},{name:"city",paramName:"city",id:"sg-buy-cc-city",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"state",paramName:"state",id:"sg-buy-cc-state",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:null},{name:"zip code",paramName:"zip",id:"sg-buy-cc-zip",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"zip"},{name:"area code",paramName:null,id:"sg-buy-cc-phone1",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"areacode"},{name:"phone number",paramName:null,id:"sg-buy-cc-phone2",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"prefix"},{name:"phone number",paramName:null,id:"sg-buy-cc-phone3",type:"text",validationFn:SwitchGames.Validation.simpleFieldValidation,validated:false,value:"",valueType:"suffix"},{name:"save",paramName:null,id:"sg-buy-cc-save",type:"text",validationFn:null,validated:true,value:"",valueType:null}];
SwitchGames.Buy.ccFormSetup=false;
SwitchGames.Buy.ccFieldValidationCallback=function(_776){
var _777=Ext.get("sg-buy-cc-error");
if(_776==true){
_777.update("");
}else{
_777.update(_776);
}
};
SwitchGames.Buy.ccFormValidationCallback=function(_778){
if(_778==true){
SwitchGames.Buy.purchasePanel.enableRightSlide();
}else{
SwitchGames.Buy.purchasePanel.disableRightSlide();
}
};
SwitchGames.Buy.purchaseItem=function(_779){
SwitchGames.Buy.listingId=_779;
SwitchGames.Buy.buySuccess=false;
SwitchGames.Buy.password="";
SwitchGames.Buy.passwordValidated=false;
delete SwitchGames.Buy.useExisting;
delete SwitchGames.Buy.useCredit;
delete SwitchGames.Buy.enterNew;
if(SwitchGames.Buy.purchaseDialog==null){
SwitchGames.Buy.purchaseDialog=SwitchGames.Dialogs.createDialog("","sg-purchase-dlg","",600,560,"sg-window");
SwitchGames.Buy.purchaseDialog.body.on("click",function(){
SwitchGames.Buy.purchasePanel.scroll("right");
},this,{delegate:"img[@name=\"sg-buy-continue-btn\"]"});
SwitchGames.Buy.purchaseDialog.body.on("click",function(){
SwitchGames.Buy.purchaseDialog.hide();
window.location.reload();
},this,{delegate:"img[@name=\"sg-buy-complete-ok\"]"});
SwitchGames.Buy.purchaseDialog.body.on("click",function(e,t){
if(t.value=="new"){
Ext.fly("sg-buy-confirmation").hide();
}else{
Ext.fly("sg-buy-confirmation").show();
}
},this,{delegate:"input[@name=\"sg-buy-paymentType\"]"});
SwitchGames.Buy.purchaseDialog.body.on("keydown",function(e,t){
var _77e=Ext.fly(t).getValue();
SwitchGames.Buy.passwordValidated=false;
if(_77e.length>2){
SwitchGames.Buy.purchasePanel.enableRightSlide();
}else{
SwitchGames.Buy.purchasePanel.disableRightSlide();
}
},this,{delegate:"input#sg-buy-password"});
}
var url="data/switch_center/purchase_request.php";
var _780={usehttps:"1",pane:"purchase",listing_id:_779};
SwitchGames.Utility.sendSecureRequest(url,_780,function(_781){
var i,j,_784,_785;
SwitchGames.Buy.listingInfo=Ext.util.JSON.decode(_781.responseText);
if(SwitchGames.Buy.listingInfo.error!=undefined){
SwitchGames.Dialogs.showErrorDialog(SwitchGames.Buy.listingInfo.error);
return;
}else{
SwitchGames.Buy.verifiedMember=SwitchGames.Buy.listingInfo.member_verified;
SwitchGames.Buy.verifiedMembershipComplete=SwitchGames.Buy.listingInfo.member_verified;
SwitchGames.Utility.removeVerifiedTooltips(SwitchGames.Buy);
var _786=SwitchGames.Buy.purchasePanel0Template.apply({});
var _787=SwitchGames.Buy.purchasePanel1Template.apply(SwitchGames.Buy.listingInfo);
var _788=SwitchGames.Buy.purchasePanel2Template.apply(SwitchGames.Buy.listingInfo);
var _789=SwitchGames.Buy.purchasePanel3Template.apply(SwitchGames.Buy.listingInfo);
var _78a=SwitchGames.Buy.purchasePanel4Template.apply(SwitchGames.Buy.listingInfo);
var _78b=[{autoHeight:true,html:_786,id:"sg-buy-title",listeners:{"beforeslidein":function(_78c,item,_78e){
_78c.hideRightSlide();
}}},{autoHeight:true,html:_787,id:"sg-buy-details",leftSlideText:"PREV",rightSlideText:"NEXT",listeners:{"beforeslidein":function(_78f,item,_791){
var _792=Ext.get("sg-buy-game-cover");
SwitchGames.Utility.scaleAndCenterImageInParent(_792);
}}},{autoHeight:true,html:_788,id:"sg-buy-payment-method",leftSlideText:"PREV",rightSlideText:"NEXT",listeners:{"afterslidein":function(_793,item,_795){
if(SwitchGames.Buy.useExisting==undefined){
if(parseFloat(SwitchGames.Buy.listingInfo.price)<=parseFloat(SwitchGames.Buy.listingInfo.member_info.balance)){
SwitchGames.Buy.useExisting=false;
SwitchGames.Buy.enterNew=false;
SwitchGames.Buy.useCredit=true;
Ext.fly("sg-buy-confirmation").show();
Ext.fly("sg-buy-payment-use-existing").dom.checked=false;
Ext.fly("sg-buy-payment-enter-new").dom.checked=false;
Ext.fly("sg-buy-payment-use-sgcredit").dom.checked=true;
}else{
if(SwitchGames.Buy.listingInfo.stored_cc_last4!=null){
SwitchGames.Buy.useExisting=true;
SwitchGames.Buy.enterNew=false;
SwitchGames.Buy.useCredit=false;
Ext.fly("sg-buy-confirmation").show();
Ext.fly("sg-buy-payment-use-existing").dom.checked=true;
Ext.fly("sg-buy-payment-enter-new").dom.checked=false;
Ext.fly("sg-buy-payment-use-sgcredit").dom.checked=false;
}else{
SwitchGames.Buy.useExisting=false;
SwitchGames.Buy.enterNew=true;
SwitchGames.Buy.useCredit=false;
Ext.fly("sg-buy-confirmation").hide();
Ext.fly("sg-buy-payment-use-existing").dom.checked=false;
Ext.fly("sg-buy-payment-enter-new").dom.checked=true;
Ext.fly("sg-buy-payment-use-sgcredit").dom.checked=false;
}
}
}else{
Ext.fly("sg-buy-payment-use-existing").dom.checked=SwitchGames.Buy.useExisting;
Ext.fly("sg-buy-payment-enter-new").dom.checked=SwitchGames.Buy.enterNew;
Ext.fly("sg-buy-payment-use-sgcredit").dom.checked=SwitchGames.Buy.useCredit;
}
var _796=Ext.get("sg-buy-password").getValue();
if(_796.length==0){
SwitchGames.Buy.purchasePanel.disableRightSlide();
}
if(SwitchGames.Buy.passwordValidated==false){
SwitchGames.Buy.purchasePanel.disableRightSlide();
}else{
SwitchGames.Buy.purchasePanel.enableRightSlide();
}
},"beforeslideout":function(_797,item,_799){
if(_799.direction==="right"){
var _79a=Ext.get("sg-buy-password").getValue();
SwitchGames.Buy.useExisting=Ext.get("sg-buy-payment-use-existing").dom.checked;
SwitchGames.Buy.enterNew=Ext.get("sg-buy-payment-enter-new").dom.checked;
SwitchGames.Buy.useCredit=Ext.get("sg-buy-payment-use-sgcredit").dom.checked;
var _79b="";
if(SwitchGames.Buy.useExisting==true||SwitchGames.Buy.useCredit==true){
_79b="sg-buy-complete";
}else{
_79b="sg-buy-cc-info";
}
var _79c=Ext.get("sg-buy-account-processing");
_79c.setVisible(true);
Ext.fly("sg-buy-account-error").update("");
if(SwitchGames.Buy.passwordValidated==true){
_799.targetItem=_79b;
return true;
}else{
if(SwitchGames.Buy.enterNew==true){
var _79d={usehttps:"1",pane:"check_password",password:_79a};
SwitchGames.Utility.sendSecureRequest("data/common/utilities.php",_79d,function(_79e){
_79c.setVisible(false);
var _79f=Ext.util.JSON.decode(_79e.responseText);
if(_79f.error!=undefined||_79f.success==false){
SwitchGames.Buy.passwordValidated=false;
if(_79f.success!=null){
Ext.fly("sg-buy-account-error").update("Incorrect or Invalid Password");
}else{
Ext.fly("sg-buy-account-error").update(_79f.error);
}
}else{
Ext.fly("sg-buy-account-error").update("");
SwitchGames.Buy.passwordValidated=true;
SwitchGames.Buy.purchasePanel.scroll("right");
}
});
return false;
}else{
if(SwitchGames.Buy.purchaseId==null&&(SwitchGames.Buy.useExisting==true||SwitchGames.Buy.useCredit==true)){
var _79d={};
var _7a0="";
if(SwitchGames.Buy.useCredit){
_7a0="credit";
}else{
if(SwitchGames.Buy.useExisting){
_7a0="existing";
}
}
for(var i=0,_7a2=SwitchGames.Buy.ccFieldList.length;i<_7a2;i++){
var _7a3=SwitchGames.Buy.ccFieldList[i];
if(_7a3.paramName!=null){
_79d[_7a3.paramName]=Ext.fly(_7a3.id).getValue();
}
}
_79d.listing_id=SwitchGames.Buy.listingInfo.listing_id;
_79d.seller_member_id=SwitchGames.Buy.listingInfo.member_id;
_79d.method=_7a0;
_79d.pane="doPurchase";
_79d.password=_79a;
_79d.oneClickSaveInfo=1;
SwitchGames.Buy.purchaseId=SwitchGames.Utility.sendSecureRequest("data/switch_center/purchase_request.php",_79d,function(_7a4){
_79c.hide();
var _7a5=Ext.util.JSON.decode(_7a4.responseText);
if(_7a5.error!=undefined||_7a5.success==false){
SwitchGames.Buy.passwordValidated=false;
if(_7a5.success!=null){
Ext.fly("sg-buy-account-error").update("Invalid Billing Information");
}else{
Ext.fly("sg-buy-account-error").update(_7a5.error);
}
SwitchGames.Buy.purchaseId=null;
}else{
SwitchGames.Buy.passwordValidated=true;
SwitchGames.Buy.purchaseId=null;
Ext.fly("sg-buy-account-error").update("");
SwitchGames.Buy.purchasePanel.scroll("right");
}
},function(a,b){
SwitchGames.Buy.purchaseId=null;
_79c.hide();
Ext.fly("sg-buy-account-error").update("There was a problem while contacting the server.");
});
return false;
}
}
}
}else{
if(_799.direction==="left"){
SwitchGames.Buy.purchasePanel.enableRightSlide();
}
}
}}},{autoHeight:true,html:_789,id:"sg-buy-cc-info",leftSlideText:"PREV",rightSlideText:"NEXT",listeners:{"afterslidein":function(_7a8,_7a9,_7aa){
if(SwitchGames.Buy.ccFormSetup==true){
SwitchGames.Buy.ccFormValidationCallback(SwitchGames.Utility.validateForm(SwitchGames.Buy.ccFieldList));
}else{
Ext.fly("sg-buy-cc-firstname").dom.value=SwitchGames.Buy.listingInfo.member_info.first_name||"";
Ext.fly("sg-buy-cc-lastname").dom.value=SwitchGames.Buy.listingInfo.member_info.last_name||"";
Ext.fly("sg-buy-cc-address1").dom.value=SwitchGames.Buy.listingInfo.member_info.address1||"";
Ext.fly("sg-buy-cc-address2").dom.value=SwitchGames.Buy.listingInfo.member_info.address2||"";
Ext.fly("sg-buy-cc-city").dom.value=SwitchGames.Buy.listingInfo.member_info.city||"";
Ext.fly("sg-buy-cc-state").dom.value=SwitchGames.Buy.listingInfo.member_info.state||"";
Ext.fly("sg-buy-cc-zip").dom.value=SwitchGames.Buy.listingInfo.member_info.zip||"";
if(SwitchGames.Buy.listingInfo.member_info.phone==null||SwitchGames.Buy.listingInfo.member_info.phone=="null"||SwitchGames.Buy.listingInfo.member_info.phone==""){
Ext.fly("sg-buy-cc-phone1").dom.value="";
Ext.fly("sg-buy-cc-phone2").dom.value="";
Ext.fly("sg-buy-cc-phone3").dom.value="";
}else{
Ext.fly("sg-buy-cc-phone1").dom.value=SwitchGames.Buy.listingInfo.member_info.phone.substring(0,3);
Ext.fly("sg-buy-cc-phone2").dom.value=SwitchGames.Buy.listingInfo.member_info.phone.substring(3,6);
Ext.fly("sg-buy-cc-phone3").dom.value=SwitchGames.Buy.listingInfo.member_info.phone.substring(6,10);
}
var _7ab=_7a9.getEl();
SwitchGames.Utility.setupFormValidation(SwitchGames.Buy.ccFieldList,_7ab,SwitchGames.Buy.ccFieldValidationCallback,SwitchGames.Buy.ccFormValidationCallback);
SwitchGames.Buy.ccFormSetup=true;
}
},"beforeslideout":function(_7ac,_7ad,_7ae){
if(_7ae.direction==="left"){
_7ae.targetItem="sg-buy-payment-method";
}else{
if(_7ae.direction==="right"){
if(SwitchGames.Buy.purchaseComplete===true){
_7ae.targetItem=("sg-buy-complete");
return true;
}
var _7af=Ext.get("sg-buy-cc-processing");
var _7b0=Ext.get("sg-buy-cc-confirmation");
_7af.enableDisplayMode();
_7af.show();
_7b0.hide();
Ext.fly("sg-buy-cc-error").update("");
if(SwitchGames.Buy.purchaseId==null){
var _7b1={};
var _7b2="new";
for(var i=0,_7b4=SwitchGames.Buy.ccFieldList.length;i<_7b4;i++){
var _7b5=SwitchGames.Buy.ccFieldList[i];
if(_7b5.paramName!=null){
_7b1[_7b5.paramName]=Ext.fly(_7b5.id).getValue();
}
}
_7b1.card_expiry=Ext.fly("sg-buy-cc-expiry-month").getValue()+Ext.fly("sg-buy-cc-expiry-year").getValue();
_7b1.listing_id=SwitchGames.Buy.listingInfo.listing_id;
_7b1.seller_member_id=SwitchGames.Buy.listingInfo.member_id;
_7b1.method=_7b2;
_7b1.pane="doPurchase";
_7b1.password=Ext.get("sg-buy-password").getValue();
_7b1.phone=Ext.fly("sg-buy-cc-phone1").getValue()+Ext.fly("sg-buy-cc-phone2").getValue()+Ext.fly("sg-buy-cc-phone3").getValue();
if(Ext.fly("sg-buy-cc-save").dom.checked){
_7b1.oneClickSaveInfo=1;
}
SwitchGames.Buy.purchaseId=SwitchGames.Utility.sendSecureRequest("data/switch_center/purchase_request.php",_7b1,function(_7b6){
_7af.hide();
var _7b7=Ext.util.JSON.decode(_7b6.responseText);
if(_7b7.error!=undefined||_7b7.success==false){
if(_7b7.success!=null){
Ext.fly("sg-buy-cc-error").update("Invalid Billing Information");
}else{
Ext.fly("sg-buy-cc-error").update(_7b7.error);
}
SwitchGames.Buy.purchaseId=null;
}else{
SwitchGames.Buy.purchaseComplete=true;
SwitchGames.Buy.purchasePanel.scroll("right");
}
},function(a,b){
_7af.hide();
Ext.fly("sg-buy-cc-error").update("There was a problem while contacting the server.");
SwitchGames.Buy.purchaseId=null;
});
}
return false;
}
}
}}},{autoHeight:true,html:_78a,id:"sg-buy-complete",listeners:{"beforeslidein":function(_7ba,item,_7bc){
var _7bd=Ext.get("sg-buy-complete-game-cover");
SwitchGames.Utility.scaleAndCenterImageInParent(_7bd);
_7ba.hideLeftSlide();
_7ba.hideRightSlide();
}}}];
if(SwitchGames.Buy.purchasePanel!=null){
Ext.destroy(SwitchGames.Buy.purchasePanel);
}
SwitchGames.Buy.purchasePanel=new SwitchGames.Components.SlidePanel({activeItem:0,renderTo:SwitchGames.Buy.purchaseDialog.body,height:550,items:_78b});
SwitchGames.Buy.purchaseDialog.show();
}
},function(_7be,_7bf){
SwitchGames.Dialogs.standardErrorDialog("Error connecting to web server");
});
};
});

