// JavaScript Document

/*function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}*/

var xmlHttp

function online()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="getOnline.php"
url=url+"?sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

/*var newwindow;
function poptastic1(url,var2)
{
	var url1
	url1 = url;
	newwindow=window.open(url1, var2, 'toolbar=0, directories=0, location=0, status=0, menubar=0, resizable=0, scrollbars=0, width=590px, height=375px');
	if (window.focus) {newwindow.focus()}
}*/

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
if(xmlHttp.responseText != 1)	
{
var winTc=xmlHttp.responseText.split("=");
winT = winTc[2];
//poptastic1(xmlHttp.responseText,winT)	
window.focus()
//parent.document.commentForm
var stringss = "<a onclick=\"poptastic1('" + xmlHttp.responseText + "','" + winT + "')\" class=\"stylea\"><img src = \"images/user_chat.gif\" /></a>";
parent.document.getElementById('commentForm').innerHTML=stringss;
//alert(stringss);
}
} 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}