function submitenter(myfield,e)
{
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	if (keycode == 13)
	{
		Login(); //document.login.submit();
		return false;
	}
	else
		return true;
}


function HandleResponse(Result)
{

	try
	{
		tinyMCE.execCommand('mceRemoveControl', false, 'TxtText');
	}
	catch(e)
	{
	}

	document.getElementById('result_div').innerHTML = Result;



	try
	{
		DefaultTiny();	
		tinyMCE.execCommand('mceAddControl', false, 'TxtText');
	}
	catch(e)
	{
	}

} 

function create_http_object()
{
    var ActiveXTypes = [
        "Microsoft.XMLHTTP",
        "MSXML2.XMLHTTP.5.0",
        "MSXML2.XMLHTTP.4.0",
        "MSXML2.XMLHTTP.3.0",
        "MSXML2.XMLHTTP"
    ];

    for( var i = 0; i < ActiveXTypes.length; i++ )
    {
        try
        {
            return new ActiveXObject( ActiveXTypes[i] );
        }
        catch( e )
        { }
    }

    try
    {
        return new XMLHttpRequest();
    }
    catch( e )
    { }

    return false;
}



function make_request(url, callback_function, http_method, post_values, return_xml)
{
    http = create_http_object();

    if(!http)
    {
        alert('Uw browser ondersteunt dit script niet.');
        return false;
    }

    http.onreadystatechange = function()
    {
        if(http.readyState == 4)
        {
            if(http.status == 200)
            {
                if(callback_function)
                {
                    if(return_xml)
                    {
                        eval(callback_function + '(http.responseXML)');
                    }
                    else
                    {
                        eval(callback_function + '(http.responseText)');
                    }
                }
            }
            else
            {
                alert('Error! (' + http.status + ')');
            }
        }
    }

    if(!post_values)
    {
        post_values = null;
    }
    if(!http_method)
    {
        http_method = "GET";
    }

    http.open(http_method, url, true);

    if(http_method == "POST")
    {
        http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    }

    http.send(post_values);
} 
