function getXmlHttp() {
	var xmlHttp = null;
	try {
		xmlHttp = new XMLHttpRequest();
	} catch (e) {
		var progIds = ['Microsoft.XMLHTTP', 'MSXML2.XMLHTTP', 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0']
		var success = false;
		for (var iterator = 0; (iterator < progIds.length) && ( ! success); iterator ++) {
			try {
				xmlHttp = new ActiveXObject(progIds[iterator]);
				success = true;
			} catch (e) {}
		}
		if ( ! success ) {
			return null;
		}
	}
	return xmlHttp;
}

function times(refreshtime) {
setInterval("total_publisher()", refreshtime);
}

function total_publisher() {
    xmlHttp = getXmlHttp();
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState == 4) {
			if(xmlHttp.status == 200) {
if(xmlHttp.responseText=='ERROR') {
return false;
} else {
document.getElementById('total_publisher').innerHTML=xmlHttp.responseText;
}


}
}
};
xmlHttp.open('GET', 'publicstats.php', true); 
xmlHttp.send(null);
}

function login() { 
    var form = document.loginform;    

   if (!form.username.value) {   
       alert("Lütfen Kullanıcı Adınızı Giriniz");  
       form.username.focus();    
       return false;   
   }  
   if (!form.password.value) {  
       alert("Lütfen Şifrenizi Giriniz");       
       form.password.focus();    
       return false;   
   } else {
       return true;
   }
}

var win=null;
function PopUp(mypage,myname,w,h,pos,infocus){
  if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
  if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
  else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
  settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
win.focus();
}

function PopUp2(mypage,myname,w,h,pos,infocus){
  if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
  if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
  else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
  settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes";win=window.open(mypage,myname,settings);
win.focus();
}
