
Event.observe(window, 'load', function(){
	//is lt IE 7
	if(isIE() && !isIE7()) {
		attachNavHover();
	}
	if(document.getElementById('map') != null) {
		buildMap();
	}
});
Event.observe(window, "unload", function() {
	if(document.getElementById('map') != null) {
		GUnload();
	}
});

function doVideoLightbox(url) {
	if($('flashdiv') != null) {
		$('flashdiv').style.visibility = 'hidden';
	}
	if(!myLightbox) {
		myLightbox = new Lightbox();
	}
	//only one video
myLightbox.start('http://files.gecompany.com/ecomagination/news/advertising/tv/tree/tree_893k_ge_films.flv');
}

function attachNavHover() {
	if(!$('mainnav')) {
		return;
	}
	var _menuitems = $A($('mainnav').getElementsByTagName('li'));
	_menuitems.each(function(_item) {
		$(_item).onmouseover = function(){
			this.addClassName('hover_');
		}
		$(_item).onmouseout = function(){
			this.removeClassName('hover_');
		}
	});
	if(!$('metanav')) {
		return;
	}
	var _metamenuitems = $A($('metanav').getElementsByTagName('li'));
	_metamenuitems.each(function(_item) {
		$(_item).onmouseover = function(){
			this.addClassName('hover_');
		}
		$(_item).onmouseout = function(){
			this.removeClassName('hover_');
		}
	});
	if(!$('subnav')) {
		return;
	}
	var _submenuitems = $A($('subnav').getElementsByTagName('li'));
	_submenuitems.each(function(_item) {
		$(_item).onmouseover = function(){
			this.addClassName('hover_');
		}
		$(_item).onmouseout = function(){
			this.removeClassName('hover_');
		}
	});	

}

function isIE() {
	return document.all && !window.opera ? true : false;
}
function isIE7() {
	return isIE() && document.documentElement && typeof document.documentElement.style.maxHeight != "undefined" ? true : false;
}

