var mybic_failed_requests=0; function XMLHTTP(_1,_2){ this.version="0.7.0"; this.server_url=_1; this.async=true; this.debug=0; this.throttle=1; this.method="POST"; this.req=null; this.headers=new Array(); this.callBack=""; this.format="JSON"; this.net_down_func=this.down; this.abort_timeout=5000; this.failed_threshold=3; this.ignoreCall=0; this.stopRequest=0; this.readyStateFunction=(_2)?_2:this.responseHandler; this.debugID=0; this.errors=new Array(); this.queue=new Array(); this.queue_in_process=0; this.currentCallIgnore=0; this.readySateTimer=""; } XMLHTTP.prototype.getXMLHTTP=function(){ if(window.XMLHttpRequest){ this.req=new XMLHttpRequest(); }else{ if(window.ActiveXObject){ this.req=new ActiveXObject("Microsoft.XMLHTTP"); }else{ if(this.debug==1){ this.showDebug("
FATAL ERROR: Could not create XMLHTTPRequest Object!
"); } return false; } } return this.req; }; XMLHTTP.prototype.call=function(_3,_4,_5){ if(mybic_failed_requests>=this.failed_threshold){ this.net_down_func("disable"); return false; }else{ var _6; var _7; this.fullUrl=""; if(this.throttle==1&&_5!="queue"||this.stopRequest==1){ this.add2Queue(_3,_4); } if(this.queue_in_process==0){ if(!this.getXMLHTTP()){ return false; } if(this.throttle==1){ this.queue_in_process=1; var _8=this.queue.shift(); _6=_8.queryVars; _7=_8.userCallback; this.format=_8.format; this.method=_8.method; this.abort_timeout=_8.abortTimeout; this.currentCallIgnore=_8.ignoreCall; this.async=_8.async; }else{ _6=_3; _7=_4; var _9=0; } this.callBack=_7; if(this.format!="JSON"){ _6=_6+"&json=false"; } this.full_url=(this.method=="POST")?this.server_url:this.server_url+"?"+_6; if(this.debug==1&&this.currentCallIgnore!=1){ try{ var _a=_6.match(/action=(\w+)&?/); this.showDebug("new","MYBIC - CALLING: "+_a[1]); this.showDebug("Server Page: "+this.server_url+"
HTTP Method: "+this.method+"
Encoding Format: "+this.format+"
Query String: "+_6+"
"); } catch(e){ } } this.req.open(this.method,this.full_url,this.async); if(this.headers){ for(var i in this.headers){ if(i!=""&&(this.headers[i] instanceof String)){ try{ this.req.setRequestHeader(i,this.headers[i]); if(this.debug==1){ this.showDebug("Setting Custom Header: "+this.headers[i]+"
"); } } catch(e){ } } } } if(this.abort_timeout!=-1){ this.end_timer=setInterval("ajaxObj.endCall()",this.abort_timeout); } if(this.method=="POST"){ this.req.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); this.request=_6; this.req.send(_6); }else{ this.req.send(null); } if(this.readyStateFunction){ this.readyStateTimer=window.setInterval(function(){ if(ajaxObj.req&&ajaxObj.req.readyState==4){ window.clearInterval(ajaxObj.readyStateTimer); ajaxObj.readyStateTimer=null; ajaxObj.responseHandler(); } },50); } } } }; XMLHTTP.prototype.responseHandler=function(){ if(ajaxObj.req){ try{ if(ajaxObj.req.readyState==4){ if(ajaxObj.req.status&&ajaxObj.req.status==200){ if(ajaxObj.req.responseText.indexOf("ajax_msg_failed")!=-1){ ajaxObj.showDebug("Fatal Error: mybic_server sent back ajax_msg_failed! - MSG: "+ajaxObj.req.responseText+"
"); if(ajaxObj.req.responseText.indexOf("notauth")!=-1){ if(ajaxObj.abort_timeout!=-1){ clearInterval(ajaxObj.end_timer); } ajaxObj.callBack("notauthorized"); }else{ ajaxObj.callBack(false); } }else{ if(ajaxObj.abort_timeout!=-1){ clearInterval(ajaxObj.end_timer); } if(ajaxObj.format=="JSON"){ try{ var _c=JSON.parse(ajaxObj.req.responseText); if(document.getElementById(ajaxObj.callBack)){ document.getElementById(ajaxObj.callBack).innerHTML=_c; }else{ ajaxObj.callBack(_c); } } catch(e){ alert("an error occurred in your response function, not mybic related. Error Name: "+e.name+" Message:"+e.message); if(document.getElementById(ajaxObj.callBack)){ }else{ ajaxObj.callBack(false); } } }else{ if(ajaxObj.format=="XML"){ ajaxObj.callBack(ajaxObj.req.responseXML); }else{ if(document.getElementById(ajaxObj.callBack)){ document.getElementById(ajaxObj.callBack).innerHTML=ajaxObj.req.responseText; }else{ ajaxObj.callBack(ajaxObj.req.responseText); } } } } mybic_failed_requests=0; }else{ try{ ajaxObj.showDebug("Fatal Error: MSG: "+ajaxObj.req.responseText+" StatusText: "+ajaxObj.req.statusText+"
"); } catch(e){ } ajaxObj.endCall(); } try{ if(ajaxObj.debug==1&&ajaxObj.currentCallIgnore!=1){ var _d=ajaxObj.req.responseText.replace(/(\<)/gi,"<"); var _d=_d.replace(/(\>)/gi,">"); ajaxObj.showDebug("HTTP Server Response:
"+_d+"
"); } } catch(e){ } ajaxObj.restoreDefaults(); ajaxObj.queue_in_process=0; ajaxObj.req=null; if(ajaxObj.queue.length>0){ ajaxObj.call("","","queue"); } } } catch(e){ } } }; XMLHTTP.prototype.loadScript=function(_e,_f){ try{ var _10=document.getElementsByTagName("script"); s_len=_10.length; for(var i=0;i0){ ajaxObj.call("","","queue"); } if(ajaxObj.debug==1){ ajaxObj.showDebug("Request Failed - Network Down! Current Failed Attempts: "+mybic_failed_requests+"
"); } } catch(e){ clearInterval(ajaxObj.end_timer); ajaxObj.net_down_func("disable"); } ajaxObj.req=null; }; XMLHTTP.prototype.loadCSS=function(url){ try{ var _20=document.getElementsByTagName("link"); s_len=_20.length; if(s_len>0){ for(var i=0;i"; _25+=" MSGHERE

"; if(_24=="disable"){ var _26="A network issue has disabled network connections for this page. Please reload this page or contact the site administrator"; }else{ var _26="A network issue has occurred which canceled your last request"; } try{ if(document.getElementById("mybic_notification")){ document.getElementById("mybic_notification").style.display="block"; }else{ var _27=document.createElement("div"); _27.innerHTML=_25; document.body.appendChild(_27); } document.getElementById("mybic_notif_msg").innerHTML=_26; } catch(e){ alert("Network Unavailable: Please re-load page or contact the site administrator"); } }; XMLHTTP.prototype.showDebug=function(msg,_29,_2a){ if(ajaxObj.debug==1){ if(!document.getElementById("mybic_debug")){ var _2b=document.createElement("div"); _2b.id="mybic_errs"; var deb=document.createElement("div"); deb.id="mybic_debug"; deb.style.border="thick solid black"; deb.style.backgroundColor="#eeeeee"; deb.style.padding="10px"; deb.style.margin="75px 10px 10px 10px"; deb.style.width="90%"; deb.style.position="absolute"; deb.style.zIndex="999"; deb.innerHTML+="MyBic Debugger: hide/show me!"; deb.innerHTML+="    Clear"; deb.innerHTML+="    Expand All"; deb.innerHTML+="    Contract All

"; deb.appendChild(_2b); if(document.body){ document.body.appendChild(deb); }else{ document.lastChild.appendChild(deb); } } var deb=document.getElementById("mybic_errs"); if(msg=="new"){ ajaxObj.debugID++; var _2d="+"; deb.innerHTML+="
"+_2d+" label"+ajaxObj.debugID+": "+_29+"
"; }else{ deb.innerHTML+=""; } } }; XMLHTTP.prototype.debug_expand=function(el){ var deb=document.getElementById("mybic_errs"); var _30=deb.childNodes.length; if(el=="none"||el=="block"){ var _31="mybic_debug"; var _32=deb.getElementsByTagName("a"); var _33=_32.length; for(var q=0;q<_33;q++){ _32[q].innerHTML=(el=="none")?"+":">"; } }else{ var _31=el.parentNode.id; _31=_31.split("_"); _31="mybic_debug"+_31[1]; } for(var i=0;i<_30;i++){ try{ if(deb.childNodes[i].className.match(new RegExp("(^"+_31+".*$)"))){ if(el=="none"||el=="block"){ deb.childNodes[i].style.display=el; }else{ if(deb.childNodes[i].style.display=="block"){ el.innerHTML="+"; deb.childNodes[i].style.display="none"; }else{ el.innerHTML=">"; deb.childNodes[i].style.display="block"; } } } } catch(e){ } } }; XMLHTTP.prototype.restart=function(){ ajaxObj.stopRequest=0; ajaxObj.call("","","queue"); }; var JSON=function(){ var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"},s={"boolean":function(x){ return String(x); },number:function(x){ return isFinite(x)?String(x):"null"; },string:function(x){ if(/["\\\x00-\x1f]/.test(x)){ x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){ var c=m[b]; if(c){ return c; } c=b.charCodeAt(); return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16); }); } return "\""+x+"\""; },object:function(x){ if(x){ var a=[],b,f,i,l,v; if(x instanceof Array){ a[0]="["; l=x.length; for(i=0;i