Ysf.Dom.quiet = true;

/*
   offsetX: {'vertical': -80,  'horizontal': -153},
   offsetY: {'vertical': 19, 'horizontal': 1},
*/

var browser = navigator.appName;

if( browser == "Microsoft Internet Explorer" )
	var bottom_value = -125;
else
	var bottom_value = -110;

PanelMenu = {
   timers: new Array (),
   elements: new Array (),
   
   offsetX: {'vertical': -80,  	'horizontal': -153, 'default': -153, 	'inverse': 140,		'bottom': -100,				'horizontal_left': 165},
   offsetY: {'vertical': 19, 	'horizontal': 0,  	'default': -1, 		'inverse': -1,		'bottom': bottom_value,		'horizontal_left': -1},
   
   
   enter: function (el) {
      var c = $child(el, 'ul');
      
      if (el.parentNode.parentNode.tagName.toLowerCase () == 'li') {
         this.hold(el.parentNode.parentNode);
      }
      if (c) {
         var r = el.parentNode.parentNode.parentNode;
         var orientation = 'default';
         if (r.tagName.toLowerCase () == 'map' && r.id == 'root-nav') {
         	orientation = 'vertical';
         } else if ($ancestor (el, 'map').id == 'root-nav') {
            orientation = 'inverse';
         } else if (r.tagName.toLowerCase () == 'map' && r.id == 'main-nav') {
            orientation = 'horizontal';
		 } else if ($ancestor (el, 'map').id == 'main-nav_left') {
            orientation = 'horizontal_left';
         } else if ($ancestor (el, 'map').id == 'bottom-nav') {
         	orientation = 'bottom';
         }


	   c.style.display = 'block';
         c.style.zIndex = 100;

	if ($ancestor (el, 'map').id == 'bottom-nav') 
	{
		c.style.top = px(el.offsetTop - c.offsetHeight);
		c.style.left = px(el.offsetLeft + 110 + this.offsetX[orientation]);
	}
	else
	{
	     c.style.top = px(el.offsetTop + this.offsetY[orientation]);
	     c.style.left = px(el.offsetLeft + this.offsetX[orientation]);
	}
	}
   },
   
   hold: function (el) {
      if (this.timers[el.id]) {
         clearTimeout(this.timers[el.id]);
      }
      if (el.parentNode.parentNode.tagName.toLowerCase () == 'li') {
         this.hold(el.parentNode.parentNode);
      }
   },
   
   exit: function (el) {
      this.elements[el.id] = el;
      this.timers[el.id] = setTimeout('PanelMenu.close(\'' + el.id + '\')', 200);
   },
   
   close: function (id) {
      el = this.elements[id];
      var c = $child(el, 'ul');
      if (c) {
         c.style.display = 'none';
      }
   }
};

var showhidetimer = "undefined";
 
function showsubhilite(divId){
	var i;
	var divElement = document.getElementById(divId);
	divElement.style.display = "block";
}

function hidesubhilite(divId){
   var i;
   var divElement = document.getElementById(divId); 
   divElement.style.display = "none";
}

function hidesubhilitewithdelay(divId){
	showhidetimer = setTimeout('hidesubhilite(\'' + divId + '\')', 200)
}

function clearhide(){
	clearTimeout(showhidetimer);
}

