function set_position( element_id, height_from_id, delay )
{
	  var obj = getObj( element_id );
		
    var sh  = getScrollXY( );
    var dh  = document.getElementById( height_from_id ).offsetHeight;
    sh <= dh ? ch = 0 : ch = (sh - dh);
    
    var oldch = parseInt( obj.style.top );
    obj.style.position = 'relative';
    if( ch != oldch )
		{
        if( ch > oldch ){
            oldch = oldch + Math.round( ( ch - oldch ) / 2 );
        }else if( ch < oldch ){
            oldch = oldch - Math.round( ( oldch - ch ) / 2 );
        }
        
        if( Math.abs( ch - oldch ) <= 1 ){
            oldch = ch;
        }
				//window.status = sh;
				if (screen.width<=1024 && sh > 280)
				{
					oldch = oldch - 130;
				}
				if (sh > 280)
				{
					
				}
        obj.style.top = oldch+"px";
        setTimeout( "set_position('"+element_id+"', '"+height_from_id+"',  '"+delay+"')", delay);
    }
		else
		{
        setTimeout( "set_position('"+element_id+"', '"+height_from_id+"', '"+delay+"')", delay);
    }
}
function getScrollXY() {
    var scrOfY = 0;
    if ( typeof( window.pageYOffset ) == 'number' ){
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
    }else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ){
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
    }else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ){
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
    }
    return scrOfY;
}
function getObj( name ){
    var el = new Object;
    if ( document.getElementById){
        el.obj      = document.getElementById( name );
        el.style    = document.getElementById( name ).style;
    }else if( document.all ){
        el.obj      = document.all[name];
        el.style    = document.all[name].style;
    }else if( document.layers ){
        el.obj      = document.layers[name];
        el.style    = document.layers[name];
    }
    return el;
}
