/* Activate the PhoneSplash panel for the homepage: */
/* Requires:
		jQuery.1.3.1
*/

var $j = jQuery.noConflict();
	
(function() {
	
	var initialise = function(){
		
		var splashBox = $j('#iPhoneSplash');
		
		if (splashBox.length > 0) {
			//On pages with tourSteps slideshows, initialise the first slide and controls:
			$j('li:first', splashBox).show();
			$j('#splashNav li:first', splashBox).addClass('first current');
			
			$j('#splashNav li', splashBox).click(function(){
			
				var target = $j(this.parentNode);
				var step = target.children().index(this);
				
				//Update the controls
				$j(this).addClass('current').siblings('li').removeClass('current');
				
				//Perform the switch:
				$j('#splashContent li:visible', target.parentNode).fadeOut('fast', function() {$j(this.parentNode).children('li').eq(step).fadeIn('fast')});
			});
		}
	}

	//Let's kick it!
	$j().ready(initialise);
	
})();
		
