
/* <![CDATA[ */  
$(document).ready(function() {

	$('#videos a, .scrollable img, .latestlisting a, .searchresult img:not(.icon)').hover(function() {
		$(this).stop().animate({"opacity" : .7});									
	}, function(){
		$(this).stop().animate({"opacity" : 1});	
	});


	$('#prev, #next').animate({"opacity" : 0});
	$('#slider').hover(function() {
		$('#prev, #next').stop().animate({"opacity" : .5});									
		}, function(){
		$('#prev, #next').stop().animate({"opacity" : 0});	
	});

	$(".contact-slide").click(function(){
		if($("#e-news-panel").is(":visible")){
			$("#e-news-panel").slideToggle("fast");
		}
		if($("#slide-panel").is(":visible")){
			$("#slide-panel").slideToggle("fast");
		}
		$("#contact-panel").slideToggle("slow");
	});
	$(".e-news-slide").click(function(){
		if($("#contact-panel").is(":visible")){
			$("#contact-panel").slideToggle("fast");
		}
		if($("#slide-panel").is(":visible")){
			$("#slide-panel").slideToggle("fast");
		}
		$("#e-news-panel").slideToggle("slow");
	});
	$(".btn-slide").click(function(){
		if($("#e-news-panel").is(":visible")){
			$("#e-news-panel").slideToggle("fast");
		}
		if($("#contact-panel").is(":visible")){
			$("#contact-panel").slideToggle("fast");
		}
		$("#slide-panel").slideToggle("slow");
	});


	$('#social a').tipsy({gravity: 's', fade: true});

	$('#dsidx-disclaimer + p').addClass('disclaimer');

	$('#dsidx-property-types').prependTo('#dsidx-description');
	$('[name=idx-q-BedsMin], [name=idx-q-BathsMin]').after('&nbsp;&nbsp;');



	// move "read more" link/button so it's inline with it's previous paragraph
	$(".readmore").each(function(index) {
		$(this).appendTo($(this).parent("div").children("p:last"));
	});

	$(".dsidx-listing").append("<div class='shadow-small'></div>");
	
	$("#dsidx-listing-source").append("<p><br /><b>Location & Birds Eye Map Disclaimer:</b> The above map markers are based on the property listings physical address and utilize Google and Microsoft technology that may not be 100% accurate, however, this technology is always improving and currently shows excellent views of surrounding neighborhood amenities. Please use the address listed at the top of the page to locate this property in person.</p>");
	
	
	
	/* Price Protection
	 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	 * If anything needs price protection, we'll have to add it here.
	 */
	 
	$("div:contains('MLS # 21102028')").find("#dsidx-primary-data > tbody:last").after('<tr class="dsidx-secondary-row"><th><a href="http://www.homebuyerspriceprotection.com/" target="_blank"><img src="http://www.tonyratchford.com/wp-content/themes/openHouse/images/homeBuyers-PriceProtection.png" style="padding:0; border:none;"/></a></th></tr>');

	$('.comment-body').append("<div class='comment_pointer' />");

	$(".searchresult:nth-child(3n+3), .agentresults:nth-child(odd)").addClass("norightmargin");
	$(".searchresult:nth-child(3n+2)").addClass("clearleft");
   

	$(".agentresult:nth-child(3n+2)").addClass("norightmargin");
	$(".agentresult:nth-child(3n+3)").addClass("clearleft");
   
	//Hide (Collapse) the toggle containers on load
	$(".toggle_container").hide(); 

	//Switch the "Open" and "Close" state per click
	$("h4.trigger").toggle(function(){
		$(this).addClass("active");
		}, function () {
		$(this).removeClass("active");
	});

	//Slide up and down on click
	$("h4.trigger").click(function(){
		$(this).next(".toggle_container").slideToggle("slow");
	});

	//Show & Hide Loan Calculator
	$("h3.loancalculator").click(function(){
		$(".mc-body").slideToggle("slow");
	});

	// This initialises carousels on the container elements specified, in this case, carousel1.
	$("#dreamHomeCarousel").CloudCarousel(		
		{			
			xPos: 340,
			yPos: 15,
			minScale: 0.25,
			reflHeight: 50,
			reflGap: 2,
			bringToFront: true,
			buttonLeft: $("#left-but"),
			buttonRight: $("#right-but"),
			altBox: $("#alt-text"),
			titleBox: $("#title-text")
		}
	);

});

/* ]]> */

