$(document).ready(function() {
	
	// homepage intro copy
		
		$("div#homeInfo").hide(); // hide intro copy
		
		$("body#home div#inner-left").append('<a id="showInfo" href="#" title="show info">show info</a>');
		
		// toggle info text
		$("a#showInfo").toggle(function () {
		 
            $("div#homeInfo").show();
            $(this).addClass("showInfo-active");
            $(this).text("hide info");
            $(this).attr("title", "hide info");
            
        }, function(){
        
           $("div#homeInfo").hide();
           $(this).removeClass("showInfo-active");
           $(this).text("show info");
           $(this).attr("title", "show info");
           
        });
        
    
    // property overviews
    
    	$("div#propertyIntros div.overview").click(function() {
 	 		window.location = ($("a:first", this).attr("href"));
		});
		
		// give it a nice hover hand & hover state
		$("div#propertyIntros div.overview").hover(function () {
    		$(this).addClass("hoverIt");
			
			var src = $("img", this).attr("src").replace("-mo.jpg", ".jpg");
           	$("img", this).attr("src", src);
    		
		}, function () {
    		$(this).removeClass("hoverIt");
    		
    		var src = $("img", this).attr("src").match(/[^\.]+/) + "-mo.jpg";
            $("img", this).attr("src", src);
  		});

});

$(window).load(function() {

	// property slider
 	$("div#propertyImages").nivoSlider({
        effect:'fade', // Specify sets like: 'fold,fade,sliceDown'
        pauseTime:4000, // How long each slide will show
        directionNavHide:true, // Only show on hover
        controlNav:true, // 1,2,3... navigation
        pauseOnHover:true // Stop animation while hovering
    });
	
});

