function hoverMenu(menuitem) {
	menuitem.className = 'menuitem_hover';
}
function normalMenu(menuitem) {
	menuitem.className = 'menuitem';
}

var currentOutId = false;

function newsOver(element) {
	if (currentOutId) {
		clearTimeout(currentOutId);
	}

	element.style.backgroundImage = 'url("/files/design/images/news_index_hover.gif")';
}
function newsOut(element) {
	currentOutId = setTimeout(function() {
		element.style.backgroundImage = 'url("/files/design/images/news_index.gif")';
		currentOutId = false;
	},100);
	
	/*
	currentOutId = setTimeout(function() {
		element.className = 'newsindex';
		currentOutId = false;
	},1000);
	*/
}
function getElementOffsets(element) {
	var o = {
		height: element.offsetHeight,
		width: element.offsetWidth
	};
	
	var x = element.offsetLeft;
	var y = element.offsetTop;
	var p = element.offsetParent;
	
	while(p && (p.nodeType != 9)) {
		x += p.offsetLeft;
		y += p.offsetTop;
		p = p.offsetParent;
	}
	o.left = x;
	o.top = y;
	return o;
}
function placeGlass() {
	var logo = document.getElementById('logo');
	var glassImg = document.getElementById('glass');
	
	logoOffsets = getElementOffsets(logo);
	glassImg.style.position = 'absolute';
	glassImg.style.top = (logoOffsets.top + 105) + 'px';
	glassImg.style.left = (logoOffsets.left + 2) + 'px';
	glassImg.style.display = 'block';
}


var t;
var count = 0;
function bottom(targetYPos) {
	var y = document[getDocElName()].scrollTop;
	if (count > 10) {
		count = 0;
		return;
	}
	if (y < targetYPos) {
		window.scrollBy(0,10);
		count++;
		t=setTimeout('bottom('+targetYPos+')',10);
	}
	else {
		count = 0;
		clearTimeout(t);
	}
	return false;
}
function scrollDown(targetYPos) {
	var y = document[getDocElName()].scrollTop;
	if (count > 100) {
		count = 0;
		return;
	}
	if (y < targetYPos) {
		window.scrollBy(0,10);
		count++;
		t=setTimeout('scrollDown('+targetYPos+')',10);
	}
	else {
		count = 0;
		clearTimeout(t);
	}
	return false;
}
function getDocElName(){
	if(document.compatMode && document.compatMode == "CSS1Compat"){
		return "documentElement";
	}
	else{
		return "body";
	}
}



