function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				req = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
    }
	
function refresh() {
	
	var URL = "index.php?option=com_ajaxchat&task=refresh&no_html=1";
	var req = getXMLHTTP();
    if (req)
   		{
     		req.onreadystatechange = function()
     		{
      			if (req.readyState == 4)
      				{
					//	alert('req.state');
			//		alert(req.responseText);
			                          if (document.getElementById('ajaxchat'))
									 {
                                     document.getElementById('ajaxchat').innerHTML=req.responseText;
									 }


					}
			}
		}
   req.open("GET", URL, true);
   req.send(null);
	
}
refresh();
setInterval('refresh()',10000);
function preview(user) {

jQuery('#ChatUsers li').cluetip({
  showTitle: false,
   topOffset:  5,
   dropShadow:       true, 
   sticky:           true,
   width: 300,
   mouseOutClose: true,
   leftOffset: 2
  });
	
}

