jQuery(document).ready(function() {
    jQuery('ul#Tabs li').click(function(){
        var fieldsets = jQuery('div.Tab');
        fieldsets.hide();
        
        var selectedItem = jQuery('ul#Tabs li.Selected');
        selectedItem.removeClass('Selected');
        
        var li = jQuery(this);
        li.addClass('Selected');
        
        var idx = li.index();
        var fieldset = jQuery("div.Tab:eq(" + idx + ")")
        fieldset.fadeIn('fast');
    });
    jQuery('div#SlideShow a').lightBox({fixedNavigation:true});
    
    var num_floor_plans = jQuery('table#FloorPlans tr').length - 1;
    if( num_floor_plans > 0 )
    {
        for( var idx = 1; idx <= num_floor_plans; ++idx )
        {
            jQuery('table#FloorPlans tr:nth-child(' + idx + ') a').lightBox();
        }
    }
});

function startSlideshow()
{
    jQuery('div#SlideShow a').lightBox();
    jQuery('div#SlideShow a:first-child').click();
}

function SendMail(complexID)
{
	var sLocation = "/search/email.php?ComplexID=" + complexID;
	var sName = "wEmail";
	var sFeatures = "height=350,width=350,location=no,menubar=no,resizable=yes,status=no,titlebar=no,toolbar=no";
	wEmail = window.open(sLocation, sName, sFeatures);
	wEmail.focus();
}
