$(function(){

	$('#readOverlay').css('position', 'absolute').css('height', '900px');
	
	$messageOn = $('.message').size();
	
	if($messageOn > '0'){
		$('#readOverlay').css('display', 'none');
	}
	
/* 
* Read button clicked 
*/

	$('input.read').click(function(){
		
		$('#readOverlay').fadeOut(500);
	});

/* 
* pasture info
*/

	$('.pasture').click(function(){
					
		$(this).next().next().slideDown(1000);					
	});
	
	
	$('.bookingBut').click(function(){
		
		if($('.contactGeneral').hasClass('open')){
			$('.contactGeneral').slideUp(500).removeClass('open');			
			$('.siteInfo').slideDown(500);
		}
	});
		
	$('.generalBut').click(function(){
		if($('.contactGeneral').hasClass('open')){}else{
			$('.contactGeneral').slideDown(500).addClass('open');
			$('.siteInfo').slideUp(500);
		}
	});

/* 
* Calc price
*/
	
	$('.tents, .adults, .children').focusout(function(){
		$tents = $('.tents').attr('value')*10;
		$adults = $('.adults').attr('value')*6;
		$children = $('.children').attr('value')*3;
		
		$total = $tents + $adults;
		$total =  $total + $children;
		$('.calc').attr('value', $total); 
		
	})
	
	
});
