function CreateXmlHttpObject()
{
	var xmlHttp;
	
	try
	{  
		xmlHttp = new XMLHttpRequest();  
	}
	catch (e)
	{  
		try
		{    
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");    
		}
		catch (e)
		{    
			try
	  		{      
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");      
			}
			catch (e)
	  		{      
				return null;      
			}    
		}  
	}
			
	return xmlHttp;
} 

function VerificaWCCOnline() {
	var obj = CreateXmlHttpObject();

	obj.onreadystatechange = function() {
		if (obj.readyState == 4 && obj.status == 200)
		{
			if (obj.responseText != '')
			{
				var div = document.getElementById('wcconline');
				//var a1 = document.getElementById('aimg');
				//var a2 = document.getElementById('adesc');
				
				if (parseInt(obj.responseText) > 0)
				{
					div.innerHTML = '<font face="Arial Black" size="3" color="green">' +
						'</br><center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ONLINE</center></font>';
						
					div.onclick = function(){
						window.open('wcc/talk.php', 'wcc', 'status=false, scrollbars=true, location=false, toolbar=false, directories=false, menubar=false, left=200, top=100, resizeable=false, width=370, height=300');	
					}
					
						
					/*var wcc = window.open('wcc/talk.php', 'wcc', 'status=false, scrollbars=true, location=false, toolbar=false, directories=false, menubar=false, left=200, top=100, resizeable=false, width=370, height=300'); 
					
					wcc.focus();*/
				}
				else
					div.innerHTML = '<font face="Arial Black" size="3" color="red"></br><center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OFFLINE</center>';
			}
		}
	}

	obj.open("GET", "wcc/online.php", true);
	obj.send(null);
}
