function adjustHeight(obj, offset) {
	var helpFrame = jQuery("#" + obj.name);
	var innerDoc = (helpFrame.get(0).contentDocument) ? helpFrame.get(0).contentDocument : helpFrame.get(0).contentWindow.document;
	helpFrame.height(innerDoc.body.scrollHeight + offset);
}
;
/**
 * 
 */

jQuery(document).ready(function () {


	(function ($) {
		
		//first hide all the hotprop to get table height
		 for(var i = 1; i < 21; i++)
		 {
			 $('#div_hot_prop_block_spacer' + i).hide();
			 $('#div_hot_prop_block' + i).hide();

		 } //end for
		 
		 var hotproptd = $('.td_hot_property').height();
		 var divhotpropblock = Number($('#div_hot_prop_block1').height() + 15);
		 //calculate space for properties that can be displayed
		 var hotpropdisplaynumber = Math.floor(hotproptd / divhotpropblock);
		 
		 //show at least the first 3 properties
		 for(var i = 1; i < 4; i++)
		 {
				 $('#div_hot_prop_block_spacer' + i).show();
				 //reset the css visibiltiy to be visible
				 $('#div_hot_prop_block' + i).css("visibility", "visible");
				 //now show the property
				 $('#div_hot_prop_block' + i).show('slow');

		 } //end for
		 
		 //display the hotproperties. Max is 20
		 for(var i = 4; i < 21; i++)
		 {
			 if ((i < hotpropdisplaynumber))
			 {
				 $('#div_hot_prop_block_spacer' + i).show();
				 //reset the css visibiltiy to be visible
				 $('#div_hot_prop_block' + i).css("visibility", "visible");
				 //now show the property
				 $('#div_hot_prop_block' + i).show('slow');

			 }//end if
		 } //end for

	})(jQuery);
	
});;
/**
 * Script for hiding and displaying property search form on all pages.
 */

jQuery(document).ready(function () {

	//hide the form on startup on page load
	(function ($) {
		
		//hide the advanced property type and remove the advanced property search
		$(".form-item-adv-property-type").remove();
		$('#zest-property-search-form').hide();
		
		//check if the home page search form indicator is set
		if ($('#show_search_form').val() == "true")
		{
			//set the checkbox value
			$('#search_box').attr('checked', true);
			
			//show form
			$('#zest-property-search-form').show("slow");
		}//end if
		
		$('#search_box').click(function (){
			var searchopt = $('#search_box:checked').val();

			if (searchopt == "on")
				{
					//add label to form
					$('#zest-property-search-form').prepend("<div id='qs_title'><h2>Property Search</h2></div>");
					$('#zest-property-search-form').show("slow");
					
				} else {
					//remove the label from the form
					$('#qs_title').remove();
					$('#zest-property-search-form').hide("slow");
				}//end if
					
		});
		
	})(jQuery);
	
});;

