
	jQuery(document).ready(function(){
		$('#ulVideos').innerfade({ 
			animationtype: 'fade', //Type of animation 'fade' or 'slide' (Default: 'fade')
			speed: 'normal', //Fadingspeed in milliseconds or keywords (slow, normal or fast)(Default: 'normal')
			timeout: '7000', //Time between the fades in milliseconds (Default: '2000')
			type: 'sequence', //Type of slideshow: 'sequence' or 'random' (Default: 'sequence')
			containerheight: 'auto', //Height of the containing element in any css-height-value (Default: 'auto')  
			runningclass: 'innerfade' //CSS-Class which the container get’s applied (Default: 'innerfade') 
		});

		destaques = new ctrlDestaques();

		verificaImgs();
	});

	function verificaImgs(){
		$('img[@tipoImg=thumb]', '#tdConteudo').error(function(){
			this.src = '../_imgs/LogoPainelBR_56x56.jpg';
		});
	}

	function showVideo(url){
		var brkLine = String.fromCharCode(13);
		var output= "<div style='background:url(../_imgs/MediaPlayer.jpg) no-repeat top left;'>" + brkLine + 
					"  <OBJECT id='mediaPlayer' width='426' height='309'" + brkLine +
                    "    classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'" + brkLine +
                    "    codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'" + brkLine +
                    "    standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>" + brkLine +
                    "    <param name='fileName' value=" + url + ">" + brkLine +
                    "    <param name='animationatStart' value='1'>" + brkLine +
                    "    <param name='transparentatStart' value='1'>" + brkLine +
                    "    <param name='autoStart' value='1'>" + brkLine +
                    "    <param name='ShowControls' value='1'>" + brkLine +
                    "    <param name='ShowDisplay' value='0'>" + brkLine +
                    "    <param name='ShowStatusBar' value='1'>" + brkLine +
                    "    <param name='loop' value='0'>" + brkLine +
                    "    <EMBED type='application/x-mplayer2'" + brkLine +
                    "      pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'" + brkLine +
                    "      id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='0'" + brkLine +
                    "      bgcolor='darkblue' showcontrols='1' showtracker='1'" + brkLine +
                    "      showdisplay='1' showstatusbar='0' videoborder3d='0' width='426' height='309'" + brkLine +
                    "      src=" + url + " autostart='1' designtimesp='5311' loop='0'>" + brkLine +
                    "    </EMBED>" + brkLine +
                    "  </OBJECT></div>"
		$("#tdVideo").html(output);
	}

	function ctrlDestaques(){
		this.destaqueAtivo = "Destaques";
		this.showDestaque = function(novoDestaqueAtivo){
			$('#div'+this.destaqueAtivo).slideUp("slow",function(){
				$('#div'+novoDestaqueAtivo).slideDown("slow");
			});
			this.destaqueAtivo = novoDestaqueAtivo;
		}
	}