// JavaScript Document

var wcontainer,obj,top,count;	
  var i=0;
  var wspeed=20;
  var wscroller=null;
  var wcontainerheight=0;
  var wmsgheight=0;
/*function newsscroll()
{
	var v;

	for(v=0;v<news.length;v++)
		{
			tops[v]=tops[v]-1;
			news[v].style.top=tops[v]+'px';
	//		alert(tops[v]);
			if(tops[v]<=-newsheight)
			{
				if(tops.length>2)
					tops[v]=newsheight*(tops.length-1);
				else
					tops[v]=containerheight;//newsheight*(tops.length);

			}
		}

		scroller=setTimeout('newsscroll()',speed);
}*/

function scrollup()
{
	//alert("aF");
	if(wcontainerheight-wmsgheight+8>=top)// && wscroller!=null)
	{
		//alert("stoping " + "C: " + wcontainerheight + " W: " +wmsgheight + " : " + (wcontainerheight-wmsgheight) + " : " +top);
		clearTimeout(wscroller);
		return;
	}
	top--;
	obj.style.top=top+'px';
	wscroller=setTimeout('scrollup()',wspeed);
}
function scrolldown()
{
	//alert("aF");
	if(top==0)// && wscroller!=null)
	{
		//alert("stoping " + "C: " + wcontainerheight + " W: " +wmsgheight + " : " + (wcontainerheight-wmsgheight) + " : " +top);
		clearTimeout(wscroller);
		return;
	}
	top++;
	obj.style.top=top+'px';
	wscroller=setTimeout('scrolldown()',wspeed);
}function stopwmsg()
{
	clearTimeout(wscroller);
}


function initwmsg() {
wcontainer=document.getElementById('wmsgcontainer');
wcontainerheight=container.offsetHeight;

	obj=document.getElementById('wmsg');	
	if(obj!=null)
	{
		//obj.className='news_element';
		wmsgheight=obj.offsetHeight;
		top=0;

	}
//alert("C: " + wcontainerheight + " W: " +wmsgheight);
}
/*if(count>0)
{
   newsscroll();
container.onmouseover=function(){
   clearTimeout(scroller);
 }
container.onmouseout=function(){
   newsscroll();
  }
}

*/