

  var http = false;
   try {
     http = new XMLHttpRequest();
   } catch (trymicrosoft) {
     try {
       http = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (othermicrosoft) {
       try {
         http = new ActiveXObject("Microsoft.XMLHTTP");
       } catch (failed) {
         http = false;
       }  
     }
   }

   if (!http)
     alert("XMLHttpRequest nesnesi yüklenemiyor");
	 
 function Login () {
http.abort();
	 document.getElementById("logincontrol").innerHTML = "<center>Kontrol Ediliyor...</center>";
	 
	 var nickname = document.getElementById("username").value;	
	 var pass = document.getElementById("pass").value;	
	  http.open("POST", "index.php?isim="+nickname+"&sifre="+pass, true);
	http.onreadystatechange=function() {
        if(http.readyState == 4) {
		  var gelenstr=http.responseText.split("|");
		  
		document.getElementById("logincontrol").innerHTML = gelenstr[0];
		if(gelenstr[0]=="Giriş..Ok"){window.location.href='index_sub.php';}
		
		  
         	  
        }
      }
      http.send(null);
    }

function kampanya(kmno)
{
	http.abort();

document.getElementById("kampanx").innerHTML = '<img src=images/icons/ajax-loader.gif align=right>';
	
 http.open("POST", "index.php?kampg="+kmno,true);
 http.onreadystatechange=function() {
        if(http.readyState == 4) {
		  var gelenstr=http.responseText.split("|");
		  
		document.getElementById("kampanx").innerHTML = gelenstr[0];
		
		  
         	  
        }
      }
      http.send(null);
    }

var c=0
var t
function autoKampanya()
{
	if(c==5){c=0;}
	kampanya(c);
document.getElementById('txt').value=c;
c=c+1;
t=setTimeout("autoKampanya()",2000);

}
function stopCount()
{
clearTimeout(t);
}

