var add = -300;

var xmlHttp = createXmlHttpRequestObject();

var prevChat = "";

//--------------------------------------------------------------------//
function subo(){

 callTalk();

}//subo
//--------------------------------------------------------------------//
function callTalk(){

 setTimeout(callTalk, 30000); //30 mp

 var get_page = "http://chatfoto.hu/c6/subo.php";

 if(xmlHttp){        
          
  xmlHttp.open("GET", get_page, true);                                                                                                        
  xmlHttp.onreadystatechange = getChatResponse;
  xmlHttp.send(null);

 }//if  

}//callTalk
//--------------------------------------------------------------------//
function getChatResponse(){

 if(xmlHttp.readyState == 4){

  var resp = xmlHttp.responseText;

  if(prevChat != resp){

   document.getElementById("slider").innerHTML = resp;
   prevChat = resp;

  }//if  

 }//if 

}//getChatContentResponse
//--------------------------------------------------------------------//
function createXmlHttpRequestObject(){

  var xmlHttp;
  
  try{
    xmlHttp = new XMLHttpRequest();
  }
  catch(e){

    var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0",
                                    "MSXML2.XMLHTTP.5.0",
                                    "MSXML2.XMLHTTP.4.0",
                                    "MSXML2.XMLHTTP.3.0",
                                    "MSXML2.XMLHTTP",
                                    "Microsoft.XMLHTTP");

    for(var i=0; i<XmlHttpVersions.length && !xmlHttp; i++){

      try{ 
        xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
      } 
      catch(e){}
    
    }//for
  }//catch

  if(!xmlHttp){
   //alert("Error creating the XMLHttpRequest object.");
   return;
  }

  else{
   //alert("successfully created XMLHttp object");
   return xmlHttp;
  }

}//createXmlHttpRequestObject
//--------------------------------------------------------------------//
function slide(){

 setInterval("dropIn()", 20);

 var sl = document.getElementById("slider");

 sl.style.bottom = -300;

}//slide
//--------------------------------------------------------------------//
function dropIn(){

 var sl = document.getElementById("slider");
 
 if(add < 0){

  add = add + 10;
  sl.style.bottom = add;

 }//if

}//dropIn
//--------------------------------------------------------------------//
