// AJAX
function refresh()
{
	getXHRText( 'statsData.php', refresh2 );
	setTimeout( refresh, 4000 );
}

function refresh2( sText )
{
	obDiv = document.getElementById( "stats" );
	obDiv.innerHTML = sText;
}

/**** getXMLRefObject *********************************************************
 *
 * Purpose  	This function will get a reference of the XMLHTTPRequest
 * 		object if it can.
 * Params
 * Return	reference to an XMLHTTPRequest object or NULL
 * 		
 *****************************************************************************/
 function getXMLRefObject()
 {

	var obXHR = null;

	if (window.XMLHttpRequest)
	{
		
		obXHR = new window.XMLHttpRequest();
	}
	else
	{
		//IE Stuff
		if (window.ActiveXObject)
		{
			obXHR = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return obXHR;
}

/**** getXHRText **************************************************************
 *
 * Purpose  This function will be used to retrieve some text from a specified
 *          URL utilizing the XMLHTTPRequest Object and the GET protocol
 * Params   sURL -       url of the website to contact
 *          sCallBack -  function which is to be called when the response text
 *                       is returned from our object
 * 		
 *****************************************************************************/
function getXHRText( sURL, sCallBack )
{
    obXHR = getXMLRefObject();
    
    if( obXHR )
    {
        obXHR.open( "GET", sURL );
        obXHR.onreadystatechange = function()
        {
            if( obXHR.readyState == 4 && obXHR.status == 200 )
            {
                sCallBack( obXHR.responseText );
                delete( obXHR );
            }
        }
        obXHR.send( null );
    }
}

/** disable right click function ***********************************\
|																	|
|	These functions and variables are used to disable the right		|
|	click function on the pages.									|
|																	|
\*******************************************************************/
function clickIE4()
{
	if (event.button==2)
	{
		alert(message);
		return false;
	}
}

function clickNS4(e)
{
	if (document.layers||document.getElementById&&!document.all)
	{
		if (e.which==2||e.which==3)
		{
			alert(message);
			return false;
		}
	}
}

var message="Estevan Skate has disabled this function!";

if (document.layers)
{
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById)
{
	document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")