$(document).ready(function()
  {
    //$(".fotogalerie a").lightBox();

    // odkazy s http do noveho okna
    $("a:[href^='http://']").each(function() {
      $(this).addClass("out-link");
      $(this).attr('title', $(this).attr('title') + " - Odkaz do nového okna");
      $(this).attr({
        target: "_blank"
      });
    });
    
    //main menu
    $("#main-menu li:has(ul)").hover(function()
    {
      if (!$(this).children("ul").is(':animated'))
      {
        $(this).children("ul").css("display", "none");
        $(this).children("ul").slideDown("normal");
      }
    },
    function()
    {
      $(this).children("ul").slideUp("fast");
    });

    $("#main-menu li:has(ul)").hover(function()
    {
      $(this).children("a").addClass("active");
    },
    function()
    {
      $(this).children("a").removeClass("active");
    });
    
    // defaultni texty do formulare
    var $text1 = "Jméno";
    $("#text1").attr("value", $text1);
    $("#text1").blur(function () {
      if (!$(this).attr("value")) {
        $(this).attr("value", $text1);
      }
    })
    $("#text1").focus(function () {
      if ($(this).attr("value") == $text1) {
        $(this).attr("value", "");
      }
    })
    var $text2 = "Telefon";
    $("#text2").attr("value", $text2);
    $("#text2").blur(function () {
      if (!$(this).attr("value")) {
        $(this).attr("value", $text2);
      }
    })
    $("#text2").focus(function () {
      if ($(this).attr("value") == $text2) {
        $(this).attr("value", "");
      }
    })
    var $text3 = "Email";
    $("#text3").attr("value", $text3);
    $("#text3").blur(function () {
      if (!$(this).attr("value")) {
        $(this).attr("value", $text3);
      }
    })
    $("#text3").focus(function () {
      if ($(this).attr("value") == $text3) {
        $(this).attr("value", "");
      }
    })
    var $text4 = "Jméno";
    $("#text4").attr("value", $text4);
    $("#text4").blur(function () {
      if (!$(this).attr("value")) {
        $(this).attr("value", $text4);
      }
    })
    $("#text4").focus(function () {
      if ($(this).attr("value") == $text4) {
        $(this).attr("value", "");
      }
    })
    var $text5 = "Vaše zpráva";
    $("#text5").attr("value", $text5);
    $("#text5").blur(function () {
      if (!$(this).attr("value")) {
        $(this).attr("value", $text5);
      }
    })
    $("#text5").focus(function () {
      if ($(this).attr("value") == $text5) {
        $(this).attr("value", "");
      }
    })
  });
