// *************************************************************************
// * *
// * http://www.pentia.dk/ *
// * *
// * Author: Brian Pedersen, Pentia A/S *
// * *
// * E-Mail: dev@pentia.dk *
// * *
// * Copyright(C) Pentia, 1997 - 2003. All rights reserved (R). *
// * *
// * LEGAL NOTICE: This is unpublished proprietary source code of Pentia. *
// * The contents of this file are protected by copyright laws and *
// * international copyright treaties, as well as other intellectual *
// * property laws and treaties. These contents may not be extracted, *
// * copied, modified or redistributed either as a whole or part thereof *
// * in any form, and may not be used directly in, or to assist with, the *
// * creation of derivative works of any nature without prior written *
// * permission from Pentia. The above copyright notice does not *
// * evidence any actual or intended publication of this file. *
// * *
// *************************************************************************
// Purpose: Javascript menu handling
// Bugs:
// History:
// *************************************************************************

// Global variables telling which menu is visible at the moment
var isLoginVisible = 0;
var isOversigtVisible = 0;

// -------------------------------------------------------------------
// Åbning af Citrix vindue, centreret på skærmen
// -------------------------------------------------------------------
function OpenCitrix()
{
  var url = "http://citrix/Citrix/NFuse17/redirect.asp?username=ctxtest01&amp;domain=naeskom&amp;password=ctxtest01";
  var left = (screen.width-778) / 2;
  var top = (screen.height-490) / 2;
  var features = "left=" + left + ",top=" + top + ",width=778,height=490,menubar=0,toolbar=0,location=0,scrollbars=0,status=0";
  window.open("/citrix/citrixwindow.htm",null,features);
}

// -------------------------------------------------------------------
// Handling of oversigt menu
// -------------------------------------------------------------------
function SlideOversigt()
{
  if ( document.getElementById )
  {
		box = document.getElementById("oversigt");
    if ( parseInt(box.style.height) < 76 )
    {    
      box.style.top = parseInt(box.style.top) - 3 + "px";
      box.style.height = parseInt(box.style.height) + 3 + "px";
      setTimeout("SlideOversigt()",9);
    }
    else
    {
      box.style.top = "-76px";
      box.style.height = "76px";
    }
  }  
}

function ShowOversigt(setSlide)
{
  isOversigtVisible = 1;
  box = document.getElementById("oversigt");
  box.style.visibility = "visible";
  if (setSlide == "1")
  {
    box.style.height = "0px";
    box.style.top = "0px";
    SlideOversigt();                                                               
  } 
}

function HideOversigt(setHeight)
{
  box = document.getElementById("oversigt");
  box.style.visibility = "hidden";
  if (setHeight == "1")
  {
    box.style.height = "0px";
    box.style.top = "-64px";
  }  
  isOversigtVisible = 0;
}

// -------------------------------------------------------------------
// Handling of login menu
// -------------------------------------------------------------------
function SlideLogin()
{
  if ( document.getElementById )
  {
		var box;
		box = document.getElementById("login");
    if ( parseInt(box.style.height) < 56 )
    {    
      box.style.top = parseInt(box.style.top) - 3 + "px";
      box.style.height = parseInt(box.style.height) + 3 + "px";
      setTimeout("SlideLogin()",10);
    }
    else
    {
      box.style.top = "-56px";
      box.style.height = "56px";
    }
  }  
}

function ShowLogin(setSlide)
{
  isLoginVisible = 1;
  box = document.getElementById("login");
  box.style.visibility = "visible";
  if (setSlide == "1")
  {
    box.style.height = "0px";
    box.style.top = "0px";
    SlideLogin();                                                               
  } 
}

function HideLogin(setHeight)
{
  box = document.getElementById("login");
  box.style.visibility = "hidden";
  if (setHeight == "1")
  {
    box.style.height = "0px";
    box.style.top = "-60px";
  }  
  isLoginVisible = 0;
}

// -------------------------------------------------------------------
// Generic menu hiding function. Must be called from every onmouseover
// for every div element located in the content area
// -------------------------------------------------------------------
function HideMenus()
{
  if (isLoginVisible == 1)
    HideLogin('0');
  if (isOversigtVisible == 1)
    HideOversigt('0');
}


