var leftmove=false;
var latestnewstop=100;
var latestnewsinterval=0;

function scroll_no_jq()
{
	var d;
	if (d=document.getElementById("latestnews"))
	{
		latestnewstop=latestnewstop-1;
		if (latestnewstop<-d.scrollHeight) latestnewstop=200;
		d.style.top=latestnewstop+"px";
	}
}


window.onload=function() {
	latestnewsinterval= setInterval("scroll_no_jq()",60);
	var d=document.getElementById('leftnews');
	if (d)
	{
		d.onmouseover=function()
		{
			d.className='panel panelhovered';
			clearInterval(latestnewsinterval);
		}
		d.onmouseout=function()
		{
			d.className='panel';
			latestnewsinterval= setInterval("scroll_no_jq()",60);
		}
		d.onclick=function()
		{
			document.location.href=d.childNodes[0].childNodes[0].href;
		}

	}

	var d1=document.getElementById('leftmovie');
	if (d1)
	{
		d1.onmouseover=function()
		{
			d1.className='panel panelhovered';
		}
		d1.onmouseout=function()
		{
			d1.className='panel';
		}
		d1.onclick=function(){
			document.location=d1.childNodes[0].childNodes[0].href;
		}
	}

	var d2=document.getElementById('leftservices');
	if (d2)
	{
		d2.onmouseover=function()
		{
			d2.className='panel panelhovered';
		}
		d2.onmouseout=function()
		{
			d2.className='panel';
		}
		d2.onclick=function(){
			document.location=d2.childNodes[0].childNodes[0].href;
		}
	}
}

function is_child_of(parent, child) {
	if( child != null ) {
		while( child.parentNode ) {
			if( (child = child.parentNode) == parent ) {
				return true;
			}
		}
	}
	return false;
}
function fixOnMouseOut(element, event, JavaScript_code) {
	var current_mouse_target = null;
	if( event.toElement ) {
		current_mouse_target 			 = event.toElement;
	} else if( event.relatedTarget ) {
		current_mouse_target 			 = event.relatedTarget;
	}
	if( !is_child_of(element, current_mouse_target) && element != current_mouse_target ) {
		eval(JavaScript_code);
	}
}

var midmenu_timeout=0;

function show_midmenu(id)
{
	var d=document.getElementById('midmenu').childNodes[1];
	var i;
	for(i=0;i<d.childNodes.length;i++)
	{
		if (d.childNodes[i].className=='midmenu_main')
		{
			if (d.childNodes[i].childNodes[0].id=='midmenu_sub_'+id)
			{
				d.childNodes[i].childNodes[0].style.display='block';
			}
			else if (d.childNodes[i].childNodes[0].tagName=='UL')
			{
				d.childNodes[i].childNodes[0].style.display='none';
			}
		}
	}
	stop_midmenu();
}

function hide_midmenu()
{
	midmenu_timeout=setTimeout("show_midmenu(0)",500);
}

function stop_midmenu()
{
	clearTimeout(midmenu_timeout);
}
