function Initialize()
{
  SetHeight();
}

function GetBodyHeight()
{
  var y = 0;
  if (self.innerHeight) {
    y = self.innerHeight;
  } else if (document.documentElement && document.documentElement.clientHeight) {
    y = document.documentElement.clientHeight;
  } else if (document.body) {
    y = document.body.clientHeight;
  }
  return y;
}

function SetHeight()
{
  var bodyHeight=GetBodyHeight();
  var contentContainerObj=GetObject("content_container");

  var contentObj=GetObject("content");
  var newsObj=GetObject("news");
  var developmentObj=GetObject("development");
  var footerObj=GetObject("footer");
  var bottomObj=GetObject("bottom");
  var copyrightObj=GetObject("copyright");

  var contentHeight=GetHeight(contentObj);
  var newsHeight=GetHeight(newsObj);
  var developmentHeight=GetHeight(developmentObj);
  var footerHeight=GetHeight(footerObj);

  var useHeight=0;
  if ((newsHeight>contentHeight) && (newsHeight>developmentHeight)) {
    useHeight=newsHeight;
  } else if ((developmentHeight>contentHeight)&&(developmentHeight>newsHeight)) {
    useHeight=developmentHeight;
  } else {
    useHeight=contentHeight;
  }

  if (useHeight+473 < bodyHeight) {
    contentObj.style.height=(useHeight+(bodyHeight-useHeight-473)) + "px";
    contentContainerObj.style.height=(useHeight+(bodyHeight-useHeight-473)+20)+"px";
    newsObj.style.height=contentObj.style.height;
    developmentObj.style.height=contentObj.style.height;
  } else {
    contentObj.style.height=useHeight+"px";
    contentContainerObj.style.height=(useHeight+20)+"px";
    newsObj.style.height=contentObj.style.height;
    developmentObj.style.height=contentObj.style.height;
  }

  footerObj.style.visibility="visible";
  bottomObj.style.visibility="visible";
  copyrightObj.style.visibility="visible";

}

var previousSub=0;

function DisplaySubmenus(main_id,submenu_id)
{
  var referredObj=GetObject(main_id);
  var subMenuObj=GetObject(submenu_id);

  var previousSubObj=GetObject(previousSub);
  if (previousSubObj) {
    previousSubObj.style.display="none";
  }

  if (subMenuObj) {

    var topAdd=0;
    var leftAdd=0;

    if (window.Iterator) {//mozilla
      topAdd=10;
      leftAdd=220;
    } else if (document.documentElement && typeof document.documentElement.style.maxHeight!="undefined") {//ie7
      topAdd=10;
      leftAdd=240;
    } else if (document.compatMode && document.all) {//ie6
      topAdd=10;
      leftAdd=230;
    } else {//others
      topAdd=10;
      leftAdd=230;
    }
    subMenuObj.style.top=(GetPosY(referredObj)+topAdd)+"px";
    subMenuObj.style.left=(leftAdd+(referredObj.offsetWidth))+"px";
    subMenuObj.style.zIndex=subMenuObj.style.zIndex+1;
    subMenuObj.style.display="inline";

    subMenuObj.style.visibility ="visible";
  }

  previousSub=submenu_id;
}


var previousSubSub=0;
function DisplaySubSubmenus(submenu_id,subsubmenu_id)
{
  var referredObj=GetObject(submenu_id);
  var subSubMenuObj=GetObject(subsubmenu_id);

  var previousSubSubObj=GetObject(previousSubSub);
  if (previousSubSubObj) {
    previousSubSubObj.style.display="none";
  }

  if (subSubMenuObj) {
    var topAdd=0;
    var leftAdd=0;

    if (window.Iterator) {//mozilla
      topAdd=10;
      leftAdd=370;
    } else if (document.documentElement && typeof document.documentElement.style.maxHeight!="undefined") {//ie7
      topAdd=10;
      leftAdd=390;
    } else if (document.compatMode && document.all) {//ie6
      topAdd=10;
      leftAdd=380;
    } else {//others
      topAdd=10;
      leftAdd=380;
    }

    subSubMenuObj.style.top=(GetPosY(referredObj)-topAdd)+"px";
    subSubMenuObj.style.left=(leftAdd+referredObj.offsetWidth)+"px";
    subSubMenuObj.style.zIndex=subSubMenuObj.style.zIndex+1;
    subSubMenuObj.style.display="inline";
    subSubMenuObj.style.visibility ="visible";
  }


  previousSubSub=subsubmenu_id;
}

function Highlight(td)
{
  var menuObj=GetObject(td);
  td.style.background="#fc8d1a";
}

function Lowlight(td)
{
  var menuObj=GetObject(td);
  td.style.background="#042c5f";
}

