/*
  dependencies: 'function getElemRefs(id)'
  
  usage:
    add this to the scrollable div tag:
      style="position: relative; width:100%;" onMouseOver="clearTimeout(movedownvar)" onMouseout="movedown('scroll_news')"
     where 'scroll_news' == div's id
    div's class must be: class="scroll_layer"
    
    also add this: <body onLoad="init_scroll('scroll_news');"> 
*/

var speed = 1;
var movedownvar;
var aDivsIds = new Array();
     
function init_scroll()
{
  if (!document.getElementById) return
  
  var aDivs = document.getElementsByTagName('div');
  var aDivsTemp = new Array();
  
  for (var i = 0; i < aDivs.length; i++)
  {
    if (aDivs[i].className == 'scroll_layer') {
      
      aDivsIds[i] = aDivs[i].id;
      movedown(aDivsIds[i]);
    } 
  }
}

function movedown(obj)
{ 
  if (typeof (obj) != 'object')
  {
    var get_object=getElemRefs(obj);
  }
  else
  {
    get_object = obj;
  }
  
  var content_height=get_object.offsetHeight;
  
  if (parseInt(get_object.style.top) >= (content_height*(-1)+100))
  {
   get_object.style.top=parseInt(get_object.style.top) - speed;
  }
  else
  {
    get_object.style.top = 10;
  }
  
  movedownvar = setTimeout("movedown('"+obj+"')",100);
}
