window.onload = function () {
	servicesSubnav.init();
};

servicesSubnav = function () {
	var button,
		submenu,
		timer,
		timeout = 500;
	return {
		addEvents : function () {
			button.onmouseover = function () {
				servicesSubnav.show();
			};
			submenu.onmouseover = function () {
				servicesSubnav.show();
			};
			button.onmouseout = function () {
				timer = setTimeout("servicesSubnav.hide()", timeout);
			};
			submenu.onmouseout = function () {
				timer = setTimeout("servicesSubnav.hide()", timeout);
			};
		},
		hide : function () {
			submenu.style.display = 'none';
		},
		init : function () {
			if (!document.getElementById('navServices')) return;
			var ie = document.all && (navigator.userAgent.toLowerCase().indexOf("msie 6.") != -1);
			button = document.getElementById('navServices').getElementsByTagName('a')[0];
			submenu = document.getElementById('servicesSubnav');
			if (ie) {
				var html = "<iframe style=\"position: absolute; display: block; " +
					"z-index: -1; width: 100%; height: 100%; top: 0; left: 0;" +
					"filter: mask(); background-color: #FFF; \"></iframe>";
				submenu.innerHTML += html;
			}
			servicesSubnav.addEvents();
		},
		show : function () {
			submenu.style.display = 'block';
			clearTimeout(timer);
		}
	}
}();