$(document).ready(function() {

/*
  // external links
  $(function() {
    $('div#page-content div.container a:not([href*="milvit.cz"])').each(function(){
      $(this).bind('click', function(){
        window.open(this.href);
        return false;
      }).attr("title", this.title + " [externí odkaz]");
    });
  });
*/

/*
  // search form
  $('form#searching-form').bind('submit', function(){
    if ($('input#search-text').val() == '') {
      alert('Zadejte prosím hledaný výraz');
      return false;
    }
    if ($('input#search-text').val().length < 3) {
      alert('Hledaný výraz musí obsahovat alespoň tři znaky');
      return false
    }
  });
*/

  // checks form
  $('input#ob-send').click(function() {
    var email = $('#ob-email');
    if (!email.val()) {
      if (email.focus) email.focus();
      alert('Zadejte prosím svou e-mailovou adresu');
      return false;
    } else {
      emailRegExp = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.([a-z]){2,4})$/;
      if (!emailRegExp.test(email.val())){
        if (email.focus) email.focus();
        alert('Zadaný e-mail neodpovídá formátu e-mailové adresy');
        return false;
      }
    }
  });

  // lightbox
  $(function() {
    $('div#page-content a[rel*=lightbox]').lightBox({
     fixedNavigation:true,
	   containerResizeSpeed: 350,
	   txtImage: 'Obrázek',
	   txtOf: 'z'
   });
  });

});

