var AjaxActive = false;
var AjaxActions = new Array();
function AjaxPost()
{
	this.Url = '';
	this.Parameters = '';
	this.Request = false;
	this.Result = '';
	this.AjaxObject = '';
	this.ResponseFunction = getResponse;
	this.OgeNo = '';
	this.fStartAction = startAction;
	this.fGetResponse = getResponse;
}
function startAction( a, b, c, d )
{
	this.Url = a;
	this.Parameters = b;
	this.OgeNo = d;
	if ( window.XMLHttpRequest )
	{ // Mozilla, Safari,...

		this.Request = new XMLHttpRequest();

		if ( this.Request.overrideMimeType )
			this.Request.overrideMimeType('text/xml; charset=UTF-8');
	}
	else if ( window.ActiveXObject )
	{ // IE

		try
		{
			this.Request = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				this.Request = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				//Nothing
			}
		}
	}

	if ( !this.Request )
	{
		alert('Bağlantı hatası oluştu. Lütfen tekrar deneyiniz.');
		window.location = window.location;
		return false;
	}

	var MyClass = this;
	this.Request.onreadystatechange = function() {
		if ( MyClass.Request.readyState == 4 )
		{

			if ( MyClass.Request.status == 200 )
			{
				MyClass.ResponseFunction(MyClass.Request.responseText);
			}
			else
				MyClass.ResponseFunction(false);
		}
	};

	this.Request.open( "POST", this.Url, true );
	this.Request.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" );
	this.Request.setRequestHeader( "Content-length", this.Parameters.length );
	this.Request.setRequestHeader( "Connection", "close" );
	this.Request.send( this.Parameters );
}

function fixAjax(Data)
{
	return escape(Data);
}

function getResponse(Result){
	alert('Bir hata oluştu.\n' + Result);
}