
var itemIdMaster;
var bottomval=0;


// this function determines whether the event is the equivalent of the microsoft
// mouseleave or mouseenter events. (e)= event ;  (handler) = the event handler ; 
// this is a fix for nested div problem
function isMouseLeaveOrEnter(e, handler)
{		
	if (e.type != 'mouseout' && e.type != 'mouseover') return false;
	var reltg = e.relatedTarget ? e.relatedTarget :
	e.type == 'mouseout' ? e.toElement : e.fromElement;
	while (reltg && reltg != handler) reltg = reltg.parentNode;
	return (reltg != handler);
}


function showQuickSubMenu(itemId){
	if (document.getElementById) {
       var nav_id = document.getElementById(itemId);
	  // var nav_subId = document.getElementById(itemId+'Contents');
	   		if (nav_id!=null){					
				nav_id.className = 'subContainer show';
				//maxHeight=nav_subId.offsetHeight;
				/*maxWidth=nav_subId.offsetWidth;	
				nav_subId.style.width= toString(maxWidth)+"px";*/
				//bottomval=maxHeight;
				//nav_subId.style.clip="rect(0px,"+maxWidth+"px,"+maxHeight+"px,0px)";	*/
			}
	  }
}

function hideSubMenu(itemId){
	bottomval = 1;	
	 if (document.getElementById) {
       var nav_id = document.getElementById(itemId);
	  //var nav_subId = document.getElementById(itemId+'Contents');
	   		if (nav_id!=null){				
				nav_id.className = 'subContainer hide';
				/*maxWidth=nav_subId.offsetWidth;	
				nav_subId.style.width= toString(maxWidth)+"px";*/
				/*maxWidth=nav_subId.offsetWidth;
				nav_subId.style.clip="rect(0px,"+maxWidth+"px,0px,0px)";	*/   	
			}

	  }
}


/*
function showSubMenu(itemId){
	if(bottomval==1){
		bottomval = 0;
	}	
	 if (document.getElementById && bottomval==0) {
       var nav_id = document.getElementById(itemId);
	   var nav_subId = document.getElementById(itemId+'Contents');
	   		if (nav_id!=null){	
				maxWidth=nav_subId.offsetWidth;
				nav_subId.style.clip="rect(0px,"+maxWidth+"px,0px,0px)";							
	   			nav_id.className = 'subContainer show';
				maxHeight=nav_subId.offsetHeight;
				openScrollMenu(""+itemId+'Contents'+"", maxHeight);	
	   		}
	  }
}

function openScrollMenu(subItem, maxHeight){
	var nav_subId = document.getElementById(subItem);
	if(bottomval<maxHeight && bottomval!=1){ 
		maxWidth=nav_subId.offsetWidth;
		nav_subId.style.clip="rect(0px,"+maxWidth+"px,"+bottomval+"px,0px)";
		setTimeout("openScrollMenu('"+subItem+"',"+maxHeight+")",10);
		bottomval=bottomval+5;
	}
}*/


