function AjaxLite()
	{
		this.xmlhandler				= null;
		this.Map					= '/';
		this.URL					= '';
		this.sendType				= 'POST';
		this.Post					= new Array();
		this.ID						= null;
		this.Replace				= true;

		this.doOnBeforeError		= null;
		this.doOnAfterError			= null;
		this.doOnDefaultBefore		= null;
		this.doOnDefault			= null;
		this.doOnChange				= null;
	}

AjaxLite.prototype.makeObject = function()
	{
		try
			{
				this.xmlhandler		= new XMLHttpRequest();			
				return true;
			}
		catch(e)
			{
				try
					{
						this.xmlhandler	= new ActiveXObject('Microsoft.XMLHTTP');
						return true;
					}
				catch(e)
					{
					}
			}
		return false;
	}

AjaxLite.prototype.doRequest = function()
	{
		if(typeof(this.onLoad) == 'function')
			this.onLoad();

		this.sendType = (typeof(this.sendType) != "undefined" && this.sendType.toUpperCase() != "POST") ? "GET" : "POST";
		
		if(this.sendType != "POST")
			this.URL = this.noCache( this.URL );
		
		if(!this.xmlhandler)
			this.makeObject();

		if (!this.Ok())
			{
				this.xmlhandler.open(this.sendType, this.Map + this.URL, true);
				if (this.sendType == "GET")
					{
						this.xmlhandler.send(null);
					}
				else
					{
						if(typeof( this.xmlhandler.setRequestHeader ) != "undefined")
							this.xmlhandler.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

						this.xmlhandler.send(this.formatPost(this.Post));
					}
				
				this.xmlhandler.onreadystatechange = this.ORSC;

				if(this.xmlhandler.readyState == 4 && this.xmlhandler.status == 200)
					return true;
			}
		return false;
	}

AjaxLite.prototype.doCheck = function()
	{
		if(this.Ok())
			{
				this.ResponseText	= this.xmlhandler.responseText.split('<<>>');
				this.Re				= this.ResponseText;
				this.Data			= this.ResponseText[0].split('<><>');

				if(typeof(this.doOnBeforeError) == 'function')
					this.doOnBeforeError();

				if(!this.checkError(this.ResponseText))
					{
						if(typeof(this.doOnDefaultBefore) == 'function')
							this.doOnDefaultBefore();

						if(typeof(this.doOnChange) == 'function')
							this.doOnChange();

						if(typeof(this.doOnDefault) == 'function')
							this.doOnDefault();
					}
				else
					{
						if(typeof(this.onError) == 'function')
							this.onError();
					}

				if(typeof(this.doOnAfterError) == 'function')
					this.doOnAfterError();
			}
	}

AjaxLite.prototype.noCache = function (url)
	{
		var sep    = ( -1 < url.indexOf("?") ) ? "&" : "?";
		var mydate = new Date();
		var newurl = url + sep + "__=" + mydate.getTime();

		return newurl;
	}

AjaxLite.prototype.formatPost = function( arrayfields )
	{
		var FfpStr = '';
		try
			{
				for( var $_I in arrayfields )
					FfpStr += $_I + '=' + this.encodeURL(arrayfields[$_I]) + '&';
			}
		catch(e)
			{
			}

		return FfpStr;
	}

AjaxLite.prototype.encodeURL = function( url )
	{
		if(url.toString().match(/[\x90-\xFF]/g))
			for (var i = 0; i < i.length; i++)
					url = url.replace(regcheck[i], '%u00' + (regcheck[i].charCodeAt(0) & 0xFF).toString(16).toUpperCase());

		return escape(url).replace(/\+/g, "%2B");
	}

AjaxLite.prototype.Ok = function()
	{
		return ( this.xmlhandler.readyState == 4 && this.xmlhandler.status == 200 ) ? true : false;
	}

AjaxLite.prototype.checkError = function(ResponseText)
	{	
		var Return		= false;

		var Re			= (typeof(ResponseText) != 'undefined')		? ResponseText					: '';

		if(Re.length <= 1 && Re[0] == "")
			{
				Type		= 'Error';
				Melding		= 'Er is geen data gevonden! Probeer het later opnieuw aub opnieuw, ons excusus voor het ongemak!';
				Return		= true;
			}
		else if(Re[0] == "reload")
			{
				document.location.reload();
				return true;
			}
		else if(Re[0] == "Warn" || Re[0] == "Error")
			{
				Type		= Re[0];
				Melding		= Re[1];
				Return		= true;
			}

		if(Return != false)
			{
				alert(Type.toUpperCase() + "\n\n" + Melding);
				
				return true;
			}
		return false;
	}

AjaxLite.prototype.doAbort = function()
	{
		this.xmlhandler.abort();
		this.xmlhandler = null;
	}
