$(document).ready(function() {
	$('#top-form').css({'top':'-280px'/*,'margin':'0 0 0 475px'*/}); // reposition top form
	
	$('#green-nav-logo').css({
		opacity: 0
	});
	
	$('#top-form-name').focus(function() {
		if ($(this).val() == 'name (required)') $(this).val('');
	});
	$('#top-form-name').blur(function() {
		if ($(this).val() == '') $(this).val('name (required)');
	});
	$('#top-form-email').focus(function() {
		if ($(this).val() == 'email (required)') $(this).val('');
	});
	$('#top-form-email').blur(function() {
		if ($(this).val() == '') $(this).val('email (required)');
	});
	$('#top-form-phone').focus(function() {
		if ($(this).val() == 'phone') $(this).val('');
	});
	$('#top-form-phone').blur(function() {
		if ($(this).val() == '') $(this).val('phone');
	});
	$('#top-form-message').focus(function() {
		if ($(this).val() == 'message') $(this).val('');
	});
	$('#top-form-message').blur(function() {
		if ($(this).val() == '') $(this).val('message');
	});
	
	$('#green-building').mouseenter(function() {
		$('#green-nav-logo').show(0, function() {
			$('#green-nav-logo').animate({
				opacity: 1.0,
				filter: "alpha(opacity=100);",
				bottom: ["30px",'easeOutBack']
			}, 300 );
		});
	});
	$('#green-building').mouseout(function() {
		$('#green-nav-logo').animate({
			opacity: 0,
			bottom: 0
		}, 300, function() {
			$('#green-nav-logo').hide(0);
		});
	});
	
	$('.slideout-list, #site-plan, #area-map, #first-floor, #second-floor, #lower-level, #photos, #green-nav-logo, #video, #immediate-homes, #available-plans, #standard-features').hide(0);
	
	$('#details-button').click(function() {
		$('#site-plan, #area-map, #first-floor, #second-floor, #lower-level, #photos, #immediate-homes, #available-plans, #standard-features, #green-features').fadeOut(500);
		$('#details').delay(600).fadeIn(500);
	});
	$('#site-plan-button').click(function() {
		$('#details, #area-map, #immediate-homes, #available-plans, #standard-features, #green-features').fadeOut(500);
		$('#site-plan').delay(600).fadeIn(500);
	});
	$('#area-map-button').click(function() {
		$('#details, #site-plan, #immediate-homes, #available-plans, #standard-features, #green-features').fadeOut(500);
		$('#area-map').delay(600).fadeIn(500);
	});
	$('#immediate-homes-button').click(function() {
		$('#details, #area-map, #site-plan, #immediate-homes, #available-plans, #standard-features, #green-features').fadeOut(500);
		$('#immediate-homes').delay(600).fadeIn(500);
	});
	$('#sfeatures-button').click(function() {
		$('#details, #area-map, #site-plan, #immediate-homes, #available-plans, #green-features').fadeOut(500);
		$('#standard-features').delay(600).fadeIn(500);
	});
	$('#gfeatures-button').click(function() {
		$('#details, #area-map, #site-plan, #immediate-homes, #available-plans, #standard-features').fadeOut(500);
		$('#green-features').delay(600).fadeIn(500);
	});	
	
	$('#first-floor-button').click(function() {
		$('#details, #second-floor, #lower-level, #photos, #video, #available-plans').fadeOut(500);
		$('#first-floor').delay(600).fadeIn(500);
	});
	$('#second-floor-button').click(function() {
		$('#details, #first-floor, #lower-level, #photos, #video, #available-plans').fadeOut(500);
		$('#second-floor').delay(600).fadeIn(500);
	});
	$('#lower-level-button').click(function() {
		$('#details, #first-floor, #second-floor, #photos, #video, #available-plans').fadeOut(500);
		$('#lower-level').delay(600).fadeIn(500);
	});
	$('#photos-button').click(function() {
		$('#details, #first-floor, #second-floor, #lower-level, #video, #available-plans').fadeOut(500);
		$('#photos').delay(600).fadeIn(500);
	});
	$('#video-button').click(function() {
		$('#details, #first-floor, #second-floor, #lower-level, #photos, #available-plans').fadeOut(500);
		$('#video').delay(600).fadeIn(500);
	});
	$('#video-imm-button').click(function() {
		$('#photos-imm').fadeOut(500);
		$('#video-imm').delay(600).fadeIn(500);
	});
	$('#photos-imm-button').click(function() {
		$('#video-imm').fadeOut(500);
		$('#photos-imm').delay(600).fadeIn(500);
	});
	$('#plans-button').click(function() {
		$('#details, #area-map, #first-floor, #second-floor, #lower-level, #photos, #video, #site-plan, #standard-features, #green-features').fadeOut(500);
		$('#available-plans').delay(600).fadeIn(500);
	});
	
	
	$('#floors-button').click(function() {
		$('.slideout-list').slideToggle(500);
		return false;
	});
});
