
var menu = document.getElementById('portf_menu_graph_sub')
if (menu) {
	menu.style.display = 'none';
}
var menu = document.getElementById('portf_menu_prod_sub')
if (menu) {
	menu.style.display = 'none';
}

var hide_delay = 200;
var tstat=0;
var timer1 = null;
var tstatprod=0;
var timer2 = null;

function setUp() {
	var menuItem = document.getElementById('portf_menu_graph');
	if (menuItem) {
		menuItem.onmouseover = showMenu;
		menuItem.onmouseout = hideMenu;
	}
	var menuSubItem = document.getElementById('portf_menu_graph_sub');
	if (menuSubItem) {
		menuSubItem.onmouseover = cancelHide;
		menuSubItem.onmouseout = hideMenu;
	}
	var menuItem = document.getElementById('portf_menu_prod');
	if (menuItem) {
		menuItem.onmouseover = showMenuProd;
		menuItem.onmouseout = hideMenuProd;
	}
	var menuSubItem = document.getElementById('portf_menu_prod_sub');
	if (menuSubItem) {
		menuSubItem.onmouseover = cancelHideProd;
		menuSubItem.onmouseout = hideMenuProd;
	}
}

setUp();

function showMenu() {
	cancelHide();
	var menuSubItem = document.getElementById('portf_menu_graph_sub');
	if (menuSubItem) {
		menuSubItem.style.display = '';
	}
}

function hideMenu() {
	clearTimeout(timer1);
	timer1=setTimeout("hideComplete()",hide_delay);
	tstat=1;
	return 1;
}

function hideComplete() {
	var menuSubItem = document.getElementById('portf_menu_graph_sub');
	if (menuSubItem) {
		menuSubItem.style.display = 'none';
		var menuSubLink = document.getElementById('portf_menu_graph_a');
		if (menuSubLink) {
			//menuSubLink.style.background = 'url(/images/menu-gpaphic-design-over.gif) 0 -32px no-repeat';
		}
	}
}

function cancelHide() {
	var menuSubLink = document.getElementById('portf_menu_graph_a');
	if (menuSubLink) {
		//menuSubLink.style.background = 'url(/images/menu-gpaphic-design-over.gif) 0 0px no-repeat';
	}

	if (tstat==1) {
		clearTimeout(timer1);
		tstat=0;
	}
	return 1;
}


function showMenuProd() {
	cancelHideProd();
	var menuSubItem = document.getElementById('portf_menu_prod_sub');
	if (menuSubItem) {
		menuSubItem.style.display = '';
	}
}

function hideMenuProd() {
	clearTimeout(timer2);
	timer2=setTimeout("hideCompleteProd()",hide_delay);
	tstatprod=1;
	return 1;
}

function hideCompleteProd() {
	var menuSubItem = document.getElementById('portf_menu_prod_sub');
	if (menuSubItem) {
		menuSubItem.style.display = 'none';
		var menuSubLink = document.getElementById('portf_menu_prod_a');
		if (menuSubLink) {
			//menuSubLink.style.background = 'url(/images/menu-product-design-over.gif) 0 -32px no-repeat';
		}
	}
}

function cancelHideProd() {
	var menuSubLink = document.getElementById('portf_menu_prod_a');
	if (menuSubLink) {
		//menuSubLink.style.background = 'url(/images/menu-product-design-over.gif) 0 0px no-repeat';
	}

	if (tstatprod==1) {
		clearTimeout(timer2);
		tstatprod=0;
	}
	return 1;
}

