  var DOM_TRUE;
  var CURRENT_ITEM = null;
  var CURRENT_NODE = null;

  DOM_TRUE = (document.getElementById && document.documentElement.firstChild);

  if (DOM_TRUE) {
    document.write("<link rel='stylesheet' type='text/css' href='index.css' />");
  }

  function SectionDisplay(id_item, display) {
    document.getElementById(id_item).style.display = (display) ? "block" : "none";

    if (!display && (CURRENT_NODE != null)) {
      Node_src = CURRENT_NODE.firstChild;
      Node_src.src = './images/' + id_item + '.jpg';
      CURRENT_NODE = null;
    } //if


    CURRENT_ITEM = (display) ? id_item : null;

    //detail
    document.getElementById(id_item + '_detail').style.display = (display) ? "block" : "none";

    if (CURRENT_SUBITEM != null) SubSectionDisplay(CURRENT_SUBITEM, false);

    if (display) SubSectionDisplay(id_item + '_default', true);
  }  //function

  function menuOnClick(Node) {
    if (DOM_TRUE) {
      var NodeClass = Node.parentNode.parentNode.className;
      SELECTED_ITEM = NodeClass;

      if (CURRENT_ITEM != null) SectionDisplay(CURRENT_ITEM, false);
      SectionDisplay(SELECTED_ITEM, true);

      Node_scr      = Node.firstChild;
      Node_scr.src  = './images/' + NodeClass + '_click.jpg';

//      egSIV(SELECTED_ITEM);

      CURRENT_NODE = Node;

      self.focus();


      return false;
    } else {
      return true;
    } //if
  } //function

  function SubSectionDisplay(id_item, display) {
    document.getElementById(id_item).style.display = (display) ? "block" : "none";
    CURRENT_SUBITEM = (display) ? id_item : null;
  }  //function


  function SectionOnClick(Node) {
    if (DOM_TRUE) {
      var NodeClass = Node.parentNode.parentNode.className;
      var ParentNodeClass = Node.parentNode.parentNode.parentNode.parentNode.className;
      //      document.getElementById(ParentNodeClass + '_detail').style.display = 'block';
      SELECTED_ITEM = ParentNodeClass + '_' + NodeClass;
      if (CURRENT_SUBITEM != null) SubSectionDisplay(CURRENT_SUBITEM, false);
      SubSectionDisplay(SELECTED_ITEM, true);

      return false;
    } else {
      return true;
    } //if
  } //function



  function egSIV(id_item) {
    var e = document.getElementById(id_item + '_menu');

    e.scrollIntoView(true);
  } //function



  //////////////////////////////////// e v e n t s ////////////////////////////
  function OnLoad () {
    if (DOM_TRUE) {
      CURRENT_ITEM = null;
      CURRENT_SUBITEM = null;
      document.getElementById("splash").style.display = "none";
      document.getElementById("main").style.display = "block";

      //add property for data binding
      var table_element

      table_element = document.getElementById("TABLE1");
      table_element.datasrc      = "#null";

      table_element = document.getElementById("routes_TABLE1");
      table_element.datasrc      = "#null";

//      table_element = document.getElementById("TABLE_foto");
//      table_element.datasrc      = "#null";

      //route
      table_element = document.getElementById("route_name");
      table_element.datafld      = "Route Name";
      table_element.dataformatas = "html";

      table_element = document.getElementById("route_category");
      table_element.datafld="Category";
      table_element.dataformatas="html";

      table_element = document.getElementById("route_rating");
      table_element.datafld="Rating";
      table_element.dataformatas="html";

      table_element = document.getElementById("route_time");
      table_element.datafld="Time";
      table_element.dataformatas="html";

      table_element = document.getElementById("route_description");
      table_element.datafld="Description";
      table_element.dataformatas="html";

      //note
      table_element = document.getElementById("note_date");
      table_element.datafld="date";
      table_element.dataformatas="html";

      table_element = document.getElementById("note_note");
      table_element.datafld="note";
      table_element.dataformatas="html";

      //foto
/*      table_element = document.getElementById("id_foto");
      table_element.datafld="n";
      table_element.dataformatas="html";

      table_element = document.getElementById("note_foto");
      table_element.datafld="note";
      table_element.dataformatas="html"; */


      //guest book
      table_element = document.getElementById("TABLE_gb");
      table_element.datasrc      = "#null";

      table_element = document.getElementById("autor_gb");
      table_element.datafld="Autor";
      table_element.dataformatas="html";

      table_element = document.getElementById("text_gb");
      table_element.datafld="Text";
      table_element.dataformatas="html";

      table_element = document.getElementById("datum_gb");
      table_element.datafld="Datum";
      table_element.dataformatas="html";

      //hide items for show csv in other browser
      if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)){
        document.getElementById("id_notes_noie").style.display = 'none';
        document.getElementById("id_routes_noie").style.display = 'none';
        document.getElementById("id_gb_noie").style.display = 'none';
        document.getElementById("id_foto_noie").style.display = 'none';
        if (document.getElementById("id_gallery_noie")) document.getElementById("id_gallery_noie").style.display = 'none';
      } //if
    }  //if
  }  //function

  function CloseOnClick(Node) {
    if (DOM_TRUE) {
      SectionDisplay(Node.parentNode.parentNode.id, false);
      return false;
    } else {
      return true;
    } //if
  } //function

  function menuOnMouseOver(Node) {
    if (DOM_TRUE) {
      var NodeClass = Node.parentNode.parentNode.className;
      if ((CURRENT_ITEM == null) | (CURRENT_ITEM != NodeClass)) {
        Node          = Node.firstChild;
        Node.src      = './images/' + NodeClass + '_over.jpg';
      } //if
    } //if
  } //

  function menuOnMouseOut(Node) {
    if (DOM_TRUE) {
      var NodeClass = Node.parentNode.parentNode.className
      if ((CURRENT_ITEM == null) | ((CURRENT_ITEM != null) && (CURRENT_ITEM != NodeClass))) {
        Node     = Node.firstChild;
        Node.src = './images/' + NodeClass + '.jpg';
      }  //if
    } //if
  } //

  function write_loading() {
    if (DOM_TRUE) {
     document.write('<div id="splash"><img src="./images/loading.gif" width="41" height="41" alt="Stránka se načítá..." /> Stránka se načítá,<br />čekejte prosím.</div>');
    } //if
  }  //

  function OnClick() {
    if (DOM_TRUE) {
      if (document.getElementById('id_news').style.display != 'none') {
        document.getElementById('id_news').style.display = 'none';
      } //if
    } //if
  } //if