function mgtLogin_load(){
	mgt=new MGT();
	mgt.load();
}

function opacity(id, opacStart, opacEnd, millisec, beginfunc, endfunc) {
    //speed for each frame
    var speed = Math.round(millisec / Math.abs(opacStart-opacEnd) );
    var timer = 0;
		
		if( beginfunc != null )
			eval( beginfunc );

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
		
		if( endfunc != null ) setTimeout( endfunc, timer * speed );
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function disable_obj(id){
	var object = document.getElementById(id);
	if( object != null ) object.style.visibility = 'hidden';
}
function enable_obj(id){
	var object = document.getElementById(id);
	if( object != null ) object.style.visibility = 'visible';
}

function error_message(){
	opacity('error-message', 0, 90, 1000,"enable_obj('error-message')",null);
	opacity('screen', 0, 40, 1000,"enable_obj('screen')",null);	
	var $fade = "opacity('error-message', 90, 0, 1200,null,\"disable_obj('error-message')\");";
	$fade    += "opacity('screen', 40, 0, 1200,null,\"disable_obj('screen')\");";
	setTimeout(  $fade , 2500 );
}