// JavaScript Document
$(function(){
	// Back to Top
	$('a#back-to-top').click(function(){
		$('html, body').animate({scrollTop: '0px'}, 300);
		return false;
	});
	// Highlight Appropriate Main Menu Button
	mainMenuHighlight();
	// Set Last Button in Menu(s) to have no border (IE 6 Fix)
	$('#footer-menu li:last-child').css({border:"none"});
	
	// Set 
	$('.col-two:last-child, .col-three:last-child').css({'margin-right':0});
});

function mainMenuHighlight(){
	if (window.location.href.indexOf("site_plan") > -1) {
		$('#menu-siteplan a').css({'background-position':'-60px -120px'});
	} else if (window.location.href.indexOf("condos") > -1) {
		$('#menu-condos a').css({'background-position':'-128px -120px'});
	} else if (window.location.href.indexOf("amenities") > -1) {
		$('#menu-amenities a').css({'background-position':'-185px -120px'});
	} else if (window.location.href.indexOf("location") > -1) {
		$('#menu-location a').css({'background-position':'-257px -120px'});
	} else if (window.location.href.indexOf("builder") > -1) {
		$('#menu-builder a').css({'background-position':'-323px -120px'});
	} else if (window.location.href.indexOf("green") > -1) {
		$('#menu-green a').css({'background-position':'-383px -120px'});
	} else if (window.location.href.indexOf("features") > -1) {
		$('#menu-features a').css({'background-position':'-434px -120px'});
	} else if (window.location.href.indexOf("suites") > -1) {
		$('#menu-suites a').css({'background-position':'-502px -120px'});
	} else if (window.location.href.indexOf("contact") > -1) {
		$('#menu-contact a').css({'background-position':'-555px -120px'});
	} else {
		$('#menu-project a').css({'background-position':'0 -120px'});
	}
}

function openFloorplan(c){
    // open a welcome message as soon as the window loads
    Shadowbox.open({
        content:    c,
        player:     "iframe",
        height:     650,
        width:      625
    });
}