var data = {};
var myShow = {};
var jazyk = 'en';
var dayl = 'none';
var addr = '';
//var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
var currentSlideshow = '';

function zmenitHlavu() {
  zmenitMenu();
  zmenitLogo();
}

function zmenitLogo() {
  jQuery('#logo').fadeOut(500, function() {
    if (!dayl) {
      if (kategorie == 0) jQuery('#logo').css('background-image', "url('/img/logo-0-day.png')");
      else if (kategorie == 1) jQuery('#logo').css('background-image', "url('/img/logo-1-day.png')");
      else if (kategorie == 2) jQuery('#logo').css('background-image', "url('/img/logo-2-day.png')");
      else if (kategorie == 3) jQuery('#logo').css('background-image', "url('/img/logo-3-day.png')");
      else if (kategorie == 4) jQuery('#logo').css('background-image', "url('/img/logo-4-day.png')");
      else if (kategorie == 5) jQuery('#logo').css('background-image', "url('/img/logo-5-day.png')");
      else if (kategorie == 6) jQuery('#logo').css('background-image', "url('/img/logo-6-day.png')");
      else if (kategorie == 7) jQuery('#logo').css('background-image', "url('/img/logo-7-day.png')");
      else if (kategorie == 8) jQuery('#logo').css('background-image', "url('/img/logo-8-day.png')");
    } else {
      if (kategorie == 0) jQuery('#logo').css('background-image', "url('/img/logo-0-night.png')");
      else if (kategorie == 1) jQuery('#logo').css('background-image', "url('/img/logo-1-night.png')");
      else if (kategorie == 2) jQuery('#logo').css('background-image', "url('/img/logo-2-night.png')");
      else if (kategorie == 3) jQuery('#logo').css('background-image', "url('/img/logo-3-night.png')");
      else if (kategorie == 4) jQuery('#logo').css('background-image', "url('/img/logo-4-night.png')");
      else if (kategorie == 5) jQuery('#logo').css('background-image', "url('/img/logo-5-night.png')");
      else if (kategorie == 6) jQuery('#logo').css('background-image', "url('/img/logo-6-night.png')");
      else if (kategorie == 7) jQuery('#logo').css('background-image', "url('/img/logo-7-night.png')");
      else if (kategorie == 8) jQuery('#logo').css('background-image', "url('/img/logo-8-night.png')");
    }
    jQuery('#logo').fadeIn(500);
  });
}

function zmenitMenu() {
  var cz_hover = ''; if (jazyk == 'cs') cz_hover = '-hover';
  var en_hover = ''; if (jazyk == 'en') en_hover = '-hover';
  var ab_hover = ''; if (addr == 'about-us') ab_hover = '-hover';
  var cl_hover = ''; if (addr == 'clients') cl_hover = '-hover';
  var fr_hover = ''; if (addr == 'friends') fr_hover = '-hover';
  var cn_hover = ''; if (addr == 'contact') cn_hover = '-hover';
  var on_hover = ''; if (addr == 'o-nas') on_hover = '-hover';
  var kl_hover = ''; if (addr == 'klienti') kl_hover = '-hover';
  var pr_hover = ''; if (addr == 'pratele') pr_hover = '-hover';
  var kt_hover = ''; if (addr == 'kontakt') kt_hover = '-hover';
  var lgc_hover = ''; if (addr == 'logocid') lgc_hover = '-hover';
  var arc_hover = ''; if (addr == 'architecture') arc_hover = '-hover';
  var fsc_hover = ''; if (addr == 'fashion') fsc_hover = '-hover';
  var oth_hover = ''; if (addr == 'other') oth_hover = '-hover';
  var imgPreload = '';
  if (!dayl) {
    imgPreload = '<img src="img/cz-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/en-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/EN-about-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/EN-clients-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/EN-friends-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/EN-contact-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/CZ-info-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/CZ-klienti-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/CZ-pratele-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/CZ-kontakt-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/EN-logo_and_cid-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/EN-architecture-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/EN-fashion-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/EN-misc-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/CZ-architektura-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/CZ-ruzne-hover.png" width="1" height="1" style="display: none;" />';
      
    jQuery('.jazyk_cs').css('background-image', "url('/img/cz"+cz_hover+".png')");
    jQuery('.jazyk_cs').hover(function() { jQuery(this).css('background-image', "url('/img/cz-hover.png')"); },
                           function() { jQuery(this).css('background-image', "url('/img/cz"+cz_hover+".png')"); });
    jQuery('.jazyk_en').css('background-image', "url('/img/en"+en_hover+".png')");
    jQuery('.jazyk_en').hover(function() { jQuery(this).css('background-image', "url('/img/en-hover.png')"); },
                           function() { jQuery(this).css('background-image', "url('/img/en"+en_hover+".png')"); });
    jQuery('.menu_about').css('background-image', "url('/img/EN-about"+ab_hover+".png')");
    jQuery('.menu_about').hover(function() { jQuery(this).css('background-image', "url('/img/EN-about-hover.png')"); },
                           function() { jQuery(this).css('background-image', "url('/img/EN-about"+ab_hover+".png')"); });
    jQuery('.menu_clients').css('background-image', "url('/img/EN-clients"+cl_hover+".png')");
    jQuery('.menu_clients').hover(function() { jQuery(this).css('background-image', "url('/img/EN-clients-hover.png')"); },
                             function() { jQuery(this).css('background-image', "url('/img/EN-clients"+cl_hover+".png')"); });
    jQuery('.menu_friends').css('background-image', "url('/img/EN-friends"+fr_hover+".png')");
    jQuery('.menu_friends').hover(function() { jQuery(this).css('background-image', "url('/img/EN-friends-hover.png')"); },
                             function() { jQuery(this).css('background-image', "url('/img/EN-friends"+fr_hover+".png')"); });
    jQuery('.menu_contact').css('background-image', "url('/img/EN-contact"+cn_hover+".png')");
    jQuery('.menu_contact').hover(function() { jQuery(this).css('background-image', "url('/img/EN-contact-hover.png')"); },
                             function() { jQuery(this).css('background-image', "url('/img/EN-contact"+cn_hover+".png')"); });
    jQuery('.menu_o-nas').css('background-image', "url('/img/CZ-info"+on_hover+".png')");
    jQuery('.menu_o-nas').hover(function() { jQuery(this).css('background-image', "url('/img/CZ-info-hover.png')"); },
                           function() { jQuery(this).css('background-image', "url('/img/CZ-info"+on_hover+".png')"); });
    jQuery('.menu_klienti').css('background-image', "url('/img/CZ-klienti"+kl_hover+".png')");
    jQuery('.menu_klienti').hover(function() { jQuery(this).css('background-image', "url('/img/CZ-klienti-hover.png')"); },
                             function() { jQuery(this).css('background-image', "url('/img/CZ-klienti"+kl_hover+".png')"); });
    jQuery('.menu_pratele').css('background-image', "url('/img/CZ-pratele"+pr_hover+".png')");
    jQuery('.menu_pratele').hover(function() { jQuery(this).css('background-image', "url('/img/CZ-pratele-hover.png')"); },
                             function() { jQuery(this).css('background-image', "url('/img/CZ-pratele"+pr_hover+".png')"); });
    jQuery('.menu_kontakt').css('background-image', "url('/img/CZ-kontakt"+kt_hover+".png')");
    jQuery('.menu_kontakt').hover(function() { jQuery(this).css('background-image', "url('/img/CZ-kontakt-hover.png')"); },
                             function() { jQuery(this).css('background-image', "url('/img/CZ-kontakt"+kt_hover+".png')"); });
    jQuery('.galerie_logocid').css('background-image', "url('/img/EN-logo_and_cid"+lgc_hover+".png')");
    jQuery('.galerie_logocid').hover(function() { jQuery(this).css('background-image', "url('/img/EN-logo_and_cid-hover.png')"); },
                                function() { jQuery(this).css('background-image', "url('/img/EN-logo_and_cid"+lgc_hover+".png')"); });
    jQuery('.galerie_architecture').css('background-image', "url('/img/EN-architecture"+arc_hover+".png')");
    jQuery('.galerie_architecture').hover(function() { jQuery(this).css('background-image', "url('/img/EN-architecture-hover.png')"); },
                                     function() { jQuery(this).css('background-image', "url('/img/EN-architecture"+arc_hover+".png')"); });
    jQuery('.galerie_fashion').css('background-image', "url('/img/EN-fashion"+fsc_hover+".png')");
    jQuery('.galerie_fashion').hover(function() { jQuery(this).css('background-image', "url('/img/EN-fashion-hover.png')"); },
                                function() { jQuery(this).css('background-image', "url('/img/EN-fashion"+fsc_hover+".png')"); });
    jQuery('.galerie_other').css('background-image', "url('/img/EN-misc"+oth_hover+".png')");
    jQuery('.galerie_other').hover(function() { jQuery(this).css('background-image', "url('/img/EN-misc-hover.png')"); },
                              function() { jQuery(this).css('background-image', "url('/img/EN-misc"+oth_hover+".png')"); });
    jQuery('.galerie_architektura').css('background-image', "url('/img/CZ-architektura"+arc_hover+".png')");
    jQuery('.galerie_architektura').hover(function() { jQuery(this).css('background-image', "url('/img/CZ-architektura-hover.png')"); },
                                     function() { jQuery(this).css('background-image', "url('/img/CZ-architektura"+arc_hover+".png')"); });
    jQuery('.galerie_ruzne').css('background-image', "url('/img/CZ-ruzne"+oth_hover+".png')");
    jQuery('.galerie_ruzne').hover(function() { jQuery(this).css('background-image', "url('/img/CZ-ruzne-hover.png')"); },
                              function() { jQuery(this).css('background-image', "url('/img/CZ-ruzne"+oth_hover+".png')"); });
  } else {
    imgPreload = '<img src="img/cz_night-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/en_night-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/about-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/clients-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/friends-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/contact-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/info-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/klienti-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/pratele-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/kontakt-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/logo_and_cid-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/architecture-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/fashion-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/misc-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/architektura-hover.png" width="1" height="1" style="display: none;" />' +
                 '<img src="img/ruzne-hover.png" width="1" height="1" style="display: none;" />';

    jQuery('.jazyk_cs').css('background-image', "url('/img/cz_night"+cz_hover+".png')");
    jQuery('.jazyk_cs').hover(function() { jQuery(this).css('background-image', "url('/img/cz_night-hover.png')"); },
                           function() { jQuery(this).css('background-image', "url('/img/cz_night"+cz_hover+".png')"); });
    jQuery('.jazyk_en').css('background-image', "url('/img/en_night"+en_hover+".png')");
    jQuery('.jazyk_en').hover(function() { jQuery(this).css('background-image', "url('/img/en_night-hover.png')"); },
                           function() { jQuery(this).css('background-image', "url('/img/en_night"+en_hover+".png')"); });
    jQuery('.menu_about').css('background-image', "url('/img/about"+ab_hover+".png')");
    jQuery('.menu_about').hover(function() { jQuery(this).css('background-image', "url('/img/about-hover.png')"); },
                           function() { jQuery(this).css('background-image', "url('/img/about"+ab_hover+".png')"); });
    jQuery('.menu_clients').css('background-image', "url('/img/clients"+cl_hover+".png')");
    jQuery('.menu_clients').hover(function() { jQuery(this).css('background-image', "url('/img/clients-hover.png')"); },
                             function() { jQuery(this).css('background-image', "url('/img/clients"+cl_hover+".png')"); });
    jQuery('.menu_friends').css('background-image', "url('/img/friends"+fr_hover+".png')");
    jQuery('.menu_friends').hover(function() { jQuery(this).css('background-image', "url('/img/friends-hover.png')"); },
                             function() { jQuery(this).css('background-image', "url('/img/friends"+fr_hover+".png')"); });
    jQuery('.menu_contact').css('background-image', "url('/img/contact"+cn_hover+".png')");
    jQuery('.menu_contact').hover(function() { jQuery(this).css('background-image', "url('/img/contact-hover.png')"); },
                             function() { jQuery(this).css('background-image', "url('/img/contact"+cn_hover+".png')"); });
    jQuery('.menu_o-nas').css('background-image', "url('/img/info"+on_hover+".png')");
    jQuery('.menu_o-nas').hover(function() { jQuery(this).css('background-image', "url('/img/info-hover.png')"); },
                           function() { jQuery(this).css('background-image', "url('/img/info"+on_hover+".png')"); });
    jQuery('.menu_klienti').css('background-image', "url('/img/klienti"+kl_hover+".png')");
    jQuery('.menu_klienti').hover(function() { jQuery(this).css('background-image', "url('/img/klienti-hover.png')"); },
                             function() { jQuery(this).css('background-image', "url('/img/klienti"+kl_hover+".png')"); });
    jQuery('.menu_pratele').css('background-image', "url('/img/pratele"+pr_hover+".png')");
    jQuery('.menu_pratele').hover(function() { jQuery(this).css('background-image', "url('/img/pratele-hover.png')"); },
                             function() { jQuery(this).css('background-image', "url('/img/pratele"+pr_hover+".png')"); });
    jQuery('.menu_kontakt').css('background-image', "url('/img/kontakt"+kt_hover+".png')");
    jQuery('.menu_kontakt').hover(function() { jQuery(this).css('background-image', "url('/img/kontakt-hover.png')"); },
                             function() { jQuery(this).css('background-image', "url('/img/kontakt"+kt_hover+".png')"); });
    jQuery('.galerie_logocid').css('background-image', "url('/img/logo_and_cid"+lgc_hover+".png')");
    jQuery('.galerie_logocid').hover(function() { jQuery(this).css('background-image', "url('/img/logo_and_cid-hover.png')"); },
                                function() { jQuery(this).css('background-image', "url('/img/logo_and_cid"+lgc_hover+".png')"); });
    jQuery('.galerie_architecture').css('background-image', "url('/img/architecture"+arc_hover+".png')");
    jQuery('.galerie_architecture').hover(function() { jQuery(this).css('background-image', "url('/img/architecture-hover.png')"); },
                                     function() { jQuery(this).css('background-image', "url('/img/architecture"+arc_hover+".png')"); });
    jQuery('.galerie_fashion').css('background-image', "url('/img/fashion"+fsc_hover+".png')");
    jQuery('.galerie_fashion').hover(function() { jQuery(this).css('background-image', "url('/img/fashion-hover.png')"); },
                                function() { jQuery(this).css('background-image', "url('/img/fashion"+fsc_hover+".png')"); });
    jQuery('.galerie_other').css('background-image', "url('/img/misc"+oth_hover+".png')");
    jQuery('.galerie_other').hover(function() { jQuery(this).css('background-image', "url('/img/misc-hover.png')"); },
                              function() { jQuery(this).css('background-image', "url('/img/misc"+oth_hover+".png')"); });
    jQuery('.galerie_architektura').css('background-image', "url('/img/architektura"+arc_hover+".png')");
    jQuery('.galerie_architektura').hover(function() { jQuery(this).css('background-image', "url('/img/architektura-hover.png')"); },
                                     function() { jQuery(this).css('background-image', "url('/img/architektura"+arc_hover+".png')"); });
    jQuery('.galerie_ruzne').css('background-image', "url('/img/ruzne"+oth_hover+".png')");
    jQuery('.galerie_ruzne').hover(function() { jQuery(this).css('background-image', "url('/img/ruzne-hover.png')"); },
                              function() { jQuery(this).css('background-image', "url('/img/ruzne"+oth_hover+".png')"); });
  }
  jQuery('#imgPreload').html(imgPreload);
}

function controlDayLight() {
  var d = new Date();
  var h = d.getHours();
  //if (dayl && d.getMinutes() % 2 == 0 || !dayl && d.getMinutes() % 2 == 1 || dayl == 'none') {
  if (dayl && h >= 8 && h < 20 || !dayl && (h < 8 || h >= 20) || dayl == 'none') {
    if (dayl == 'none') {
      //if (d.getMinutes() % 2 == 0) dayl = true;
      if (h >= 8 && h < 20) dayl = true;
      else dayl = false;
    }
    if (dayl) dayLight('day');
    else dayLight('night');
    dayl = !dayl;
    zmenitHlavu();
  }
}

function dayLight(light) {
    jQuery("head").append("<link>");
    css = jQuery("head").children(":last");
    css.attr({
      rel:  "stylesheet",
      type: "text/css",
      href: "/css/" + light + ".css"
    });
    //$.getScript("/css/" + light + ".css");
}


function showElement(elm) {
  //if (jQuery('#show').css('display') != 'none' && picRow == lastRow - 1)
    //jQuery(elm).css('position', 'absolute');

  //jQuery('.tArt').slideUp("slow");
  if (!lockScroll || lastImage != elm) {
    lockScroll = true;

    jQuery(elm).slideDown(500, function() {
      lockScroll = false;
    });
    lastImage = elm;
  }
}

function hideElement(submenuId, elm, event) {
  if (submenuId == 'pB' + currentSlideshow)
    return;
  var toElement = null;
  if (event.relatedTarget)
    toElement = event.relatedTarget;
  else if (event.toElement)
    toElement = event.toElement;
    
  while (toElement && toElement.id != submenuId)
    toElement = toElement.parentNode;
  if (!toElement) {

    //jQuery('.tArt').slideUp(500);
    //Po odjetí zatáhneme všechny náhledy kromě náležejícího k aktuální slideshow
    for (i = 0; i < tartArray.length; i++) {
      if ('tArt' + currentSlideshow != tartArray[i]) {
          jQuery('#tArt' + gridArray[i]).slideUp(500);
      }
    }
  }
}

/*
var k = 0;
function ToggleElement(elm, picRow)
{
    if (!lockScroll || lastImage != elm) {
      lockScroll = true;
      //if (picRow == lastRow - 1)
        //jQuery('div[name|=pBox' + lastRow + ']').css('height', 316);
      if (lastImage != '' && lastImage != elm)
        jQuery(lastImage).slideUp("slow");
      jQuery(elm).slideToggle("slow", function() {
        lockScroll = false;
      });
      lastImage = elm;
    }
};
*/

function ToggleSub(elm)
{
    if (!lockScroll) {
      lockScroll = true;
      if (lastImage != '' && lastImage != elm)
        jQuery(lastImage).slideUp("slow");
      jQuery(elm).slideToggle("slow", function() {
        lockScroll = false;
      });
      lastImage = elm;
    }
};

/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch() {
    var $active = jQuery('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = jQuery('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : jQuery('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = jQuery( $sibs[ rndNum ] );

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function preloadSlideShow() {
    data[''] = {};
    myShow = new Slideshow.Push('show', data, {controller: true, height: 361, hu: 'galerie/slideshow', width: 722, delay: 5000});
    jQuery('#show').hide();
}

function loadData() {
  data = {};
  strs = jQuery('#slideshow').html().split(";");
  for (var i = 0; i < strs.length - 1; i++) {
    data[strs[i]] = {};
  }

  myShow.destroy();

  if (strs.length <= 2) {
    myShow = new Slideshow.Push('show', data, {paused: true, height: 361, hu: 'galerie/slideshow', width: 722, delay: 5000});
    jQuery('.slideshow-controller li').hide();
  } else
    myShow = new Slideshow.Push('show', data, {controller: true, height: 361, hu: 'galerie/slideshow', width: 722, delay: 5000});

  //jQuery('#show').html('<img src="galerie/slideshow/12793610974811.jpg" />');
  //myShow.load(data);
}

function loadSlideShow(id) {
    var row = 0;
    if (row > 0) used = true;
    
    var zasun = (jQuery('#show').css('display') == 'none')? false : true;
    currentSlideshow = '';
    jQuery('#description').slideUp(0);
    jQuery('#slideshowstrip').slideUp(0);
    jQuery('#show').slideUp("slow", function() {
      if (zasun) {
        for (i = 0; i < tartArray.length; i++) {
          if ('tArt' + currentSlideshow != tartArray[i]) {
              jQuery('#tArt' + gridArray[i]).slideUp(500);
          }
        }
      }
    });

    if (lastRow != '-1') jQuery('div[name|=pBox' + lastRow + ']').slideUp("slow");

    jQuery('#show').css('top', row * 65);
    jQuery('#show').css('margin-bottom', -361);
    jQuery('#slideshowstrip').css('top', 361 + row * 65);
    jQuery('#description').css('top', 366 + row * 65);
    
    jQuery('#slideshow').load('/ajax/slideshow.php?gid=' + id, function() {
      loadData();
    });
    jQuery('#description').load('/ajax/description.php?gid=' + id + '&jazyk=' + jazyk);
    
    if (!zasun) {
      jQuery('#description').slideToggle(0);
      jQuery('#slideshowstrip').slideToggle(0);
    }
    if (!zasun) currentSlideshow = id;
    if (lastId != id || (lastId == id && !zasun)) {
      jQuery('div[name|=pBox' + row + ']').slideDown("slow");
      jQuery('#show').slideToggle("slow", function() {
        if (zasun) {
          jQuery('#description').slideToggle(0);
          jQuery('#slideshowstrip').slideToggle(0);
        } else {
        }
      });
      currentSlideshow = id;
    }
    lastRow = row;
    lastId = id;
}

function loadPage(address) {
    jQuery("#show").hide();
    jQuery("#slideshow").hide();
    jQuery("#contentText").slideUp(1000, function () {
      jQuery("#contentText").load('/ajax/loadpage.php?address=' + address + '&jazyk=' + jazyk, function () {
        jQuery("#contentText").slideDown(1000);
        addr = address;
        zmenitHlavu();
      });
    });
}

function loadMenu(lang) {
    jQuery("#menu").fadeOut(500, function () {
      jQuery("#menu").load('/ajax/menu.php?jazyk=' + lang, function () {
        jQuery("#menu").fadeIn(500);
        jazyk = lang;
        zmenitMenu();
      });
    });
    loadPage(addr);
    //zmenitLogo();
}

var lastX = -1;
var lastY = -1;
function setEvents() {
  jQuery('div[name|=pB]').mouseover(function(e) {
    var elmId = this.childNodes[0].id || this.childNodes[1].id;
    if (lastX != e.pageX || lastY != e.pageY)
      showElement('#' + elmId);
    lastX = e.pageX; lastY = e.pageY;
  });
}

function ie6warning() {
  jQuery("#ie6warning").load('/ajax/ie6warning.html', function() {
    jQuery("#ie6warning").slideDown("slow");
  });
}

jQuery(function() {
    controlDayLight();
    setInterval( "slideSwitch()", 5000 );
    setInterval( "controlDayLight()", 1000 );
    //if (IE6) ie6warning();
    //else {
    loadMenu('cs');
      //loadPage('');
    //}
});

