	dataKey=new Array();
	dataValue=new Array();
	sendmethod="POST";
	postData="";
	Obje=null;
	Gonderildi=0;
	islem="";
	path="";
	function gonder()
	{
		path=DataBirlestir(path);
		Obje=getXMLHttpRequest();
		if (Obje !== null) 
		{
			Obje.open(sendmethod, path, true);
			Obje.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
			Obje.onreadystatechange = handler;
			Obje.send(postData);
		}
		else 
		{
			window.alert("AJAX (XMLHTTP) bulunamadi.");
		}
	}
	
	function getXMLHttpRequest() 
	{
		if (window.XMLHttpRequest) 
		{
			return new window.XMLHttpRequest;
		}
		else 
		{
			try 
			{
				return new ActiveXObject("MSXML2.XMLHTTP.3.0");
			}
			catch(ex) 
			{
				return null;
			}
		}
	}
	function handler()
	{
		if (Obje.readyState == 4 /* complete */) 
		{
			if (Obje.status == 200) 
			{
				if(islem=="bayi") bayi_isle(Obje.responseText);
				else isle(Obje.responseText);
			}
		}
	}
	function isle(deger)
	{
		if(deger==1){alert(alertbasarili); Gonderildi=1; }
		else{alert(alertbasarisiz);}
	}
	
	function bayi_isle(deger)
	{
	  
	   var bayialan=document.getElementById("bayi_alan");
	   if(deger==1 && bayialan)
	   {
		   location="index.php";
		   bayialan.innerHTML="<a href=\"#\">Giriş Yapılıyor Lütfen Bekleyin...</a>"; 
	   }
	   else if(deger=="" && bayialan){bayialan.innerHTML="<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"right\"><tr><td style=\"padding-right:5px;\">Kullanıcı Adınız <input type=\"text\" name=\"bayi_adi\" id=\"bayi_adi\" class=\"bayitext\" onfocus=\"this.className='bayitextfocus';\" onblur=\"this.className='bayitext';\" /></td><td style=\"padding-right:5px;\">Şifreniz <input type=\"password\" name=\"bayi_sifre\" class=\"bayitext\" id=\"bayi_sifre\" value=\"\" onfocus=\"this.className='bayitextfocus';\" onblur=\"this.className='bayitext';\" /></td><td class=\"bayi_giris_btn\" onclick=\"javascript:bayi_giris();\">Giriş</td></tr></table>";window.location="index.php";}
	}
	
	function DataEkle(key,value)
	{
		var lensayac=dataKey.length;
		dataKey[lensayac]=dataDonustur(key);
		dataValue[lensayac]=dataDonustur(value);
	}
	function DataBirlestir(path)
	{
		for(var i=0; i<dataKey.length;i++)
		{
			if(i==0){path+="?";}
			else{path+="&";}
			path+=dataKey[i]+"="+dataValue[i];
		}
		return path;
	}
	
	function dataDonustur(data)
	{
		
		data=data.replace("ç","%C3%A7");
		data=data.replace("ğ","%C4%9F");
		data=data.replace("ı","%C4%B1");
		data=data.replace("ö","%C3%B6");
		data=data.replace("ş","%C5%9F");
		data=data.replace("ü","%C3%BC");
		data=data.replace("Ç","%C3%87");
		data=data.replace("Ğ","%C4%9E");
		data=data.replace("İ","%C4%B0");
		data=data.replace("Ö","%C3%96");
		data=data.replace("Ş","%C5%9E");
		data=data.replace("Ü","%C3%9C");
		return data;
	}
