
 pic1= new Image(18,18); 
 pic1.src="http://puaga.com/musim/i3/oldIncome.png"; 
 pic2= new Image(18,18); 
 pic2.src="http://puaga.com/musim/i3/newIncome.png"; 

 document.getElementById("onlinepeoplepopup").style.visibility = "hidden";

 var ActivityCount = 0;

 function toggleOnlinePeople() {
   if (document.getElementById("onlinepeoplepopup").style.visibility == "hidden") {
     getOnlinePeople();
     changeOPButton_open();
   } else {
     changeOPButton_closed();
   }
 }

 function changeOPButton_closed() {
   document.getElementById("onlinepeoplepopup").style.visibility = "hidden";
   document.getElementById("onlinepeople").className = "onlinepeople";
 }

 function changeOPButton_open() {
   document.getElementById("onlinepeople").className = "onlinepeopleopen";
 }

 function getOnlinePeople() {
   var xhr = createXHR();
   document.getElementById("onlinepeoplepopup").style.visibility = "visible";
   document.getElementById("onlinepeoplepopup").innerHTML = "<center><i>Bir saniye..</i></center>";
   xhr.open("GET", "/musim/subbar/onlinecheck.php?nocache=" + Math.random(),true);
   xhr.onreadystatechange=function() { if(xhr.readyState == 4) {
     document.getElementById("onlinepeoplepopup").innerHTML = xhr.responseText;
     document.getElementById("onlinepeoplepopup").style.visibility = "visible";
   } }
   xhr.send(null); 
   setTimeout("submitForm();",1500);
 }

 function submitOnline() {
   var xhr10 = createXHR();
   xhr10.open("GET", "/musim/subbar/meonline.php?nocache=" + Math.random(),true);
   xhr10.onreadystatechange=function() { if(xhr10.readyState == 4) {

   } }
   xhr10.send(null); 
   setTimeout("submitOnline();",3000);
 }
 
 function submitForm() {
   var xhr = createXHR();
   xhr.open("GET", "/musim/actions/listkiss_ajax.php?nocache=" + Math.random(),true);
   xhr.onreadystatechange=function() { if(xhr.readyState == 4) {
      ActivityCount=xhr.responseText;
      if(ActivityCount > 0) {
         LightUpB();
      } else {
         TurnOffB();
      }
   } }
   xhr.send(null); 
   setTimeout("submitForm();",1500);
 }

 function LightUpB() {
   document.getElementById("noticon").src="/musim/i3/newnotifications.png";
 }
 
 function TurnOffB() {
   document.getElementById("noticon").src="/musim/i3/nonotifications.png";
 }

