function initMenu()
{
	var _nav = document.getElementById("nav");
	if (_nav){
		var nodes = _nav.getElementsByTagName("li");
		for (var i=0; i<nodes.length; i++) {
			nodes[i].onmouseover = function(){
				if (this.className.indexOf('hover') == -1)
				this.className += " hover";
			}
			nodes[i].onmouseout = function(){
				this.className = this.className.replace(" hover", "");
			}
		}
	}
}
if (window.attachEvent){
	window.attachEvent("onload", initMenu);
}

function initPopup(){
    var _hold = document.getElementById('promo-area');
	if(_hold){
		var _list = _hold.getElementsByTagName('li');
		var _a = -1;
		for(var i = 0; i < _list.length; i++){
			if(_list[i].parentNode == _hold){
				if(_list[i].className.indexOf('active') != -1){
					if(_a == -1) _a = _list[i];
					else _list[i].className = _list[i].className.replace('active','');
				}
				_list[i].onmouseover = function(){
					if(this.className.indexOf('hover') == -1) this.className += ' hover';
					
					//====================================================================================
					//Hack made by Alexis so that the blue popup divs will not be cut by the main
					//div content in http://urbactsvn:8888/en/header-main/our-projects/
					$("#main-content").css({'overflow':'visible'});
					//====================================================================================
				}
				_list[i].onmouseout = function(){
					this.className = this.className.replace('hover','');
					
					//====================================================================================
					//Hack made by Alexis so that the blue popup divs will not be cut by the main
					//div content in http://urbactsvn:8888/en/header-main/our-projects/
					$("#main-content").css({'overflow':'hidden'});
					//====================================================================================
				}
				_list[i].getElementsByTagName('a')[0]._hold = _list[i];
				
				_list[i].getElementsByTagName('a')[0].onclick = function(){
					if(_a != -1) _a.className = _a.className.replace('active','');
					if(_a != this._hold){
						if(this._hold.className.indexOf('active') == -1) this._hold.className += ' active';
						_a = this._hold;
					}
					else{
						_a = -1;
					}
					
				}
			}
		}
	}
}
if (window.addEventListener) window.addEventListener("load", initPopup, false);
else if (window.attachEvent && !window.opera) window.attachEvent("onload", initPopup);
	
function initPopup2(){
    var _hold = document.getElementById('promo-area2');
	if(_hold){
		var _list = _hold.getElementsByTagName('li');
		var _a = -1;
		for(var i = 0; i < _list.length; i++){
			if(_list[i].parentNode == _hold){
				if(_list[i].className.indexOf('active') != -1){
					if(_a == -1) _a = _list[i];
					else _list[i].className = _list[i].className.replace('active','');
				}
				_list[i].onmouseover = function(){
					if(this.className.indexOf('hover') == -1) this.className += ' hover';
					
					//====================================================================================
					//Hack made by Alexis so that the blue popup divs will not be cut by the main
					//div content in http://urbactsvn:8888/en/header-main/our-projects/
					$("#main-content").css({'overflow':'visible'});
					//====================================================================================
				}
				_list[i].onmouseout = function(){
					this.className = this.className.replace('hover','');
					
					//====================================================================================
					//Hack made by Alexis so that the blue popup divs will not be cut by the main
					//div content in http://urbactsvn:8888/en/header-main/our-projects/
					$("#main-content").css({'overflow':'hidden'});
					//====================================================================================
				}
				_list[i].getElementsByTagName('a')[0]._hold = _list[i];
				
				_list[i].getElementsByTagName('a')[0].onclick = function(){
					if(_a != -1) _a.className = _a.className.replace('active','');
					if(_a != this._hold){
						if(this._hold.className.indexOf('active') == -1) this._hold.className += ' active';
						_a = this._hold;
					}
					else{
						_a = -1;
					}
					
				}
			}
		}
	}
}
if (window.addEventListener) window.addEventListener("load", initPopup2, false);
else if (window.attachEvent && !window.opera) window.attachEvent("onload", initPopup2);
	
function initPopup3(){
    var _hold = document.getElementById('promo-area3');
	if(_hold){
		var _list = _hold.getElementsByTagName('li');
		var _a = -1;
		for(var i = 0; i < _list.length; i++){
			if(_list[i].parentNode == _hold){
				if(_list[i].className.indexOf('active') != -1){
					if(_a == -1) _a = _list[i];
					else _list[i].className = _list[i].className.replace('active','');
				}
				_list[i].onmouseover = function(){
					window.status='hover';
					if(this.className.indexOf('hover') == -1) this.className += ' hover';
					
					//====================================================================================
					//Hack made by Alexis so that the blue popup divs will not be cut by the main
					//div content in http://urbactsvn:8888/en/header-main/our-projects/
					$("#main-content").css({'overflow':'visible'});
					//====================================================================================
				}
				_list[i].onmouseout = function(){
					
						window.status='out';
					this.className = this.className.replace('hover','');
					
					//====================================================================================
					//Hack made by Alexis so that the blue popup divs will not be cut by the main
					//div content in http://urbactsvn:8888/en/header-main/our-projects/
					$("#main-content").css({'overflow':'hidden'});
					//====================================================================================
				}
				_list[i].getElementsByTagName('a')[0]._hold = _list[i];
				
				_list[i].getElementsByTagName('a')[0].onclick = function(){
					if(_a != -1) _a.className = _a.className.replace('active','');
					if(_a != this._hold){
						if(this._hold.className.indexOf('active') == -1) this._hold.className += ' active';
						_a = this._hold;
					}
					else{
						_a = -1;
					}
					
				}
			}
		}
	}
}
if (window.addEventListener) window.addEventListener("load", initPopup3, false);
else if (window.attachEvent && !window.opera) window.attachEvent("onload", initPopup3);
