

      var instmsghttpObject = null;

      // Get the HTTP Object
      function getHTTPObject(){
         if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
         else if (window.XMLHttpRequest) return new XMLHttpRequest();
         else {
            alert("Dein Browser unterstützt leider kein AJAX.");
            return null;
         }
      }   


      // Implement business logic    
      function doinstmsgReload(){    
         instmsghttpObject = getHTTPObject();
         var randomnumber=Math.floor(Math.random()*10000);
         if (instmsghttpObject != null) {
            instmsghttpObject.open("GET", "pn_popup.php?newmsg&rnd="+randomnumber , true);
            instmsghttpObject.onreadystatechange = instmsgCheck;
            instmsghttpObject.send(null);
         }

      }


      function instmsgUpdateTimer() {
         doinstmsgReload();   
         chatTimerID = setTimeout("instmsgUpdateTimer()", 1000);
      }
    
    


      // Change the value of the outputText field
      function instmsgCheck(){

         if(instmsghttpObject.readyState == 4)
	 {

            var response = instmsghttpObject.responseText;
            var objDiv = document.getElementById('pnnewpns');
	    objDiv.innerHTML = "";
            if (response=="0")
	    {
	    }
	    else
	    {
//		show_Popup();
		if (response=="1")
			objDiv.innerHTML = response+" neue Nachricht";
		else if(response>"1")
			objDiv.innerHTML = response+" neue Nachrichten";
            }
	}

      }