

$(document).ready(function() {
    var pathname = window.location.pathname;
    $('#CondoTab a').click(function(e) {
        window.location.replace("condos.aspx");
    });
    $('#ApartmentTab a').click(function(e) {
        //$('#ApartmentTab').css('font-weight', 'bold');
        window.location.replace("apartments.aspx");
    });

    if (pathname.toLowerCase().indexOf('apartments') > 0) {
        $('#ApartmentTab').css('background', '#0066A4');
        $('#ApartmentTab a').css('color', '#ffffff');
    }
    else if (pathname.toLowerCase().indexOf('condos') > 0) {
        $('#CondoTab').css('background', '#0066A4');
        $('#CondoTab a').css('color', '#ffffff');
    }
    ShowImages();

});

function ShowImages() {
    $('.navImage').fadeIn('fast');
}
//Slide Show

/*** 
Simple jQuery Slideshow Script
help from http://jonraasch.com/blog/a-simple-jquery-slideshow
//Capital Software Group, LLC
***/

/*---- Simple Slideshow ----*/
function nav1Show() {
    var $active = $('#navImage_00 IMG.active');
    if ($active.length == 0) $active = $('#navImage_00 IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next()
        : $('#navImage_00 IMG:first');

    // uncomment the 3 lines below to pull the images in random order

    var $sibs = $active.siblings();
    var rndNum = Math.floor(Math.random() * $sibs.length);
    var $next = $($sibs[rndNum]);

    $active.addClass('last-active');

    $next.css({ opacity: 0.0 })
        .addClass('active')
        .animate({ opacity: 1.0 }, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("nav1Show()", 6000);
});

function nav2Show() {

    var $active = $('#navImage_01 IMG.active');
    if ($active.length == 0) $active = $('#navImage_01 IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next()
        : $('#navImage_01 IMG:first');

    // uncomment the 3 lines below to pull the images in random order

    var $sibs = $active.siblings();
    var rndNum = Math.floor(Math.random() * $sibs.length);
    var $next = $($sibs[rndNum]);

    $active.addClass('last-active');

    $next.css({ opacity: 0.0 })
        .addClass('active')
        .animate({ opacity: 1.0 }, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("nav2Show()", 8000);
})

function nav3Show() {

    var $active = $('#navImage_02 IMG.active');
    if ($active.length == 0) $active = $('#navImage_02 IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next()
        : $('#navImage_02 IMG:first');

    // uncomment the 3 lines below to pull the images in random order

    var $sibs = $active.siblings();
    var rndNum = Math.floor(Math.random() * $sibs.length);
    var $next = $($sibs[rndNum]);

    $active.addClass('last-active');

    $next.css({ opacity: 0.0 })
        .addClass('active')
        .animate({ opacity: 1.0 }, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("nav3Show()", 10000);
})

function nav4Show() {

    var $active = $('#navImage_03 IMG.active');
    if ($active.length == 0) $active = $('#navImage_03 IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next()
        : $('#navImage_03 IMG:first');

    // uncomment the 3 lines below to pull the images in random order

    var $sibs = $active.siblings();
    var rndNum = Math.floor(Math.random() * $sibs.length);
    var $next = $($sibs[rndNum]);

    $active.addClass('last-active');

    $next.css({ opacity: 0.0 })
        .addClass('active')
        .animate({ opacity: 1.0 }, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("nav4Show()", 9000);
})