var neopostGlbl={responseJSON:null,exec:function(el,temp,showPop){if(!showPop){showPop=false}el=$(el);var params={md5check:ipb.vars.secure_hash,uid:el.up(".popupInner").id};if(!this.evaled||!this.evaled.neopostCardJS){params.js=1}var exec=/scores|feedback|submit|next|prev/i.exec(temp);if(exec){if(exec[0]=="Next"||exec[0]=="Prev"){var vcard=el.up(".vcard");if(vcard.select(".npCHfeedback").length>0){this.feedFilters.dir=exec[0];this.feedFilters.cpage=parseInt(vcard.select(".npCPage")[0].innerHTML);this.rotate(el,-1);return}exec=null}}if(exec){params["do"]=temp;if(exec[0]=="Submit"){Object.extend(params,this.submitParams)}else{if(exec[0]=="Feedback"){if(this.feedFilters.filter_feedback!==undefined){Object.extend(params,this.feedFilters);this.feedFilters={}}else{this.rotate(el,-1);return}}}}this.responseJSON={};if(params.js||params["do"]){this.XMLWrapper=new Ajax.Request(ipb.vars.base_url+"app=neopost&module=ajax&section=feedback",{method:"post",evalJSON:"force",useWrapper:"neopostGlbl.XMLWrapper",title:"Neopost Trader Card",onFailure:function(){alert(neopostGlbl.XMLWrapper.options.title+"\nMaximum re-exeuctions made. Server may be down. Try again later.")},onAbort:function(){neopostGlbl.browsePanel(doSelect)},parameters:params,onSuccess:function(t){if(Object.isUndefined(t.responseJSON)){alert(neopostGlbl.XMLWrapper.options.title+" - ERROR\nObject is undefined")}else{if(t.responseJSON.error){alert(neopostGlbl.XMLWrapper.options.title+" - ERROR\n"+t.responseJSON.error)}else{if(t.responseJSON.js){for(var scriptId in t.responseJSON.js){var scriptSrc=t.responseJSON.js[scriptId][2];if(t.responseJSON.js[scriptId][1]){scriptSrc=unescape(scriptSrc)}if(t.responseJSON.js[scriptId][0]){if(!neopostGlbl.evaled){neopostGlbl.evaled={}}if(!neopostGlbl.evaled[scriptId]){eval(scriptSrc);neopostGlbl.evaled[scriptId]=true}}else{if(!$(scriptId)){var scriptElt=new Element("script",{type:"text/javascript",id:scriptId});scriptElt.update(scriptSrc);document.body.insert(scriptElt)}}}delete t.responseJSON.js}if(t.responseJSON.ok){neopostGlbl.responseJSON={};Object.extend(neopostGlbl.responseJSON,t.responseJSON);neopostGlbl.showpage(el,temp,showPop)}else{alert("responseJSON not ok")}}}}})}else{this.showpage(el,temp)}},userPopup:function(g,f){Event.stop(g);var d=f.identify();var b=$(f).className.match("__id([0-9]+)");if(b==null||Object.isUndefined(b[1])){Debug.error("Error showing popup");return}var a="popup_"+b[1]+"_user";var c=ipb.vars.base_url+"&app=members&module=ajax&secure_key="+ipb.vars.secure_hash+"&section=card&mid="+b[1]+"&neopost=1";Debug.write(c);ipb.namePops[b]=new ipb.Popup(a,{type:"balloon",ajaxURL:c,stem:true,hideAtStart:true,attach:{target:f,position:"auto"},w:"400px"},{afterInit:function(e){var h=$(e.id+"_popup");h.setStyle({visibility:"hidden",display:""});neopostGlbl.exec(h.down(".info"),"Scores",b)}})}};
