
	function coreHelperAjaxBase(bChildCall)
	{

		var oThisReference						=	this;
		this.bContinue							=	true;
		if ("undefined" === typeof(bChildCall) || true === bChildCall)
		{
			this.oChildCall							=	new coreHelperAjaxBase(false);
		}

		this.oHttpRequest						=	null;
		this.aJavaScript						=	new Array();
		if ("undefined" !== typeof(window.XMLHttpRequest))
		{
			this.oHttpRequest = new XMLHttpRequest();

			if ("undefined" !== typeof(this.oHttpRequest.overrideMimeType))
			{
				this.oHttpRequest.overrideMimeType('text/xml');
			}
		}
		else if ("undefined" !== typeof(window.ActiveXObject))
		{
			try
			{
				this.oHttpRequest	=	new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				try
				{
					this.oHttpRequest	=	new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e)
				{
					// Browser does not support Ajax
				}
			}
		}

		this.GET							=	'GET';
		this.POST							=	'POST';
		this.XML							=	'XML';
		this.TEXT							=	'TEXT';
		this.OBJECT							=	'OBJECT';

		this.sLastUrl						=	null;
		this.iMaxUrlLength					=	2000;
		this.eMethod						=	this.GET;
		this.eResponseType					=	this.TEXT;

		this.bUseXRequestedWithHeader		=	true;
		this.bSynchroniousCall				=	true;
		this.bUpdateMaintenanceCheck		=	true;

		this.bShowErrorMessage				=	true;
		this.bShowErrorMessageInStatusBar	=	false;

		this.bCallbackFunctionExecuted		=	false;
		this.bCustomErrorFunctionExecuted	=	false;
		
		this.bPrintAddedCssJs				=	false;

		this.oLoadingImage				=	null;
		this.oImageContainer			=	null;
		this.oImg						=	null;
		this.oTextContainer				=	null;

		this.sLoadingImage				=	"./shared/breox/img/ajax-loader.gif";
		this.sErrorImage				=	"./shared/breox/img/ajax-error.png";
		this.sLoadingText				=	"Loading";
		this.sErrorText					=	"Error";
		this.sFormData					= "";

		this.oHeadElement				= null;
		this.aHeadJavascripts			= null;
		this.aHeadCssfiles				= new Array();
		this.aHeadMetaTags				= new Array();

		this.translate = function(sString)
		{
			if ("function" === typeof(translate))
			{
				return translate(sString);
			}
			return sString;
		};
		
		this.sLoadingText = this.translate(this.sLoadingText);
		

		this.aStatusCategories				=	{
													1 : "Informational",
													2 : "Successful",
													3 : "Redirection",
													4 : "Client Error",
													5 : "Server Error",

													"x" : "Dummy"
												};

		this.aStateDescriptions				=	{
													"100" : "Continue",
													"101" : "Switching Protocols",

													"200" : "OK",
													"201" : "Created",
													"202" : "Accepted",
													"203" : "Non-Authoritative Information",
													"204" : "NNo Content",
													"205" : "Reset Content",
													"206" : "Partial Content",

													"300" : "Multiple Choices",
													"301" : "Moved Permanently",
													"302" : "Found",
													"303" : "See Other",
													"304" : "Not Modified",
													"305" : "Use Proxy",
													"306" : "Unused",
													"307" : "Temporary Redirect",

													"400" : "Bad Request",
													"401" : "Unauthorized",
													"402" : "Payment Required",
													"403" : "Forbidden",
													"404" : "URI Not Found",
													"405" : "Method Not Allowed",
													"406" : "Not Acceptable",
													"407" : "Proxy Authentication Required",
													"408" : "Request Timeout",
													"409" : "Conflict",
													"410" : "Gone",
													"411" : "Length Required",
													"412" : "Precondition Failed",
													"413" : "Request Entity Too Large",
													"414" : "Request-URI Too Long",
													"415" : "Unsupported Media Type",
													"416" : "Requested Range Not Satisfiable",
													"417" : "Expectation Failed",

													"500" : "Internal Server Error",
													"501" : "Not Implemented",
													"502" : "Bad Gateway",
													"503" : "Service Unavailable",
													"504" : "Gateway Timeout",
													"505" : "HTTP Version Not Supported",

													"999" : "Dummy"
												};

		if ("function" === typeof(translate))
		{
			for (var sErrorCode in this.aStatusCategories)
			{
				this.aStatusCategories[sErrorCode] = translate(this.aStatusCategories[sErrorCode]);
			}

			for (var sErrorCode in this.aStateDescriptions)
			{
				this.aStateDescriptions[sErrorCode] = translate(this.aStateDescriptions[sErrorCode]);
			}
		}

		this.onReadyStateChange				=	function()
												{
													switch (this.oHttpRequest.readyState)
													{
														case 4:
														{
															switch(this.oHttpRequest.status)
															{
																case 200:
																{
																	if (true === this.bUpdateMaintenanceCheck 
																	&& "object" === typeof(document.oCoreMaintenanceCheck))
																	{
																		try
																		{
																			document.oCoreMaintenanceCheck.resetCheckCount();
																		}
																		catch (e)
																		{
																			// do nothing
																		}
																	}
																	var mReturn = null;
																	switch (this.eResponseType)
																	{
																		case this.XML:
																		{
																			mReturn = this.oHttpRequest.responseXML;
																		}
																		break;

																		case this.TEXT:
																		{
																			mReturn = this.oHttpRequest.responseText;
																		}
																		break;

																		case this.OBJECT:
																		default:
																		{
																			mReturn = this.oHttpRequest;
																		}
																	}

																	this.loadHeadScripts();

																	var sScriptReturn 		= this.oHttpRequest.responseText;

																	/* CSS HEAD LINKS */
																	var sLowerTextString	= this.oHttpRequest.responseText.toLowerCase();
																	var iStartPosition		= sLowerTextString.indexOf('<link');
																	while (-1 !== iStartPosition)
																	{
																		var iEndPosition	=	0;
																		var bHeadScript		=	false;
																		var iArrowPosition	=	sScriptReturn.substr(iStartPosition).indexOf('>');
																		var sStartTag		=	sScriptReturn.substr(iStartPosition, iArrowPosition);
																		if (-1 !== sStartTag.indexOf('href'))
																		{
																			var sCloseChar = sStartTag.substr(sStartTag.indexOf('href') + 5, 1);
																			bHeadScript = true;
																			var sScriptUrl = sStartTag.substr(sStartTag.indexOf('href') + 6, sStartTag.substr(sStartTag.indexOf('href') + 6).indexOf(sCloseChar));
																		}
																		iEndPosition		=	sLowerTextString.indexOf('</link>');
																		var iEndOffset		=	7;
																		if (-1 === iEndPosition)
																		{
																			iEndPosition		=	sLowerTextString.indexOf('/>');
																			iEndOffset			=	2;
																		}

																		if (-1 === iEndPosition)
																		{
																			iStartPosition = -1;
																		}
																		else
																		{
																			sScriptReturn		= sScriptReturn.substr(iEndPosition + iEndOffset);
																			sLowerTextString	= sScriptReturn.toLowerCase();
																			iStartPosition		= sLowerTextString.indexOf('<link');
																			if (true === bHeadScript)
																			{
																				if ("undefined" === typeof(this.aHeadCssfiles[sScriptUrl]) && null !== this.oHeadElement && false !== this.oHeadElement)
																				{
																					if (true === this.bPrintAddedCssJs)
																					{
																						oDiv = document.createElement("div");
																						oDiv.innerHTML = sScriptUrl;
																						document.body.appendChild(oDiv);
																					}
																					var oScript = document.createElement('link');
																					oScript.setAttribute("rel", "stylesheet");
																					oScript.setAttribute("type", "text/css");
																					oScript.setAttribute("href", sScriptUrl);
																					this.oHeadElement.appendChild(oScript);
																					this.aHeadCssfiles[sScriptUrl] = sScriptUrl;
																				}
																			}
																		}
																	}

																	/* META TAGS */
																	var sLowerTextString	= this.oHttpRequest.responseText.toLowerCase();
																	var iStartPosition		= sLowerTextString.indexOf('<meta');
																	while (-1 !== iStartPosition)
																	{
																		var iEndPosition	=	0;
																		var bHeadScript		=	false;
																		var iArrowPosition	=	sScriptReturn.substr(iStartPosition).indexOf('>');
																		var sStartTag		=	sScriptReturn.substr(iStartPosition, iArrowPosition);
																		if (-1 !== sStartTag.indexOf('name'))
																		{
																			var sCloseChar = sStartTag.substr(sStartTag.indexOf('name') + 5, 1);
																			bHeadScript = true;
																			var sNameValue = sStartTag.substr(sStartTag.indexOf('name') + 6, sStartTag.substr(sStartTag.indexOf('name') + 6).indexOf(sCloseChar));
																			var sContentValue = "";
																		}
																		if (-1 !== sStartTag.indexOf('content'))
																		{
																			var sCloseChar = sStartTag.substr(sStartTag.indexOf('content') + 8, 1);
																			sContentValue = sStartTag.substr(sStartTag.indexOf('content') + 9, sStartTag.substr(sStartTag.indexOf('content') + 9).indexOf(sCloseChar));
																		}
																		iEndPosition		=	sLowerTextString.indexOf('</meta>');
																		var iEndOffset		=	7;
																		if (-1 === iEndPosition)
																		{
																			iEndPosition		=	sLowerTextString.indexOf('/>');
																			iEndOffset			=	2;
																		}

																		if (-1 === iEndPosition)
																		{
																			iStartPosition = -1;
																		}
																		else
																		{
																			sScriptReturn		= sScriptReturn.substr(iEndPosition + iEndOffset);
																			sLowerTextString	= sScriptReturn.toLowerCase();
																			iStartPosition		= sLowerTextString.indexOf('<meta');
																			if (true === bHeadScript)
																			{
																				if ("undefined" === typeof(this.aHeadMetaTags[sNameValue]) && null !== this.oHeadElement && false !== this.oHeadElement)
																				{
																					var oScript = document.createElement('meta');
																					oScript.setAttribute("name", sNameValue);
																					oScript.setAttribute("content", sContentValue);
																					this.oHeadElement.appendChild(oScript);
																					this.aHeadMetaTags[sNameValue] = sNameValue;
																				}
																			}
																		}
																	}

																	/* JAVASCRIPT + HEAD SCRIPTS CHECK*/
																	var sScriptReturn 		= this.oHttpRequest.responseText;

																	this.aJavaScript		= new Array();
																	var sLowerTextString	= this.oHttpRequest.responseText.toLowerCase();
																	var iStartPosition		= sLowerTextString.indexOf('<script');
																	while (-1 !== iStartPosition)
																	{
																		var sJavascript		=	"";
																		var iEndPosition	=	0;
																		var bHeadScript		=	false;
																		var iArrowPosition	=	sScriptReturn.substr(iStartPosition).indexOf('>');
																		var sStartTag		=	sScriptReturn.substr(iStartPosition, iArrowPosition);
																		if (-1 !== sStartTag.indexOf('src'))
																		{
																			var sCloseChar = sStartTag.substr(sStartTag.indexOf('src') + 4, 1);
																			bHeadScript = true;
																			var sScriptUrl = sStartTag.substr(sStartTag.indexOf('src') + 5, sStartTag.substr(sStartTag.indexOf('src') + 5).indexOf(sCloseChar));
																		}
																		iEndPosition		=	sLowerTextString.indexOf('</script>');
																		if (-1 === iEndPosition)
																		{
																			iStartPosition = -1;
																		}
																		else
																		{
																			var sJavaScript			= sScriptReturn.substr(iStartPosition, iEndPosition - iStartPosition);
																			var iFirstArrow		= sJavaScript.indexOf(">");
																			sJavaScript			= sJavaScript.substr(iFirstArrow + 1);

																			sScriptReturn		= sScriptReturn.substr(iEndPosition + 9);
																			sLowerTextString	= sScriptReturn.toLowerCase();
																			iStartPosition		= sLowerTextString.indexOf('<script');
																			if (true === bHeadScript)
																			{
																				if ("undefined" === typeof(this.aHeadJavascripts[sScriptUrl]) && null !== this.oHeadElement && false !== this.oHeadElement)
																				{
																					if (true === this.bPrintAddedCssJs)
																					{
																						oDiv = document.createElement("div");
																						oDiv.innerHTML = sScriptUrl;
																						document.body.appendChild(oDiv);
																					}
																					var oScript		= document.createElement('script');
																					oScript.setAttribute("type", "text/javascript");
																					oScript.setAttribute("src", sScriptUrl);
																					this.oHeadElement.appendChild(oScript);
																					if ("undefined" !== typeof(oScript.readyState))
																					{
																						var pCount = 0;
																						while (oScript.readyState !== "loaded" && pCount < 10)
																						{
																							sleep(50);
																							pCount++;
																						}
																					}
																					this.aHeadJavascripts[sScriptUrl] = sScriptUrl;
																				}
																			}
																			else
																			{
																				this.aJavaScript[this.aJavaScript.length] = sJavaScript;
																			}
																		}
																	}



																	if ("function" === typeof(this.mCallbackFunction))
																	{
																		try
																		{
																			if ( false === this.bCallbackFunctionExecuted)
																			{
																				this.mCallbackFunction(mReturn);
																				this.bCallbackFunctionExecuted = true;
																			}
																		}
																		catch (e)
																		{
																		}
																	}
																	else
																	{
																		try
																		{
																			if("function" === typeof(eval(this.mCallbackFunction)))
																			{
																				if ( false === this.bCallbackFunctionExecuted)
																				{
																					this.bCallbackFunctionExecuted = true;
																					eval(this.mCallbackFunction+'(mReturn)');
																				}
																			}
																		}
																		catch (e)
																		{
																			// do nothing;
																		}
																	}

																	if (null === this.mCallbackFunction)
																	{
																		return mReturn;
																	}
																}
																break;

																case 500: /* Internal Server Error */
																case 404: /* URI Not Found */
																case 401: /* Unauthorized */
																case 403: /* Forbidden */
																case 408: /* Request Timeout */
																{
																	if(null !== this.oImg)
																	{
																		this.oImg.src = this.sErrorImage;
																		this.oTextContainer.innerHTML 	= 	this.translate(this.aStateDescriptions[this.oHttpRequest.status]);
																	}
																	if ("function" === typeof(this.mCustomErrorFunction))
																	{
																		try
																		{
																			if ( false === this.bCustomErrorFunctionExecuted)
																			{
																				this.mCustomErrorFunction(this.oHttpRequest.status);
																				this.bCustomErrorFunctionExecuted = true;
																			}
																		}
																		catch (e)
																		{
																		}
																	}
																	else
																	{
																		try
																		{
																			if("function" === typeof(eval(this.mCustomErrorFunction)))
																			{
																				if ( false === this.bCustomErrorFunctionExecuted)
																				{
																					this.bCustomErrorFunctionExecuted = true;
																					eval(this.mCustomErrorFunction+'(this.oHttpRequest.status)');
																				}
																			}
																		}
																		catch (e)
																		{
																			// do nothing;
																		}
																	}

																	if (null === this.mCustomErrorFunction)
																	{
																		alert(this.getMessage(this.oHttpRequest.status));
																	}
																}
																break;

																default:
																{
																	// do nothing
																}
																break;
															}
														}
														break;

														default:
														{
															// do nothing
														}
														break;
													}
													return true;
												}

		this.loadHeadScripts				=	function()
												{

													if (null === this.oHeadElement)
													{
														this.oHeadElement = document.getElementsByTagName("head");
														if ("undefined" !== typeof(this.oHeadElement[0]))
														{
															this.oHeadElement = this.oHeadElement[0];
														}
														else
														{
															this.oHeadElement = false;
														}
													}

													if (false !== this.oHeadElement && null === this.aHeadJavascripts)
													{
														this.aHeadJavascripts = new Array();
														if ('undefined' !== typeof(document.aCoreCombinerScripts))
														{
															if ('undefined' !== typeof(document.aCoreCombinerScripts['css']))
															{
																for (var pCount = 0; pCount < document.aCoreCombinerScripts['css'].length; pCount++)
																{
																	this.aHeadCssfiles[document.aCoreCombinerScripts['css'][pCount]] = document.aCoreCombinerScripts['css'][pCount];
																}
															}
															if ('undefined' !== typeof(document.aCoreCombinerScripts['js']))
															{
																for (var pCount = 0; pCount < document.aCoreCombinerScripts['js'].length; pCount++)
																{
																	this.aHeadJavascripts[document.aCoreCombinerScripts['js'][pCount]] = document.aCoreCombinerScripts['js'][pCount];
																}
															}
															if ('undefined' !== typeof(document.aCoreCombinerScripts['meta']))
															{
																for (var pCount = 0; pCount < document.aCoreCombinerScripts['meta'].length; pCount++)
																{
																	this.aHeadMetaTags[document.aCoreCombinerScripts['meta'][pCount]] = document.aCoreCombinerScripts['meta'][pCount];
																}
															}
														}
														for (var iChildPointer in this.oHeadElement.childNodes)
														{
															if ("indexOf" !== iChildPointer)
															{
																var oChildNode = this.oHeadElement.childNodes[iChildPointer];
																switch (oChildNode.tagName)
																{
																	case 'LINK':
																	{
																		this.aHeadCssfiles[oChildNode.href] = oChildNode.href;
																	}
																	break;

																	case 'META':
																	{
																		this.aHeadMetaTags[oChildNode.name] = oChildNode.name
																	}
																	break;

																	case 'SCRIPT':
																	{
																		if ("" !== oChildNode.src)
																		{
																			this.aHeadJavascripts[oChildNode.getAttribute("src")] = oChildNode.getAttribute("src");
																		}
																	}
																	break;

																	default:
																	{
																		// alert(oChildNode.tagName); // Enable this to find out more about other head childs.
																	}
																	break;
																}
															}
														}
													}
												};

		this.cancelRequest					=	function()
												{
													if (0 != this.oHttpRequest.readyState)
													{
														this.oHttpRequest.abort();
													}
												}

		this.httpRequest					=	function(sUrl, mCallbackFunction, mCustomErrorFunction)
												{
													this.cancelRequest();
													if (null !== this.oHttpRequest)
													{
														this.oHttpRequest.onreadystatechange 		= 		function()
																											{
																												return oThisReference.onReadyStateChange();
																											}
													}

													if (null === this.oHttpRequest || "undefined" === typeof(sUrl))
													{
														return;
													}

													if ("undefined" === typeof(mCallbackFunction))
													{
														mCallbackFunction = null;
													}

													if ("undefined" === typeof(mCustomErrorFunction))
													{
														mCustomErrorFunction = null;
													}
													
													this.sLastUrl = sUrl;
													this.mCallbackFunction = mCallbackFunction;
													this.mCustomErrorFunction = mCustomErrorFunction;

													if(sUrl.length > this.iMaxUrlLength)
													{
														this.eMethod	=	this.POST;
													}

													var sData = null;
													if (this.eMethod === this.POST)
													{
														if ( "" === this.sFormData )
														{
															var aData = sUrl.split("?");
															sUrl = aData[0];
															var iSplitCount = aData.length;
															sData = "";
															for (var pCount = 1; pCount < iSplitCount; pCount++)
															{
																if (sData !== "")
																{
																	sData += "&";
																}
																sData += aData[pCount];
															}
														}
														else
														{
															sData = this.sFormData;
														}
													}

													this.bCallbackFunctionExecuted = false;
													this.bCustomErrorFunctionExecuted = false;
													/**
													 * The third means ASynchronious. so invert the boolean value of the this.bSynchroniousCall flag
													 */
													this.oHttpRequest.open(this.eMethod, sUrl, !this.bSynchroniousCall);

													if ( true === this.bUseXRequestedWithHeader )
													{
														this.oHttpRequest.setRequestHeader("X-Requested-With", "XMLHttpRequest");
													}
													switch (this.eMethod)
													{
														case this.POST:
														{
															this.oHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
														}
														break;

														default:
														case this.GET:
														{

														}
														break;
													}

													this.oHttpRequest.send( sData );

													/**
													 * By SynchroniousCall fired the onReadyStateChange event
													 */
													if ( true === this.bSynchroniousCall && false === this.bCallbackFunctionExecuted )
													{
														return this.onReadyStateChange();
													}
													return true;
												}

		this.setShowErrorMessage 			= 	function( bShow )
												{
													if ("undefined" === typeof(bShow) || true !== bShow)
													{
														bShow = false;
													}
													this.bShowErrorMessage = bShow;
												}

		this.setShowErrorMessageInStatusBar	= 	function( bShow )
												{
													if ("undefined" === typeof(bShow) || true !== bShow)
													{
														bShow = false;
													}
													this.bShowErrorMessageInStatusBar = bShow;
												}

		this.getLastState 					= 	function()
												{
													return this.getMessage( this.oHttpRequest.status, this.sLastUrl, this.bShowErrorMessage );
												}

		this.getMessage						=	function(iStatus, sUrl, bForcedShow)
												{
													if ("undefined" === typeof(iStatus))
													{
														iStatus = false;
													}

													if ("undefined" === typeof(sUrl))
													{
														sUrl = "";
													}

													if ("undefined" === typeof(bForcedShow))
													{
														bForcedShow = false;
													}

													if (true === bForcedShow)
													{
														if (false === this.bShowErrorMessageInStatusBar || true === bForcedShow )
														{
															var sErrorMessage = "coreAjax error\n\nThere was a problem with the request.\n";

															sErrorMessage += "Category: ";

															sErrorMessage += this.aStatusCategories[floor(iStatus / 100)];

															sErrorMessage += "\nCode: " + iStatus + "\n";
															sErrorMessage += "Description: ";

															if ("undefined" !== typeof(this.aStateDescriptions[iStatus.toString()]))
															{
																sErrorMessage += this.aStateDescriptions[iStatus.toString()];
															}
															else
															{
																sErrorMessage += "Unknow";
															}

															sErrorMessage += "\nURI: " + sUrl;

															alert(	sErrorMessage );
														}
														else
														{
															window.status = "coreAjax error: " + iStatus;

															if ( this.aStateDescriptions[iStatus.toString()] )
															{
																window.status += " - " + this.aStateDescriptions[iStatus.toString()];
															}
														}
													}
													return iStatus;
												}

		this.setMethod						=	function(eMethod)
												{
													if ("undefined" === typeof(eMethod))
													{
														eMethod = this.POST;
													}
													switch (eMethod)
													{
														case this.GET:
														{
															this.eMethod	=	eMethod;
														}
														break;

														case this.POST:
														default:
														{
															this.eMethod	=	this.POST;
														}
														break;
													}
												}

		this.setResponseType				=	function(eResponseType)
												{
													if ("undefined" === typeof(eResponseType))
													{
														eResponseType = this.POST;
													}
													switch (eResponseType)
													{
														case this.XML:
														{
															this.eResponseType	=	eResponseType;
														}
														break;

														case this.TEXT:
														default:
														{
															this.eResponseType	=	this.TEXT;
														}
														break;
													}
												}


		this.setFormData					=	function ( mData )
												{
													if ( "undefined" !== typeof( mData ) )
													{
														if ( "string" === typeof( mData ) )
														{
															this.sFormData = mData;
														}
													}
												}


		this.requestGetText					=	function(sUrl, mCallbackFunction, mCustomErrorFunction)
												{
													this.setMethod(this.GET);
													this.setResponseType(this.TEXT);
													this.bSynchroniousCall	=	false;
													return this.httpRequest(sUrl, mCallbackFunction, mCustomErrorFunction);
												}

		this.requestGetTextSynchrone		=	function(sUrl, mCallbackFunction, mCustomErrorFunction)
												{
													this.setMethod(this.GET);
													this.setResponseType(this.TEXT);
													this.bSynchroniousCall	=	true;
													return this.httpRequest(sUrl, mCallbackFunction, mCustomErrorFunction);
												}

		this.requestGetXml 					= 	function (sUrl, mCallbackFunction, mCustomErrorFunction)
												{
													this.setMethod(this.GET);
													this.setResponseType(this.XML);
													this.bSynchroniousCall	=	false;
													return this.httpRequest(sUrl, mCallbackFunction, mCustomErrorFunction);
												}

		this.requestGetXmlSynchrone			= 	function (sUrl, mCallbackFunction, mCustomErrorFunction)
												{
													this.setMethod(this.GET);
													this.setResponseType(this.XML);
													this.bSynchroniousCall	=	true;
													return this.httpRequest(sUrl, mCallbackFunction, mCustomErrorFunction);
												}

		this.requestPostText				= 	function (sUrl, mCallbackFunction, mData, mCustomErrorFunction)
												{
													if ( "undefined" !== typeof( mData ) && null !== mData )
													{
														this.setFormData( mData );
													}
													this.setMethod(this.POST);
													this.setResponseType(this.TEXT);
													this.bSynchroniousCall	=	false;
													return this.httpRequest(sUrl, mCallbackFunction, mCustomErrorFunction);
												}

		this.requestPostTextSynchrone		= 	function (sUrl, mCallbackFunction, mData, mCustomErrorFunction)
												{
													if ( "undefined" !== typeof( mData ) && null !== mData )
													{
														this.setFormData( mData );
													}
													this.setMethod(this.POST);
													this.setResponseType(this.TEXT);
													this.bSynchroniousCall	=	true;
													return this.httpRequest(sUrl, mCallbackFunction, mCustomErrorFunction);
												}

		this.requestPostXml					= 	function (sUrl, mCallbackFunction, mData, mCustomErrorFunction)
												{
													if ( "undefined" !== typeof( mData ) && null !== mData)
													{
														this.setFormData( mData );
													}
													this.setMethod(this.POST);
													this.setResponseType(this.XML);
													this.bSynchroniousCall	=	false;
													return this.httpRequest(sUrl, mCallbackFunction, mCustomErrorFunction);
												}

		this.requestPostXmlSynchrone		= 	function (sUrl, mCallbackFunction, mData, mCustomErrorFunction)
												{
													if ( "undefined" !== typeof( mData ) && null !== mData )
													{
														this.setFormData( mData );
													}
													this.setMethod(this.POST);
													this.setResponseType(this.XML);
													this.bSynchroniousCall	=	true;
													return this.httpRequest(sUrl, mCallbackFunction, mCustomErrorFunction);
												}

		this.request						= 	function (sUrl, mCallbackFunction, eMethod, mCustomErrorFunction)
												{
													if ("undefined" === typeof(eMethod) && null !== eMethod)
													{
														eMethod = this.POST;
													}
													this.setMethod(eMethod);
													this.setResponseType(this.OBJECT);
													this.bSynchroniousCall	=	true;
													return this.httpRequest(sUrl, mCallbackFunction, mCustomErrorFunction);
												}

		/* function got a 500 milisecond delay for browser rendering can be slower then javascript itself. */
		this.executeJavaScript				=	function()
												{
													var mExFunction = function() { oThisReference.actuallyExecuteJavaScript() };
													setTimeout(mExFunction, 50);
												}

		this.actuallyExecuteJavaScript		=	function()
												{
													var iScriptCount 	= this.aJavaScript.length;
													for (var pCount = 0; pCount < iScriptCount; pCount++)
													{
														try
														{
															eval(this.aJavaScript[pCount]);
														}
														catch (e)
														{
															//do nothing
														}
													}
												}

		this.setLoadingImage			=	function(sImage)
											{
												this.sLoadingImage = sImage;
											}

		this.getLoadingImage			=	function(sLoadingText)
											{
												if ("undefined" === typeof(sLoadingText))
												{
													sLoadingText = this.sLoadingText;
												}
												if (null === this.oLoadingImage)
												{
													this.oLoadingImage				=	document.createElement("div");
													this.oLoadingImage.className	=	"loadingContainer";

													this.oImageContainer			=	document.createElement("div");
													this.oImageContainer.className	=	"loadingImageContainer";

													this.oImg						=	document.createElement("img")
													this.oImg.className				=	"loadingImage";
													this.oImg.src					=	this.sLoadingImage;
													this.oImg.alt					=	sLoadingText;

													this.oTextContainer				=	document.createElement("div");
													this.oTextContainer.className	=	"loadingTextContainer";
													this.oTextContainer.innerHTML 	= 	sLoadingText;
												}
												else
												{
													this.oLoadingImage.innerHTML 	= "";
													this.oImageContainer.innerHTML 	= "";
													this.oTextContainer.innerHTML 	= sLoadingText;
												}
												this.oImageContainer.appendChild(this.oImg);
												this.oLoadingImage.appendChild(this.oImageContainer);
												this.oLoadingImage.appendChild(this.oTextContainer);
												return this.oLoadingImage;
											}
		
		this.setErrorImage			=	function(sImage)
		{
			this.sErrorImage = sImage;
		}
		
		this.getErrorImage			=	function(sErrorText)
		{
			if ("undefined" === typeof(sErrorText))
			{
				sErrorText = this.sErrorText;
			}
			if (null === this.oLoadingImage)
			{
				this.oLoadingImage				=	document.createElement("div");
				this.oLoadingImage.className	=	"errorContainer";
				
				this.oImageContainer			=	document.createElement("div");
				this.oImageContainer.className	=	"errorImageContainer";
				
				this.oImg						=	document.createElement("img")
				this.oImg.className				=	"errorImage";
				this.oImg.src					=	this.sErrorImage;
				this.oImg.alt					=	sErrorText;
				
				this.oTextContainer				=	document.createElement("div");
				this.oTextContainer.className	=	"ErrorTextContainer";
				this.oTextContainer.innerHTML 	= 	sErrorText;
			}
			else
			{
				this.oLoadingImage.innerHTML 	= "";
				this.oImageContainer.innerHTML 	= "";
				this.oTextContainer.innerHTML 	= sErrorText;
			}
			this.oImageContainer.appendChild(this.oImg);
			this.oLoadingImage.appendChild(this.oImageContainer);
			this.oLoadingImage.appendChild(this.oTextContainer);
			return this.oErrorImage;
		}
	}

