function initPage(){
	initMenu();
}
if (window.addEventListener) window.addEventListener("load", initPage, false);
else if (window.attachEvent) window.attachEvent("onload", initPage);

function initMenu(){
	var _menu = document.getElementById('nav');
	if(_menu){
		_menu = _menu.getElementsByTagName('li');
		for(var i = 0; i < _menu.length; i++){
			_menu[i].ind = i;
			_menu[i].onmouseover = function(){
				if(this.ind > 0)
				{
					if(_menu[this.ind - 1].className.indexOf('active') != -1)
					{ 
					  this.className += ' a-prev';
					}
				}
				if(this.ind < _menu.length - 1){
					if(_menu[this.ind + 1].className.indexOf('active') != -1) this.className += ' a-next';
				}
				if(this.className.indexOf('hover') == -1) this.className += ' hover';
			}
			_menu[i].onmouseout = function(){
				if(this.className.indexOf('a-prev') != -1){ this.className = this.className.replace('a-prev','');}
				if(this.className.indexOf('a-nex') != -1){ this.className = this.className.replace('a-next','');}
				this.className = this.className.replace('hover','');
			}
		}
	}
	
}