/// <reference path="jquery-1.3.2-vsdoc.js" />
/*
Intro page UI effects.
Uses the Revealing Module Pattern.
*/
try {
	var test = COMO.ns;
}
catch (e) {
	COMO = {};
}

COMO.Intro = {};

COMO.Intro.UI = (function() {
	var ns = 'COMO.Intro.UI';
	var description = 'Enables interactive elements of Shambhala intro page.';

	function init() {
		// hide all feature text first
		jQuery('#content.intro #promo .text').hide();

		// setup trigger clicks on images
		jQuery('#content.intro #promo > li > img').each(function() {
			jQuery(this).click(function(e) {
				jQuery(this).nextAll('div.text').slideToggle('fast');
				e.preventDefault();
			});
		});

		// setup trigger clicks on images        
		jQuery('#content.intro #promo > li > div.trigger').each(function() {
			jQuery(this).click(function(e) {
				jQuery(this).nextAll('div.text').slideToggle('fast');
				e.preventDefault();
			});
		});

		//Floor plan
		jQuery("#floorplan img").each(function(index) {
			if (index != 0) {
				jQuery(this).hide();
			}
		});
	}

	return {
		init: init
	};

} ());

// setup
jQuery(document).ready(COMO.Intro.UI.init);


function changeFloorPlan(index) {
	var speed = 500;
	//Hide all
	$("#floorplan img").each(function(index) {
		$(this).hide();
	});
	$("#floorplan img").eq(index - 1).fadeIn(speed);
	return false;
}