//AJAX Object
function getHTTPObject() {
    if (typeof XMLHttpRequest != 'undefined') {
        return new XMLHttpRequest();
    }
    try {
        return new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            return new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {}
    }
    return false;
}
var http = getHTTPObject();

function updateSpeed(){
	//alert('howdy');
	var myurl = "includes/gettx.php?junk="+Math.random();
	http.open("GET", myurl , true);
	http.onreadystatechange = writeSpeed;
	http.send(null); 
}

function writeSpeed(){
	if (http.readyState == 4){
		document.getElementById('transferSpeed').innerHTML = http.responseText
	}	
}

function dismissIPConflict(a)
{
	void(a);
	
	var myurl = "includes/ipConflict.php?remove&junk="+Math.random();
	http.open("GET", myurl , true);
	http.onreadystatechange = function()
	{
		if ( http.readyState == 4 )
		{
			var p = a.parentNode.parentNode; p.parentNode.removeChild(p);
		}
	};
	http.send(null); 
}

//window.onload = updateSpeed;

function submitLogin(e)
{
    var KeyPress 
    if(e && e.which)
    {
        e = e
        KeyPress = e.which
    }
    else
    {
        e = event
        KeyPress = e.keyCode
    }
    //13 is the key code of enter key
    if(KeyPress == 13)
    {
        document.login.submit()
        return false    
    }
    else
    {
        return true
    }
}
