﻿if(typeof LOC == 'undefined') {
	var LOC = {};
}
LOC.stopAnimSwf = function () {
	LOC.thisMovie("anim").stopAnimSwf();
}
LOC.playAnimSwf = function () {
	LOC.thisMovie("anim").playAnimSwf();
}

LOC.thisMovie = function (movieName) {
	var swf = document.getElementById("aniflash").firstChild;
	return swf;
}

LOC.initplayPauseSwf = function(){
	var controlFlash = document.getElementById("playPauseFlash");
	controlFlash.style.cursor = "hand";
	controlFlash.isPlaying = true;
	controlFlash.onclick = function(){
		if(this.isPlaying){
			this.isPlaying = false;
			LOC.stopAnimSwf();
			var img = this.getElementsByTagName("img")[0];
			img.src = "/_pt/_br/html/company/Img/common/playFlash.gif";
			img.alt = "Play the flash animation";
		}
		else{
			this.isPlaying = true;
			LOC.playAnimSwf();
			var img = this.getElementsByTagName("img")[0];
			img.src = "/_pt/_br/html/company/Img/common/pauseFlash.gif";
			img.alt = "Stop the flash animation";
		}
	}
	var ani = document.getElementById("aniflash");
	var deltaLeft = 408;
	var deltaTop = 48;

	controlFlash.style.position = "absolute";
	controlFlash.style.zIndex = 999;
	ani.style.zIndex = 666;
	controlFlash.style.left = parseInt(ani.offsetLeft) + deltaLeft + "px";
	controlFlash.style.top = parseInt(ani.offsetTop) + deltaTop + "px";

	controlFlash.style.display = "block";
}

//onload event pour bouton playPause animaflash
/**/
LOC.addListener(window, 'load', function(){
	LOC.initplayPauseSwf();
});

//addDOMLoadEvent(LOC.initplayPauseSwf);