$(document).ready(function(){ 

  var normalClass  = 'apartmentBig';
  var hoverClass   = 'apartmentBigBorder';
  var rightPlace   = 'apartmentBigRight';
  var hoverInClass = 'apartmentBigHover';

  $('.apartmentBig .apartmentBigLeft, .apartmentBigRight').live('mouseover', function(event) {
          
        $(this).parent().removeClass(normalClass);
        $(this).parent().addClass(hoverClass);     
        $('.' + hoverClass, this).css('border', '6px solid rgb(229,229,229)');        
        $('.' + rightPlace + ' img', $(this).parent()).hide();
        $(this).parent().find('.' + hoverInClass).show();

  });
  
  $('.apartmentBigBorder').live('mouseout', function(event) {
  
        $(this).removeClass(hoverClass);
        $(this).addClass(normalClass);
        $(this).find('.' + hoverInClass).hide();
        $('> .' + rightPlace + ' img', this).show();
        
  }); 
  
  $('#popupMap, #popupAmenities, #popupServices, #popupLocation, #popupArea, #popupReviews').simpleDialog();
  
  // zjištění velikosti boxů na mp a nastavení společné výšky
  var box1 = '#equipment';
  var box2 = '#textBox';
  var box1_height = $(box1).height();
  var box2_height = $(box2).height();
  
  if(box1_height > box2_height) 
    $(box2).height(box1_height);
  else
    $(box1).height(box2_height);
    

	$('#orderForm').submit(function()
	{			
		if($('#jmeno').val() == "")
		{
			alert("Please fill up your first name");
			return false;
		}
		
		if($('#prijmeni').val() == "")
		{
			alert("Please fill up your surname");
			return false;
		}
		
		if($('#email').val() == "")
		{
			alert("Please fill up your email");
			return false;
		}

		if($('#telefon').val() == "")
		{
			alert("Please fill up your phone");
			return false;
		}
		
		if($('#stat').val() == "")
		{
			alert("Please fill up your country");
			return false;
		}
		
		if($('#prijezd').val() == "")
		{
			alert("Please fill up arrival date");
			return false;
		}

		if($('#odjezd').val() == "")
		{
			alert("Please fill up departure date");
			return false;
		}
				
		if($('#dospeli').val() == "")
		{
			alert("Please fill up number of adults");
			return false;
		}
		
		if($('#deti').val() == "")
		{
			alert("Please fill up number of children");
			return false;
		}
		return true;
	});

	$('#contactsForm').submit(function()
	{			
		if($('#jmeno').val() == "")
		{
			alert("Please fill up your name");
			return false;
		}
		
		if($('#email').val() == "")
		{
			alert("Please fill up your email");
			return false;
		}

		if($('#telefon').val() == "")
		{
			alert("Please fill up your phone");
			return false;
		}
		
		if($('#text').val() == "")
		{
			alert("Please fill up your message");
			return false;
		}
		return true;
	});

	//po nacteni zobrazovat pouze prvni tri mesice kalendare
	$('#zbytek-roku').css('display', 'none');
	
	//zobrazit cely rok
	$('#zobrazit-rok').click(function()
	{
		$('#zobrazit-rok').css('display', 'none');
		$('#zbytek-roku').css('display', 'block');
		return false;
	});
	

});

