function initPage()
{try {
   var nav = document.getElementById("navigation");
   if (nav)
   {
      var nodes = nav.getElementsByTagName("li");
      for (var i = 0; i < nodes.length; i++)
      {
        if (nodes[i].innerHTML.indexOf('goCenter') != -1) {
        
                var ccurrent = nodes[i];
        if (ccurrent) {
                var __ul = ccurrent.childNodes[1];
               __ul.li = __ul.getElementsByTagName("li");
               __ul.li.width = 0;
               for (var j = 0; j < __ul.li.length; j++) {
                  __ul.li.width += __ul.li[j].offsetWidth;
               }
               __ul.style.width = __ul.li.width+'px';
               __ul.left = getAbsoluteLeft(__ul);
               ccurrent.left = getAbsoluteLeft(ccurrent);
               ccurrent.width = ccurrent.offsetWidth;
               __ul.style.right = -(ccurrent.left - __ul.left - (__ul.li.width-ccurrent.width)/2)+'px';
               __ul.className += ' fix';
               }
               
         }

         else {
                 nodes[i].onmouseover = function () 
                 {
                    if (window.attachEvent) this.className += " hover";

                    var _ul = this.getElementsByTagName('ul')[0];
                    if (_ul && _ul.className.indexOf('last') == -1 && _ul.className.indexOf('fix') == -1 ) {
                       _ul.li = _ul.getElementsByTagName("li");
                       _ul.li.width = 0;
                       for (var j = 0; j < _ul.li.length; j++) {
                          _ul.li.width += _ul.li[j].offsetWidth;
                       }
                       
                       _ul.style.width = _ul.li.width+'px';
                       _ul.left = getAbsoluteLeft(_ul);
                       this.left = getAbsoluteLeft(this);
                       this.width = this.offsetWidth;
                       _ul.style.right = -(this.left - _ul.left - (_ul.li.width-this.width)/2)+'px';
                       _ul.className += ' fix';
                       
                    }
                 }
                 nodes[i].onmouseout = function ()
                 {
                    if (window.attachEvent) this.className = this.className.replace(" hover", "");
                 }
         }
        }
  }} catch(err) {}
}
if (window.addEventListener)
   window.addEventListener("load", initPage, false);
else if (window.attachEvent)
   window.attachEvent("onload", initPage);
   
function getAbsoluteLeft(obj) {
   var posLeft = 0;
   while (obj.offsetParent) {posLeft += obj.offsetLeft; obj = obj.offsetParent;}
   return posLeft;
}
