window.onload = getMsg; 
function get( id ) 
{ 
    return document.getElementById(id); 
} 
function getMsg() 
{ 
    var o = get("loft_win"); 
    var getContentHeight = function(){return o.offsetHeight}; 
    var step=1; 
    var getWinHeight = function(){ return document.compatMode=="CSS1Compat"?document.documentElement.clientHeight:document.body.clientHeight;    }; 
    var getScrollTop=function(){var scrollTop;
	if(document.documentElement&&document.documentElement.scrollTop)
	{scrollTop=document.documentElement.scrollTop;}
	else if(document.body){scrollTop=document.body.scrollTop;}
	else if(window.pageYOffset){scrollTop=window.pageYOffset;}
	return scrollTop;}

    function init() 
    {    
        o.style.visibility="";        
        getMsg.timer = setInterval(function(){ 
            if( step >= getContentHeight() ) 
            { 
                clearInterval(getMsg.timer); 
                getMsg.timer = null; 
            } 
            step++;            
            o.style.top = (getWinHeight()-step+getScrollTop())+"px"; 
        },5); 

        window.onscroll = function() 
        {            
            if( getMsg.timer ) 
            { 
                return; 
            } 
            o.style.top = (getWinHeight()-getContentHeight()+getScrollTop())+"px"; 
        } 
        window.onresize = function() 
        { 
            if( getMsg.timer ) 
            { 
                return; 
            } 
            o.style.top = (getWinHeight()-getContentHeight()+getScrollTop())+"px"; 
        } 
    } 
    init();    
} 
function mmDiv( o ) 
{ 
    var c = get("__content"); 
    c.style.display="none"; 
    if( o.innerHTML=="¨D" ) 
    { 
        c.style.display="none"; 
        o.innerHTML="¿Ú"; 
        flushTimer(); 
        getMsg(); 
    } 
    else 
    { 
        c.style.display="block"; 
        o.innerHTML="¨D"; 
        flushTimer(); 
        getMsg(); 
    } 
} 
function flushTimer() 
{ 
    if( getMsg.timer ) 
    { 
        clearInterval(getMsg.timer); 
    } 
} 
function closeDiv() 
{    
    var c = get("loft_win"); 
    flushTimer(); 
    c.parentNode.removeChild(c); 
}
