$(document).ready(function(){

 // Since xhtml strict doesn't allow _blank open external links in a new window this way
/*
  $(function() {
  	$('a[rel*=external]').click( function() {
  		window.open(this.href);
  		return false;
  	});
  });
*/

//***********************************
  

// Specials Slider
/*  
  $('#specials h2').click(function() {
    $(this).toggleClass('expanded');
    $('#specials p').slideToggle('fast');
  });
*/
  
  
// Floorplans Rollover
  
  //Set opacity on each span to 0%
  $(".rollover").css({'opacity':'0'});
  
  $('.floorplan a').hover(
    function() {
      $(this).find('.rollover').stop().fadeTo('fast', 1);
    },
    function() {
      $(this).find('.rollover').stop().fadeTo('fast', 0);
    }
  )
  

// Locations Slider
  
  // The Groups start closed
  $('.location_group_body').hide();
  
  // Leave the first one open
  $('.location_group_body:first').show();
  $('.location_group h2:first').addClass('expanded');
  
  $('.location_group h2').click(function() {
    $(this).toggleClass('expanded');
    $(this).parent().find('.location_group_body').slideToggle('fast');
  });


// Initiate Crossfading Slideshow

  $('#slideshow img').addClass('hidden');
  
  $.preload( '#slideshow img', {
    onFinish: function() {
      $('#slideshow img').removeClass('hidden');
      $('#slideshow').slideshow({ timeout: 4000, fadetime: 600, type: 'sequence' });
    }
  });

// Initiate Colorbox
	$("a[rel='gallery'], a[rel='floorplans'], .floorplan a").colorbox({transition:"elastic"});


//***********************************
}); // end

