
function requestAJAX(sorgula, yereyaz)
	{ 
	var req = null; 
	document.getElementById(yereyaz).innerHTML = "....";
	if (window.XMLHttpRequest)
		{
		req = new XMLHttpRequest();
/*		if (req.overrideMimeType) 
			{
			req.overrideMimeType('text/xml');
			}*/
		} 
	else if (window.ActiveXObject) 
		{
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch (e) {}
			}
	      	}
	req.onreadystatechange = function()
		{ 
		document.getElementById(yereyaz).innerHTML = "<IMG SRC='images/ajax_loader.gif' WIDTH='16' HEIGHT='16' BORDER='0' ALT='Yükleniyor'>";
		if(req.readyState == 4)
			{
			if(req.status == 200)
				{
				document.getElementById(yereyaz).innerHTML = req.responseText;	
				}	
			else	
				{
				document.getElementById(yereyaz).innerHTML = "Hata Oluştu";
				//document.getElementById(yereyaz).innerHTML = "Error: returned status code " + req.status + " " + req.statusText;
				}	
			} 
		}; 
	req.open("GET", sorgula, true); 
	//req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
    req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-9"); 
	//req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 
	req.send(null); 
	} 




/**
*
*  AJAX IFRAME METHOD (AIM)
*  http://www.webtoolkit.info/
*
**/

AIM = {

    frame : function(c) {

        var n = 'f' + Math.floor(Math.random() * 99999);
        var d = document.createElement('DIV');
        d.innerHTML = '<iframe style="display:none" src="about:blank" id="'+n+'" name="'+n+'" onload="AIM.loaded(\''+n+'\')"></iframe>';
        document.body.appendChild(d);

        var i = document.getElementById(n);
        if (c && typeof(c.onComplete) == 'function') {
            i.onComplete = c.onComplete;
        }

        return n;
    },

    form : function(f, name) {
        f.setAttribute('target', name);
    },

    submit : function(f, c) {
        AIM.form(f, AIM.frame(c));
        if (c && typeof(c.onStart) == 'function') {
            return c.onStart();
        } else {
            return true;
        }
    },

    loaded : function(id) {
        var i = document.getElementById(id);
        if (i.contentDocument) {
            var d = i.contentDocument;
        } else if (i.contentWindow) {
            var d = i.contentWindow.document;
        } else {
            var d = window.frames[id].document;
        }
        if (d.location.href == "about:blank") {
            return;
        }

        if (typeof(i.onComplete) == 'function') {
            i.onComplete(d.body.innerHTML);
        }
    }

}
