/*var navArrowSlider = function(navWrap,navWrap2, navElementsArray, activeID, arrowY, leftOffset) {
	var youAreHere = new Fx.Tween($(navWrap), { 
		duration: 1200,
		transition: Fx.Transitions.Elastic.easeOut  
	});
	var youAreHere2 = new Fx.Tween($(navWrap2), { 
		duration: 1200,
		transition: Fx.Transitions.Elastic.easeOut  
	});

	$$(navElementsArray).each(function(item){  
		item.addEvent('mouseenter', function() { 
			var thisPos = item.getPosition(navWrap).x  + (item.getSize().x / 2) - leftOffset; 
			youAreHere.cancel();
			youAreHere.start('background-position', thisPos + 'px ' + arrowY + 'px'); 
			youAreHere2.cancel();
			youAreHere2.start('left', thisPos + 'px ');
		});
	});
	
	var currentArrow = function() {
		youAreHere.cancel();
		youAreHere2.cancel();
		var activePos = $(activeID).getPosition(navWrap).x  + ($(activeID).getSize().x / 2) - leftOffset; 
		youAreHere.start('background-position', activePos + 'px ' + arrowY + 'px');    
		youAreHere2.start('left', activePos + 'px ');
	};
	
	//correct IE rendering problem (without this, it wont go to the active nav onload)
	var activePos = $(activeID).getPosition(navWrap).x  + $(activeID).getSize().x - leftOffset; 
	$(navWrap).setStyle('background-position', activePos + 'px ' + arrowY + 'px');       
	$(navWrap2).setStyle('left', activePos + 'px ');
	//works to set image to starting position in other browsers
	currentArrow(); 
	
	$(navWrap).addEvent('mouseleave', currentArrow);	
}; */

function resize(){
	
	var ombreD=document.getElementById("ombrd");
	var ombreG=document.getElementById("ombrg");
	
	var heightMin=1018;
	ombreD.style.height=heightMin + "px";	
	ombreG.style.height=heightMin + "px";
	ombreD.firstChild.style.height=heightMin + "px";	
	ombreG.firstChild.style.height=heightMin + "px";
	
	
	var height=document.body.scrollHeight;
	
	if(ombreD && ombreG){
		if(height>heightMin){
			height+=20;
			ombreD.style.height=height + "px";	
			ombreG.style.height=height + "px";
			ombreD.firstChild.style.height=height + "px";	
			ombreG.firstChild.style.height=height + "px";
		}
	}
	
}
var wrap;
function initMenu(){
	this.active=document.getElementById("active_nav");
	this.nav1=document.getElementById("nav_wrap");
	this.nav2=document.getElementById("nav_wrap2");
	this.divNav=document.getElementById("desktopNavbar")
	this.menus=document.getElementById("desktopNavbar").getElementsByTagName("a");
	for(var i=0;i<this.menus.length;i++){
		this.menus[i].onmousemove=function(event){wrap.move(event)};
		this.menus[i].onmouseover=function(event){wrap.move(event)};
	}
	this.divNav.onmouseout=function(event){wrap.reinit()};
	this.move=function(event){
		var e = event || window.event;
		var x=(e.pageX || e.clientX) + document.body.scrollLeft;
		var left=(x - this.leftNav);
		if(left>=this.divNav.offsetWidth - 19)
			left=this.divNav.offsetWidth -19;
		else
			left=left;
		left=left;
		this.nav1.style.backgroundPosition= left + "px 20px";
		this.nav2.style.left= left + "px";
	};
	this.setLeftNav=function(){
		var left = 0;
		var e = this.divNav;
		while (e != undefined && e != null){
			left += e.offsetLeft + (e.clientLeft != null ? e.clientLeft : 0);
			e = e.offsetParent;
		}
		this.leftNav=left;
	};
	this.reinit=function(){
		var left=(this.active.offsetLeft ) + (parseInt(this.active.style.width) / 2);
		left=left-10;
		this.nav1.style.backgroundPosition= left + "px 20px";
		this.nav2.style.left= left + "px";
	};
	this.reinit();
	this.setLeftNav();
	window.onresize=function(){wrap.setLeftNav()};
}

function init(){
	
		wrap=new initMenu();
		/*navArrowSlider(
			'nav_wrap', // ID of nav wrap
			'nav_wrap2',
			'#desktopNavbar > ul > li > a', // Array selector of nav elements 
			'active_nav', // ID of current nav element
			'20', //  Background position y of background image
			'10' //  INT ONLY - How far left from the right edge of the nav element that the image settles
		); */
		resize();
		
}

	window.onload =function(){	
		resize();
	};


function partners_more(e,text){
	if(!e){
		var e=window.event;
	}
	var div=document.getElementById("partners_more");
	if(div){
		if (e.pageX || e.pageY) {
			x = e.pageX;
			y = e.pageY;
		}
		else if (e.clientX || e.clientY) {
			x = e.clientX + document.body.scrollLeft
				+ document.documentElement.scrollLeft;
			y = e.clientY + document.body.scrollTop
				+ document.documentElement.scrollTop;
		}
		div.innerHTML=text;
		div.style.display="block";
		div.style.top=(y + 5) + "px";
		div.style.left=(x - 305) + "px";
	}
}
function partners_out(){
	var div=document.getElementById("partners_more");
	if(div){
		div.style.display="none";
	}
}
