/**************************************
 * Navigation
 *************************************/

function navigationButtonHoverOn(object) {
    object.style.background = "#E8E1D0";
}


function navigationButtonHoverOff(object) {
    object.style.background = "#FF7E00";
}


function navigationButtonLevel1HoverOn(object) {
    object.style.background = "#E8E1D0";
}


function navigationButtonLevel1HoverOff(object) {
    object.style.background = "#EFEFEF";
}


function showSubmenu(divId) {
    var div = document.getElementById(divId);
    if(div != null) {
        div.style.display = "block";
    }
}


function hideSubmenu(divId) {
    var div = document.getElementById(divId);
    if(div != null) {
        div.style.display = "none";
    }
}


function setContent(content) {
    location.href="index.php?page=" + content;
}


/**************************************
 * Popup
 *************************************/

function showLayer() {
  var layer = document.getElementById("layer_div");
  
  var height  = document.body.clientHeight;
  var width   = document.body.clientWidth;
  
  layer.style.top     = 0;
  layer.style.left    = 0;
  layer.style.width   = width;
  layer.style.height  = height + document.body.scrollTop;
  layer.style.display = "block"
}


function hideLayer() {
  parent.document.getElementById("layer_div").style.display = "none";
}


function showPopupDiv(divId) {
    showPopupDivIntern(divId, 350, 250);
}


function showImagePopupDiv(divId) {
    showPopupDivIntern(divId, 200, 290);
}

 
function showPopupDivIntern(divId, widthOffset, heightOffset) {
  var div = document.getElementById(divId);
  if(div) {
    showLayer();
    div.style.left = document.body.clientWidth / 2 - widthOffset;
    div.style.top  =  (document.body.clientHeight / 2 - heightOffset) + document.body.scrollTop;
    div.style.display = "block";
  }
}


function hidePopupDiv(divId) {
  var div = document.getElementById(divId);
  if(div) {
    hideLayer();
    div.style.display = "none";
  }
}

