// to show/hide the hotel descriptons
$(document).ready(function(){
 $(".hotel .description").hide(); //hides element with .description class inside .hotel

 $("#page-wrapper .hotel ul")
   .prepend("<li class='readbody'><a href='' title='Read the hotel description'>Description</a></li>"); //using prepend allows JS to find the UL in hotel and add an LI with a link that displays "Description"

 $(".actions li.readbody a").click(function(event){
 $(this).parents("ul").prev(".description").slideToggle("fast"); //code looks for the link "Read Body" then steps back through the HTML until it finds the class .description. If it finds this, it gets toggled on or off (changed to slide toggle set to 'fast' speed) and the default action of being a link is disabled (so we don't click away or reload the page)
 $(this).toggleClass("active");
   // Stop the link click from doing its normal thing
   return false;
 });

});

// to show/hide the hotels listed by province
$(document).ready(function(){
$(".province .allhotels").hide(); //hides the hotels & descriptions

	$(".province h2").click(function(){
		$(this).next(".allhotels").toggle();//code looks for a DIV with class of allhotels and toggles visibility on/off
		 $(this).toggleClass("active");
	 });
});


// to show all hotels 
$(document).ready(function(){
	$(".province .allhotels").hide(); 
	
	$(".showall").click(function(){
		$(".province .allhotels").show();
		 $(this).toggleClass("active");
	 });
});

// to hide all hotels 
$(document).ready(function(){
	$(".province .allhotels").hide(); 
	
	$(".hideall").click(function(){
		$(".province .allhotels").hide(); 
		 $(this).toggleClass("active");
	 });
});
