var xmlHttp;

function ajaxx ( section , container , thedata )
{
	document.getElementById( container ).innerHTML = "<center><img src='/imagez/anidot_bordo.gif' width='9' height='9' border='0' style='padding: 0px;'></center>";

	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)
	 {
	 alert ("Tarayıcınız malesef Ajax'ı desteklemiyor");
	 return
	 } 

	var url="/common/ajax.k?s=" + section + "&c=" + container + "&d=" + thedata;

	xmlHttp.onreadystatechange = function() {
		if ( ( xmlHttp.readyState == 4 && xmlHttp.status == 200 ) || xmlHttp.readyState=="complete" ) {

			if (xmlHttp.responseText.length > 0)
			{
				document.getElementById( container ).innerHTML = xmlHttp.responseText;
			} else {
				document.getElementById( container ).innerHTML = ""; 
			}

		} else {
			document.getElementById( container ).innerHTML = "<center><img src='/imagez/microloading.gif' width='10' height='10' border='0' style='padding: 4px;'></center>";
		}
	}

	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}

function AraBul ( d , s , a , i, n )
{
   if ( n === undefined ) { n = ""; } //opsiyonel parametre işlemi

	if ( a.length < 2 )
	 { 
		document.getElementById( d ).innerHTML="<!-- empty -->";
		document.getElementById( d ).style.visibility = "hidden";
		 return
	 } else { document.getElementById( d ).innerHTML = "<center><img src='/imagez/load.gif' style='padding : 10px;'></center>"; }

	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)
	 {
	 alert ("Tarayıcınız malesef Ajax'ı desteklemiyor");
	 return
	 } 

	var url="/common/ara.k?s=" + s + "&a=" + a + "&i=" + i + "&d=" + d  + "&n=" + n;

	xmlHttp.onreadystatechange = function() {
		if ( ( xmlHttp.readyState == 4 && xmlHttp.status == 200 ) || xmlHttp.readyState=="complete" ) {

			if (xmlHttp.responseText.length > 0)
			{
				document.getElementById( d ).innerHTML = xmlHttp.responseText;
				document.getElementById( d ).style.visibility = "visible";		
			} else {
				document.getElementById( d ).innerHTML = "<!-- empty -->"; 
				document.getElementById( d ).style.visibility = "hidden";
			}

		} else {
			document.getElementById( d ).innerHTML = "<center><img src='/imagez/load.gif' style='padding : 10px;'></center>";
		}
	}

	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

} 

function AraBul_Kapat ( d )
{
	document.getElementById( d ).innerHTML = "<!-- empty -->"; 
	document.getElementById( d ).style.visibility = "hidden";
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
 
