function Ajax()
{
 ajax = false;
 	var msxmlhttp = new Array(
	'Msxml2.XMLHTTP.5.0',
	'Msxml2.XMLHTTP.4.0',
	'Msxml2.XMLHTTP.3.0',
	'Msxml2.XMLHTTP',
	'Microsoft.XMLHTTP');
			//
  for (var i = 0; i < msxmlhttp.length; i++) 
	   {
		try {
			ajax = new ActiveXObject(msxmlhttp[i]);
			} 
			catch (e) 
			{
			 ajax = false;
			}
	    }
//
 if(!ajax && typeof XMLHttpRequest != 'undefined')
  {
   try{ajax = new XMLHttpRequest();}catch(e3){ajax=false;}
  }
   // Diger (IceBrowser)
 if( !ajax && window.createRequest )
 {
   try{
        ajax = window.createRequest();
      }
	   catch(e)
	   {  
        ajax = false;
      }
   }
return ajax;
}
function sendRequest() {
            var oForm = document.forms[0];
            var sBody = getRequestBody(oForm);
                    var oXmlHttp = new Ajax();
								 oXmlHttp.onreadystatechange = function () {
if (oXmlHttp.readyState == 1 || oXmlHttp.readyState == 2 || oXmlHttp.readyState == 3) {
				var yuklenen = '<img src="ajax/loading.gif" width="35" height="35" alt="Loading ..." /><br><span class="style10">Control The Form</span>';
			  document.getElementById('sonuc').innerHTML=yuklenen;
				}
}
            oXmlHttp.open("post", oForm.action, true);
            oXmlHttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
			oXmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
			oXmlHttp.onreadystatechange = function () {
                 if (oXmlHttp.readyState == 4) {
				    if (oXmlHttp.status == 200) {
var divStatus = document.getElementById("sonuc");
          divStatus.innerHTML = oXmlHttp.responseText;
						
                    } else {
                        saveResult("An error occurred: " + oXmlHttp.statusText);
                    }
}                
				            
            };
            oXmlHttp.send(sBody);        
        }
        
        function getRequestBody(oForm) {
            var aParams = new Array();
            
            for (var i=0 ; i < oForm.elements.length; i++) {
                var sParam = encodeURIComponent(oForm.elements[i].name);
                sParam += "=";
                sParam += encodeURIComponent(oForm.elements[i].value);
                aParams.push(sParam);
            } 
            
            return aParams.join("&");        
        }
		
