//-------------------------------------------------------------------
// START: PAGE SETTINGS
//-------------------------------------------------------------------

	// general settings
		var iPlayLoadDelay = 10; // pause until the animation starts (protects from "fade up" problems)
		var iStageItemsPositionTop; // changes for different browsers
	
		var iCircleAllWidthLarge = 147;
		var iCircleAllWidthExtraLarge = 220;
		
	// background/stage settings
		var iStageFadeSpeed = 1000; // time it takes to fade in the white box
		var iStageFadeType = "easeInQuad"; // penner functions
		
	// flash variables
		var sItemSource 	= "/assets/swf/sweetspot.swf" // Sets the default folder for the FLVs and Images used in the player
	
		var iItemWidth 	= 1100;
		var iItemHeight = 463;
		var iItemFlashVersion = 8;

	// eco system variables
		var iEcoNavOn = 0;
		
//-------------------------------------------------------------------
// START: PAGE VARIABLES
//-------------------------------------------------------------------



//-------------------------------------------------------------------
// START: JQUERY FUNCTIONS
//-------------------------------------------------------------------

// JQUERY - START READY FUNCTIONS
$(document).ready(function(){
	
	//-------------------------------------------------------------------
	// JQUERY - VIDEO PLAYER FUNCTIONS
	jQuery.fn.fncLoadFlash = function() {
		var so = new SWFObject(sItemSource,'sweetspot',iItemWidth,iItemHeight,iItemFlashVersion);
		so.addParam("wmode", "transparent");
		so.write('stage_contents');	
	}; // load flash
	
	// do this on load
	if ($.browser.msie) {
		jQuery.fn.fncLoadFlash();
	} else {
		$("#stage").animate({opacity:1}, iStageFadeSpeed, iStageFadeType, function() {
			jQuery.fn.fncLoadFlash();						   											  																		   
		});
	}
	
	//-------------------------------------------------------------------
	// JQUERY - ECOSYSTEM SET UP
	
	jQuery.fn.fncEcoNav = function(iThisBox) {
		jQuery.fn.fncQBoxSwap(iThisBox);
	}; // ecosystem set up
	
	// Overwrite the global fncQBoxSwap with custom functions for this page
	jQuery.fn.fncQBoxSwap = function(iThis) {
		var sHTML = "";
		if (iQboxOn != iThis) {
			// what type is this?
			if (aQboxType[iThis] == 1) {  // Highlight box
				// only add the ecosystem on first click
				if (iQboxOn==0) {
					sHTML = sHTML + '<div id="qBox'+iThis+'" class="qBox_Type1" style="opacity:0;">';
					
					// start: add in the ecosystem
					sHTML = sHTML + '<div id="ecosystem_container" class="clearfix">';
					sHTML = sHTML + '	<div class="float_left" style="width:12px;"><img src="/assets/images/about/main/arrow_down.gif" /></div>';
					sHTML = sHTML + '	<div class="ecosystem_options clearfix">';
					sHTML = sHTML + '		<a id="1">Content</a>';
					sHTML = sHTML + '		<a id="2">Services</a>';
					sHTML = sHTML + '		<a id="3">Applications</a>';
					sHTML = sHTML + '		<a id="4">Platforms</a>';
					sHTML = sHTML + '		<a id="5">Infrastructure</a>';
					sHTML = sHTML + '	</div>';
					sHTML = sHTML + '	<div class="float_right" style="width:12px;"><img src="/assets/images/about/main/arrow_up.gif" /></div>';
					sHTML = sHTML + '</div>';
					// end: add in the ecosystem
					
					sHTML = sHTML + '<div id="qBoxDetails" class="clearfix">';
				}
								
				sHTML = sHTML + '	<strong>'+aQboxTitle[iThis]+':</strong>';
				sHTML = sHTML + '	<p>'+aQboxContent[iThis]+'</a>';
								
				if (iQboxOn==0) {
					sHTML = sHTML + '</div>';
					sHTML = sHTML + '</div>';
				}
			}
			
			// add it			
			if (iThis>0 && iQboxDefault==0) {
				$("#qBox0").css({display: 'none'});
			}
			
			if (iQboxOn==0) {
				$("#qBox").append(sHTML);
				
				// remove old
				jQuery.fn.fncQBoxOff(iQboxOn,false);
			} else {				
				// remove old
				$("#qBoxDetails strong").remove();
				$("#qBoxDetails p").remove();
				$("#qBoxNav"+iQboxOn).removeClass("on");
				
				$("#qBoxDetails").append(sHTML);
			}
						
			// set current
			$("#qBoxNav"+iThis).addClass("on");
			
			// run on ecosystem box + highlight box
			if (iQboxOn>0) {
				$("#"+iQboxOn).removeClass("on");
			} else {
				// set up links
				$(".ecosystem_options a").click(function(){
					// do mouse over	
					jQuery.fn.fncEcoNav($(this).attr('id'));
				});
				
				// fade in
				$('#qBox'+iThis).animate({opacity:'1'},iQboxFadeInSpeed, function() {});
			};
			$("#"+iThis).addClass("on");			
			
			iQboxOn = iThis;			
			
		} else if (iQboxDefault==iThis) {			
			$("#qBoxNav"+iThis).addClass("on");
			iQboxOn=iThis;
		}
		
	}
	
	// clear pulse for FF 2 / Mac only
	if ($.browser.mozilla && parseFloat($.browser.version)<1.9) {
		jQuery.fn.fncPulseClearTimer();
		jQuery.fn.fncPulseRemove();
		jQuery.fn.fncPulsePlay = function() {};
	}
	
}); // end jQuery load




