function kdv(file) {
	this.xmlnhttp = null;

	this.sifirdegerveri = function() {
		this.metod = "POST";
  		this.Separator = "?";
		this.olaySeparator = "&";
		this.URLbirim = "";
		this.enkodeURIbirim = true;
  		this.calistir = false;
  		this.element = null;
		this.elementObj = null;
		this.DosyaIstek = file;
		this.degers = new Object();
		this.responseStatus = new Array(2);
  	};

	this.sifirdegerfonk = function() {
  		this.Yuklenirken = function() { };
  		this.Yuklendi = function() { };
  		this.AktifDegil = function() { };
  		this.Tamamlanmis = function() { };
  		this.hatali = function() { };
		this.yapilamadi = function() { };
	};

	this.reset = function() {
		this.sifirdegerfonk();
		this.sifirdegerveri();
	};

	this.AjaxOlustur = function() {
		try {
			this.xmlnhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				this.xmlnhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				this.xmlnhttp = null;
			}
		}

		if (! this.xmlnhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				this.xmlnhttp = new XMLHttpRequest();
			} else {
				this.dustu = true;
			}
		}
	};

	this.olusturURLbirim = function(URLbirim) {
		if (this.enkodeURIbirim && this.URLbirim.length) {
			this.yapURLbirim(this.URLbirim, true);
		}

		if (URLbirim) {
			if (this.URLbirim.length) {
				this.URLbirim += this.olaySeparator + URLbirim;
			} else {
				this.URLbirim = URLbirim;
			}
		}
		URLbirimgecici = new Array();
		for (key in this.degers) {
			if (false == this.degers[key][1] && true == this.enkodeURIbirim) {
				enkoded = this.encVar(key, this.degers[key][0], true);
				delete this.degers[key];
				this.degers[enkoded[0]] = Array(enkoded[1], true);
				key = enkoded[0];
			}

			URLbirimgecici[URLbirimgecici.length] = key + "=" + this.degers[key][0];
		}
		if (URLbirim){
			this.URLbirim += this.olaySeparator + URLbirimgecici.join(this.olaySeparator);
		} else {
			this.URLbirim += URLbirimgecici.join(this.olaySeparator);
		}
	}

	this.IstekCalistir = function() {
		eval(this.response);
	}

	this.runAJAX = function(URLbirim) {
		if (this.dustu) {
			this.yapilamadi();
		} else {
			this.olusturURLbirim(URLbirim);
			if (this.element) {
				this.elementObj = document.getElementById(this.element);
			}
			if (this.xmlnhttp) {
				var tekil = this;
				if (this.metod == "GET") {
					toplamURLbirim = this.DosyaIstek + this.Separator + this.URLbirim;
					this.xmlnhttp.open(this.metod, toplamURLbirim, true);
				} else {
					this.xmlnhttp.open(this.metod, this.DosyaIstek, true);
					try {
						this.xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=ISO-8859-9');
						this.xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;language=tr');
						
						
					} catch (e) { }
				}

				this.xmlnhttp.onreadystatechange = function() {
					switch (tekil.xmlnhttp.readyState) {
						case 1:
							tekil.Yuklenirken();
							break;
						case 2:
							tekil.Yuklendi();
							break;
						case 3:
							tekil.AktifDegil();
							break;
						case 4:
							tekil.response = tekil.xmlnhttp.responseText;
							tekil.responseXML = tekil.xmlnhttp.responseXML;
							tekil.responseStatus[0] = tekil.xmlnhttp.status;
							tekil.responseStatus[1] = tekil.xmlnhttp.statusText;

							if (tekil.calistir) {
								tekil.IstekCalistir();
							}

							if (tekil.elementObj) {
								objeDisim = tekil.elementObj.brnIsım;
								objeDisim.toLowerCase();
								if (objeDisim == "input"
								|| objeDisim == "select"
								|| objeDisim == "option"
								|| objeDisim == "textarea") {
									tekil.elementObj.value = tekil.response;
								} else {
									tekil.elementObj.innerHTML = tekil.response;
								}
							}
							if (tekil.responseStatus[0] == "200") {
								tekil.Tamamlanmis();
							} else {
								tekil.hatali();
							}

							tekil.URLbirim = "";
							break;
					}
				};

				this.xmlnhttp.send(this.URLbirim);
			}
		}
	};

	this.reset();
	this.AjaxOlustur();
}


var ajax = new kdv();
var OyunListeObj;
var AktifOyun = false;
var KliklenmisOyun = false;
var guncelnesne

function FareUstOyun()	
{
	if(this==KliklenmisOyun)return;
	if(AktifOyun && AktifOyun!=this){
		if(AktifOyun==KliklenmisOyun)
			AktifOyun.className='OyunKlik';
		else
			AktifOyun.className='';
		
	}
	this.className='OyunFareUst';
	AktifOyun = this;
}

function IcerikGoster()
{
	guncelnesne.innerHTML = ajax.response;
}

function YukleniyorMesaji()
{
	guncelnesne.innerHTML = '<span style=" background-color:#FFFFFF; padding:1px;overflow: hidden;"><img src="./images/yukleniyor.gif" height="32" width="32" border="0"></span><br>Yükleniyor..';
}
function AjaxDosyaCagir(Dosyaadi)
{
	ajax.DosyaIstek = Dosyaadi;
	ajax.Tamamlanmis = IcerikGoster;
	ajax.Yuklenirken = YukleniyorMesaji;
	ajax.runAJAX();
}

function seciliOyun()
{
	AjaxDosyaCagir('?islem=ajax&id=' +this.id );	
	if(KliklenmisOyun && KliklenmisOyun!=this)KliklenmisOyun.className='OyunFareUst';
	this.className='OyunKlik';
	KliklenmisOyun = this;
}


function comAjaxIslem()
{
	OyunListeObj = document.getElementById('OyunListe');
	var oyun = OyunListeObj.getElementsByTagName('LI');
	for(var no=0;no<oyun.length;no++){
		oyun[no].onmouseover = FareUstOyun;
		oyun[no].onclick = seciliOyun;
	}	
	
	guncelnesne = document.getElementById('OyunEfekt');
}

