var pbcheckBrowserScript=!0,pbshowAlertMsgs=!0,pbshowStartUpIcon=!1,pbCoreLibReady=!1,pbXMLLibReady=!1,pbXSLLibReady=!1,pbJSONLibReady=!1,pbChartLibReady=!1,pbMyLibReady=!1,pbstateComplete=4,pbstatusOk=200,pbstatusNotFound=404,pbCoreLibHeader="[AjaMyAjax Core Lib]",$=function(a,c,b,e,d,h,f,j){(new AjaMyAjax).ajaxRequest(a,c,b,e,d,h,f,j)},AjaMyAjax=function(){this.processResponse=function(a,c,b,e,d,h,f,j,k){c=c?c:null;b=b?b:null;e=e?e:null;d=d?d:null;h=h?h:null;f=f?f:null;j=j?j:null;k=k?k:null;if(a&&
!(a.readyState<pbstateComplete))try{if(a.readyState==pbstateComplete)if(a.status==pbstatusOk)if(b&&e){if(f&&!isNaN(f)){var l=!1,n=0,p="";if(e.substr(0,1)==="X")var s=a.responseXML.getElementsByTagName("*").item(0),p=aja_getXmlNodeText(s);else p=a.responseText;n=aja_sumAlphaNumChars(p);n==f&&(l=!0);if(!l&&(j?aja_encodeNum(n,j)==f&&(l=!0):aja_encodeNum(n)==f&&(l=!0),!l)){a.abort();aja_empty(b);pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"Security check failed for "+c);a&&(a=null);return}}switch(e){case "XML":pbXMLLibReady?
d==="CHART"?pbChartLibReady?processChart(a.responseXML,b,d,h,"XML",k):(a.abort(),aja_empty(b),pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"Error in Chart Lib load")):processXML(a.responseXML,c,b,d,h):(a.abort(),aja_empty(b),pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"Error in XML Lib load"));break;case "XSL":pbXSLLibReady?processXSL(a.responseXML,c,b,d):(a.abort(),aja_empty(b),pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"Error in XSL Lib load"));break;case "JSON":pbJSONLibReady?d==="CHART"?
pbChartLibReady?processChart(a.responseText,b,d,h,"JSON",k):(a.abort(),aja_empty(b),pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"Error in Chart Lib load")):processJSON(a.responseText,b,h,d):(a.abort(),aja_empty(b),pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"Error in JSON Lib load"));break;case "MYLIB":pbMyLibReady?processMyFunctions(a.responseXML,a.responseText,c,b,d,h,f,j):(a.abort(),aja_empty(b),pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"Error in Custom Lib load"));break;default:aja_fill(b,
a.responseText)}}else a.abort(),aja_empty(b),pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"Data destination or output unspecified for "+c);else a.status==pbstatusNotFound?(a.abort(),aja_empty(b),pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,c+" not found for data request")):(a.abort(),aja_empty(b),pbshowAlertMsgs&&(e==="PHP"?aja_alertMsg(pbCoreLibHeader,"No data found for this selection"):aja_alertMsg(pbCoreLibHeader,"Sorry, cannot retrieve data requested for "+c)))}catch(r){a.abort(),b&&aja_empty(b),
pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"Sorry, an unexpected error occurred during processing of "+c),r.description&&pbshowAlertMsgs&&aja_alertMsg("Gen Error",r.description)}};aja_fill=function(a,c){if(c&&a!=="none")document.getElementById(a).innerHTML=c};aja_empty=function(a){if(a!=="none")document.getElementById(a).innerHTML=""};aja_cloak=function(a){if(a)document.getElementById(a).style.visibility="hidden"};aja_reveal=function(a){if(a)document.getElementById(a).style.visibility="visible"};
aja_alertMsg=function(a,c){alert((a?a:"Unknown Error")+"\r\n"+(c?c:"program id #501"))};aja_sumAlphaNumChars=function(a){for(var c=/[a-zA-Z0-9]/,b=0,e=a.length,d=0;d<e;d++)c.test(a.charAt(d))&&(b+=a.charCodeAt(d));return b};aja_encodeNum=function(a,c){if(a){if(isNaN(a))return-1;if(c){if(isNaN(c))return-1;a=Math.round(a*c)}else a=Math.round(a*Math.PI)}return a};aja_getXmlNodeText=function(a){try{return a.textContent?a.textContent:a.text}catch(c){return null}};this.ajaxRequest=function(a,c,b,e,d,h,
f,j,k,l,n,p){if(pbcheckBrowserScript){if(!document.getElementById){pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"JavaScript error, browser upgrade or fix needed to run this");return}try{var s=[];s.push("*");s=null}catch(r){pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"JavaScript error, browser upgrade probably needed");r.description&&pbshowAlertMsgs&&aja_alertMsg("Gen Error",r.description);return}}var i=a?a:null,a=c?c:null,o=b?b:null,m=e?e:null,q=d?d:null,t=h?h:null,u=f?f:null,v=j?j:null,w=k?k:
null;pbshowAlertMsgs=l!=null?l:pbshowAlertMsgs;pbshowStartUpIcon=n!=null?n:pbshowStartUpIcon;b=p!=null?p:!0;if(!i||!o)pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"Required parameters are missing");else{m&&(m=m.toUpperCase());q&&(q=q.toUpperCase());i&&(i=i.toLowerCase());a&&(i+=a);try{pbshowStartUpIcon?aja_fill(o,"*"):aja_empty(o)}catch(x){pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"Invalid container, check parameter list for "+i);x.description&&pbshowAlertMsgs&&aja_alertMsg("Gen Error",x.description);
return}if(i.indexOf(".xml")!=-1&&m==="XSL"&&(navigator.userAgent.indexOf("Chrome")!=-1||navigator.userAgent.indexOf("Safari")!=-1||navigator.appVersion.indexOf("MSIE 9")!=-1))i="phpxsl.php?url="+i.replace(".xml",".xsl"),m="PHP";pbCoreLibReady=!0;var g=null;window.XMLHttpRequest?g=new XMLHttpRequest:window.ActiveXObject&&(b=!1,(g=new ActiveXObject("Msxml2.XMLHTTP"))||(g=new ActiveXObject("Microsoft.XMLHTTP")));g?(g.open("GET",i,b),window.XMLHttpRequest?(g.source=this,g.onreadystatechange=function(){g.source.processResponse(g,
i,o,m,q,t,u,v,w)}):g.onreadystatechange=function(){AjaMyAjax.apply(this);this.processResponse(g,i,o,m,q,t,u,v,w)},g&&g.send(null),!b&&navigator.userAgent.indexOf("Firefox")!=-1&&this.processResponse(g,i,o,m,q,t,u,v,w)):(aja_empty(o),pbshowAlertMsgs&&aja_alertMsg(pbCoreLibHeader,"Sorry, browser does not support XMLHttpRequest"))}}};

