/* This code is for demonstration purposes, see the demo page for the full */
/* full working code.                                                      */

function PrintDate() {  
var months = Array();
months[0]  = "ledna";
months[1]  = "února";
months[2]  = "března";
months[3]  = "dubna";
months[4]  = "května";
months[5]  = "června";
months[6]  = "července";
months[7]  = "srpna";
months[8]  = "září";
months[9]  = "října";
months[10] = "listopadu";
months[11] = "prosince";
var date = new Date();
var dateStr = "";
dateStr += date.getDate()+". "+ months[date.getMonth()]+" ";
dateStr += (date.getYear() > 1900) ? date.getYear() : date.getYear()+1900;
document.write(dateStr);
}



// Determine browser type (Netscape 6 or IE 5.5).

var isIE5 = ((navigator.userAgent.indexOf("MSIE 5.5") > 0) ||
	         (navigator.userAgent.indexOf("MSIE 6") > 0)) ? 1 : 0;

var isNS6 = (navigator.userAgent.indexOf("Gecko")    > 0) ? 1 : 0;

// Global variable for tracking the currently active button.

var activeButton = null;

function buttonClick(button, menuName) {

  // Blur focus from the link to remove that annoying outline.

  button.blur();

  // Associate the named menu to this button if not already done.

  if (!button.menu)
    button.menu = document.getElementById(menuName);

  // Reset the currently active button, if any.

  if (activeButton&& activeButton != button)
    resetButton(activeButton);

  // Toggle the button's state.


  if (button.isDepressed)
    resetButton(button);
  else
    depressButton(button);

  return false;
}

function buttonMouseover(button, menuName) {

  // If any other button menu is active, deactivate it and activate this one.
  // Note: if this button has no menu, leave the active menu alone.

  if (menuName && activeButton && activeButton != button) {
    resetButton(activeButton);
    if (menuName)
      buttonClick(button, menuName);
  }
}

function depressButton(button) {

  // Save current style values so they can be restored later.
  // Only needs to be done once.

  if (!button.oldBackgroundColor) {
    button.oldBackgroundColor = button.style.backgroundColor;
    button.oldBorderBottomColor = button.style.borderBottomColor;
    button.oldBorderRightColor = button.style.borderRightColor;
    button.oldBorderTopColor = button.style.borderTopColor;
    button.oldBorderLeftColor = button.style.borderLeftColor;
    button.oldColor = button.style.color;
    button.oldLeft = button.style.left;
    button.oldPosition = button.style.position;
    button.oldTop = button.style.top;
  }

  // For IE, force first menu item to the width of the parent menu,
  // this causes mouseovers work for all items even when cursor is
  // not over the link text.

  if (isIE5 && !button.menu.firstChild.style.width)
    button.menu.firstChild.style.width =
      button.menu.offsetWidth + "px";

  // Position the associated drop down menu under the button and
  // show it. Note that the position must be adjusted according to
  // the brower type.

  x = getPageOffsetLeft(button);
  y = getPageOffsetTop(button) + button.offsetHeight;

  x-=-4;
  

  
  if (isIE5) {
    y += -2;
  }
  if (isNS6) {
    x--;
    y--;
  }
  button.menu.style.left = x + "px";
  button.menu.style.top  = y + "px";
  button.menu.style.visibility = "visible";

  // Set button state and let the world know which button is
  // active.

  button.isDepressed = true;
  activeButton = button;
}

function resetButton(button) {

  // Restore the button's style settings.

  if (null == button)
  {
    return;
  }

  button.style.backgroundColor = button.oldBackgroundColor;
  button.style.borderBottomColor = button.oldBorderBottomColor;
  button.style.borderRightColor = button.oldBorderRightColor;
  button.style.borderTopColor = button.oldBorderTopColor;
  button.style.borderLeftColor = button.oldBorderLeftColor;
  button.style.color = button.oldColor;
  button.style.left = button.oldLeft
  button.style.position = button.oldPosition;
  button.style.top = button.oldTop;

  // Hide the button's menu.

  if (button.menu)
    button.menu.style.visibility = "hidden";

  // Set button state and clear active menu global.

  button.isDepressed = false;
  activeButton = null;
}

function getPageOffsetLeft(el) {

  // Return the true x coordinate of an element relative to the page.

  return el.offsetLeft + (el.offsetParent ? getPageOffsetLeft(el.offsetParent) : 0);
}

function getPageOffsetTop(el) {

  // Return the true y coordinate of an element relative to the page.

  return el.offsetTop + (el.offsetParent ? getPageOffsetTop(el.offsetParent) : 0);
}

