function setMenus()
{
	var subMenus = document.getElementById('mainMenuUl').getElementsByTagName('UL');

	for(var i=0;i<subMenus.length;i++)
	{
		if(subMenus[i].parentNode!=undefined)
		{

			var lipos = getPos(subMenus[i].parentNode);			
			var liwidth = subMenus[i].parentNode.offsetWidth;		
			var newXpos = Math.round(lipos.x-20);
			var newYpos = Math.round(247-20);
			subMenus[i].style.left = newXpos +'px'; 
			subMenus[i].style.top = newYpos +'px';			
		}
	}
}
function getPos(theObj){
  x = y = 0;
	
  while(theObj){
	x += theObj.offsetLeft;
	y += theObj.offsetTop;
	theObj = theObj.offsetParent;
  }
  return {x:x,y:y}
}

function addMouseListenerToLIs()
{
	var lis = document.getElementsByTagName('LI');
	for (var i = 0; i<lis.length;i++)
	{
		lis[i].onmouseover = function()
		{
			this.className += ' hover ' ;
		}
	lis[i].onmouseout = function()
		{
			this.className = this.className.replace(' hover ','') ;
		}
	}
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
//window.onresize=setMenus;
//addLoadEvent(setMenus);