$(document).ready(function() {

  $('#slideshow img').addClass('gone');

  $.preload( '#slideshow img', {
    onFinish: function() {
      $('#slideshow img').removeClass('gone');
      $('#slideshow').slideshow({ timeout: 4000, fadetime: 600, type: 'sequence' });
    }
  });
  
  $('.search_field').keyup(function() {
    var s = jQuery.trim( $('.search_field').val() );
    if ((s != '') && (s.length > 2)) {  
      $('.search_form').submit();
    } else {
      $('#search-results').html("");
    };
  });

  $("a[rel='cbox']").colorbox();

  $("a[rel='floorplans']").colorbox();
  
  $("a[rel='sitemap']").colorbox();

  $(".cbox").colorbox({iframe:"true", transition:"none", width:"710px", height:"660px"});

  $(".movie").colorbox({iframe:"true", transition:"none", width:"640px", height:"480px"});

  $("#btn-gallery a.hideBtn:first").removeClass("hideBtn");

  $(".service_inline_cbox").colorbox({iframe:"true", transition:"none", width:"610px", height:"660px" });
  
  // Walkscore colorbox
  $(".rss").colorbox({width:"540px", height:"356px", inline:true, href:"#thewalkscore"});

});

/* FOR AMENITIES STYLING */

$("document").ready(function(){
$(".container-region:odd").css("width", "240px");
});

/* END AMENITIES STYLING */


// Innerfade setup
jQuery(document).ready( function(){ 
	jQuery('.quotes').innerfade({
		animationtype: 'fade', 
		speed: 'normal', 
		timeout: 5000, 
		type: 'random_start', 
		containerheight: '405px' 
	});
}); 

$("document").ready(function(){
//$("#property_group_peninsula").hide();
//$("#property_group_sacramento").hide();
//$("#property_group_santa_cruz").hide();
//$("#property_group_south_bay_").hide();
//$("#property_group_peninsula").hide();
$(".prop_container").hide();
//$(".prop_container:first").show();
//$(".prop_container:first").addClass("active");
//$(".prop_container:nth-child(2n)").show();
});

function toggle_list(list_id) {
	//alert(list_id);
	//$(list_id).parent().find('.nonactive').toggleClass("active");
	$(list_id).parent().find('.nonactive').toggleClass("active");
	$(list_id).slideToggle("medium");
};


