   var detect = navigator.userAgent.toLowerCase();

   var docwidth = 0;
   var docheight = 0;
   
   var POSY_ABS = 150;
   var POSX_ABS = 188;
   var CONTENT_WIDTH = 761;
   
   if( checkIt( 'safari' ) )
   {
      POSX_ABS = 188;
   }
   else if( !checkIt( 'compatible' ) )
   {
      POSX_ABS = 179;
   }
   
   var posX = POSX_ABS;
   var posY = POSY_ABS;
   
   var HIDE_TIMEOUT = 600;
   
   var obj = new Object();
   var objSubMenu;   

   var boolOverSub = new Array();

   function init() {
      //objSubMenu = document.getElementById( 'SubMenuDIV' );
      onResize();
   }

   function onResize()
   {
      if (window.innerWidth || window.innerHeight){ 
         docwidth = window.innerWidth; 
         docheight = window.innerHeight; 
      } else if (document.body.clientWidth || document.body.clientHeight){ 
         docwidth = document.body.clientWidth;
         docheight = document.body.clientHeight; 
      } 
      if( docwidth > CONTENT_WIDTH )
      {
         posX = (docwidth - CONTENT_WIDTH ) / 2 + POSX_ABS;
      }
      else
      {
         posX = POSX_ABS;
      }
      //alert( objSubMenu );

   }
   
   function ShowSubMenu( code )
   {
      obj = document.getElementById( 'SubMenuDIV' + code );
      boolOverSub[code] = true;
      obj.className = 'SubMenuShow';
      obj.style.left = posX + 'px';
      obj.style.top = posY + 'px';
   }

   function HideSubMenu( code )
   {
      boolOverSub[code] = false;
      setTimeout( "HideSubMenuTimeout(" + code + ");", HIDE_TIMEOUT );
   }
   
   function SetOverSub( code )
   {
      boolOverSub[code] = true;
   }
   
   function HideSubMenuTimeout( code )
   {
      obj = document.getElementById( 'SubMenuDIV' + code );
      if( !boolOverSub[code] )
      {
         obj.className = 'SubMenuHide';
      }
   }
   
   window.onresize = onResize;


   function checkIt(string)
   {
	   place = detect.indexOf(string) + 1;
	   thestring = string;
	   return place;
   }
