$(document).ready(function(){



	//full area linking
	$(".consultation").click(function(){
	  window.location=$(this).find("a").attr("href"); return false;
	});
	
	$("#home_options li").click(function(){
	  window.location=$(this).find("a").attr("href"); return false;
	});
	
      
	
	//photo scroller for before-afters
	$('.photos').innerfade({
	  speed: 'slow', timeout: 4000, containerheight: '260px'
	});
	
	
	
	//home page tabs
	$("#home_tabs").tabs({
	  event: 'mouseover'
	});
	
	//tabs for location page  - preselect canterbury
	$("#test").tabs({
	  selected: 5,
	  fx: {opacity: 'toggle', duration:'fast' }
	  });
	
	//form validation
	$("#QuestionForm").validate();
	
	//form validation
	$("#EntryForm").validate();
	
	
	// hide/reveal 'tofriend'
	var friendbutton = $("#toFriend"); // checkbox
	var block = $("#detailsFriend"); // block to hide/reveal
	
	// hide to start
	$(block).hide();

	$(friendbutton).click(function() {
		if ($(friendbutton).is(':checked')){
			// show
			$(block).slideDown('normal');
		} else {
			// hide
			$(block).slideUp('fast');
		}
	});
	
});