$(function(){
	
	if($.browser.msie && $.browser.version=='6.0'){
		$('#content-left').css({'margin-left':'5px'});
		$('#content-left').css({'margin-right':'10px'});
		$('#content-right-home').css({'margin-left':'5px'});
	}
	
	$('.image_cycle img').css({'display':'none'});
	
	$('.image_cycle').css({'cursor':'pointer'});
	
	
	fade_speed = 1000;
	fade_timeout = 5000;
	
	$('#award_cycle').cycle({ 
		fx:    'fade', 
	    speed:  fade_speed,
	    timeout:  4000,
	    delay:	0
	});

	
	$('#cottages_fade1').cycle({ 
	    fx:    'fade', 
	    speed:  fade_speed,
	    timeout:  fade_timeout,  
	    delay:	0
	}).click(function(){
		document.location.href = 'cottages.php';
	});
	
	$('#cottages_fade2').cycle({ 
		fx:    'fade', 
		speed:  fade_speed,
		timeout:  fade_timeout,
		delay:	500  
	}).click(function(){
		document.location.href = 'facilities.php';
	});
	
	$('#cottages_fade3').cycle({ 
		fx:		'fade', 
		speed:	fade_speed,
		timeout:fade_timeout, 
		delay:	1000
	}).click(function(){
		document.location.href = document.getElementById('cottage_fade3_location').value;
	});
	
	$('#cottages_fade4').cycle({ 
		fx:		'fade', 
		speed:	fade_speed,
		timeout:fade_timeout, 
		delay:	1000
	}).click(function(){
		document.location.href = 'location.php';
	});
	
	$('#lnkPrivPol').click(function(){
		$('#privPol').css({'display':'block','opacity':'0'});
		$('#privPol').animate({opacity:1.0},300);
		$(this).blur();
		
		matchSides();
		
		return false;
	});
	
	$('#lnkTell').click(function(){
		$('#tell_friend').css({'display':'block','opacity':'0'});
		$('#tell_friend').animate({opacity:1.0},300);
		$(this).blur();
		
		matchSides();
		
		return false;
	});
	
	
	$('#text_resize span.up').click(function(){
		increaseFontSize();
		
		return false;
	});
	$('#text_resize span.down').click(function(){
		decreaseFontSize();
		
		return false;
	});
	
	$('#text_resize').css({'opacity':'0.4','filter':'alpha(opacity=40)'});
	
	setTimeout(function(){
		matchSides();
	},200);
		
	
	$('a.pdf').click(function(){
		$(this).attr('target', '_blank');
	});
	
	$('a.lightBox').lightBox();
	
});

function matchSides(){
	
	if($('#content-left').height() > $('#content-right').height()){
		$('#content-right').height($('#content-left').height());
	}else{
		$('#content-left').height($('#content-right').height());
	}
	
	if($('#content-left-home').height() > $('#content-right-home').height()){
		$('#content-right-home').height($('#content-left-home').height());
	}else{
		$('#content-left-home').height($('#content-right-home').height());
	}
	
	if($('#content-left-news').height() > $('#content-right-news').height()){
		$('#content-right-news').height($('#content-left-news').height());
	}else{
		$('#content-left-news').height($('#content-right-news').height());
	}
	
}