//class handles all button and thumbnail functions
var flashSlideShow;  //global object holder for flash slideshow
var arrAutomate = {
		subMenuLeft : 410,
		subMenuSpacing : 12,
		subMenu: [
			{
				title : "Wi-Fi",
				thumbnails : [ 
				],
				heros : [
				],
				contentDiv : "",
				elWidth : 40,
				clickHandler : "$('heroOverviewLeft').style.background = 'url(flash/SW_wifi2.gif) no-repeat transparent 5px 1px';",
				elLeft : 0 //remains blank
			},
			{
				title : "Web",
				thumbnails : [ 
				],
				heros : [
				],
				contentDiv : "",
				elWidth : 35,
				clickHandler : "$('heroOverviewLeft').style.background = 'url(flash/web_search.gif) no-repeat transparent';",
				elLeft : 0 //remains blank
			},
			{
				title : "Mensagem de Voz",
				thumbnails : [ 
				],
				heros : [
				],
				contentDiv : "",
				elWidth : 110,
				clickHandler : "$('heroOverviewLeft').style.background = 'url(flash/SW_blink.gif) no-repeat transparent -80px 0';",
				elLeft : 0 //remains blank
			},
			{
				title : "Agenda e email",
				thumbnails : [ 
				],
				heros : [
				],
				contentDiv : "",
				elWidth: 100,
				clickHandler : "$('heroOverviewLeft').style.background = 'url(flash/SW_contacts2.gif) no-repeat transparent -30px 0';",
				elLeft : 0
			},
			{
				title : "Chave Vibra/Toca",
				thumbnails : [ 
				],
				heros : [
				],
				contentDiv : "",
				elWidth: 110,
				clickHandler : "$('heroOverviewLeft').style.background = 'url(flash/SW_ringer.gif) no-repeat transparent';",
				elLeft : 0
			}
		]
		
}
/***************************************************************************************************
Slideshow for marketing pages
	Usage:
	objVariable = new slideShow(); //initializes the class
	objVariable.run(); //begin's slideshow
	objVariable.halt(); //stops the slideshow
**************************************************************************************************/
secondaryMenuSlideShow = function(targetMenu) {
	this.slideshowScreenNumber = targetMenu;
	this.autoSlideshow = true;
	this.objSlideShowTimer;
	this.elementCount = arrAutomate.subMenu.length;
}
secondaryMenuSlideShow.prototype.run = function() {
	if(this.autoSlideshow) {
//		console.log(testFlash.IsPlaying());
//		console.log(testFlash.TotalFrames());
		this.slideshowScreenNumber++; //increment to next screen
		if(this.slideshowScreenNumber > this.elementCount) {
			this.slideshowScreenNumber = 1; //reset slide show	
		}
		renderSubmenuScreen(this.slideshowScreenNumber);
	} 
}
secondaryMenuSlideShow.prototype.halt = function() {
	clearTimeout(this.objSlideShowTimer);	
	this.autoSlideshow = false;
	this.slideshowScreenNumber = 1;
}
/******end slideshow stuff******/

var mainFlash;
var testFlash;
loadFlashDetail = function(menuNumber, flashFileName, slideshowDelay) {
	if(Browser.Plugins.Flash.version > 6) {
		mainFlash = new Swiff('flash/'+flashFileName+'.swf', {
			id: 'flashMain',
			width: 475,
			height: 325,
			container : 'heroOverviewLeft',
			params: {
				wmode: 'transparent'
			}
		});	
	} else {
		$('heroOverviewLeft').style.background = 'url(flash/'+flashFileName+'.gif) no-repeat transparent';
	}
	$('textWrapper').innerHTML = $('menu' + menuNumber + 'text').innerHTML;
	if($defined(flashSlideShow)) {
		flashSlideShow.halt();
	}
	flashSlideShow = new secondaryMenuSlideShow(menuNumber);
	flashSlideShow.objSlideShowTimer = window.setTimeout(function(){flashSlideShow.run();}, slideshowDelay);
}

