$(document).ready(function() { // wykonaj po załadowaniu strony
  $('#search input[type="text"], #newsletter input[type="text"]').focus(function() {
    if (this.value == this.defaultValue) {
      	this.value = '';
  	}
    if(this.value != this.defaultValue) {
    	this.select();
    }
  });
  $('#search input[type="text"], #newsletter input[type="text"]').blur(function() {
    if ($.trim(this.value == '')) {
      this.value = (this.defaultValue ? this.defaultValue : '');
  	}
  });
  
  
  $("#menu li").hover(
    function() {
      $(this).children().children().attr('src', $(this).children().children().get(0).src.replace('-off', '-hover'));
    }, function() {
      $(this).children().children().attr('src', $(this).children().children().get(0).src.replace('-hover', '-off'));
    }
  );
  
  
  $("#logo img").hover(
    function() {
      $(this).attr('src', $(this).get(0).src.replace('-off', '-hover'));
    }, function() {
      $(this).attr('src', $(this).get(0).src.replace('-hover', '-off'));
    }
  );
  
  $('#menu').droppy({speed: 350});
  
	$("#data_przyjazdu, #data_wyjazdu, #input-datawyjazdu, #input-dataprzyjazdu").datepicker({
		showOn: 'button',
		buttonImage: 'images/calendar.jpg',
		buttonImageOnly: true,
		dateFormat: 'dd.mm.yy',
		dayNames: ['Niedziela', 'Poniedziałek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota'],
		dayNamesShort: ['Nd', 'Pn', 'Wt', 'Śr', 'Czw', 'Pt', 'Sob'],
		dayNamesMin: ['Nd', 'Pn', 'Wt', 'Śr', 'Czw', 'Pt', 'Sob'],
    monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','Październik', 'Listopad', 'Grudzień'],
    firstDay: 1
		
	});
	

	$(".fancybox[rel=group], .fancybox, .lighbox, .lightbox[rel=group]").fancybox({
		'titleShow'     : false,
		'autoScale'     : false
		});
		
  $("a.fancybox-youtube").click(function() {
    $.fancybox({
      'autoScale'           : false,
      'transitionIn'        : 'none',
      'transitionOut'       : 'none',
      'width'               : 640,
      'height'              : 360,
      'href'                : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
      'type'                : 'swf',
      'swf'                 : {'allowfullscreen':'true'} // <-- flashvars here
    });
    return false;
  }); 
  
} );


// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 10;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 2;
// -----------------------------------------------------------------------------

