/* --------------------------- Inicializa Scripts --------------------------- */

$(document).ready(function() {

	//Chama a função do googleAnalytics
	googleAnalytics();
	
	//Chama a função que mostra mais fotos de Media Center Fotos
	mostrarFotos();
	
	//Chama a função que mostra a legenda de Media Center Fotos
	mostrarLegendaMediaCenterFotos();
	
	//Chama a função de mouseover da pagina Media Center Arquivo
	mouseOverMediaCenterArquivo();
	
	//Chama a função de mouseover da pagina Roteiro
	mouseOverRoteiro();
	
	//CHama a função que seta o ToolTips
	setaTooltips();
	
	//Chama a função de Animação da pagina Alfândega
	animationAlfandega();
	
	//Chama a função que mostra o conteudo de cada Dica para Viajar
	mostrarDicaViagen();
	
	//Chama a função que mostra o submenu do topo
	mostraSubmenuTopo();
	
	//Chama a função Esterilização Checkbox
	estilizaCheckboxesMonteViagem();
	estilizaCheckboxesNewsletter();
	
	//Chama a função de estilizar selectBox 
	estilizacaoSelectboxMonteViagem();
	
	//Chama a função de clicar no campo do titulo passageiros 
	setaClickInputPassageiros();
	setaClickInputCalendario();
	setaClickInputBuscarPais();
	setaClickInputBuscarVideo();
	setaClickInputBuscarBlog();
	
	//Chama a função para mostrar o calendário
	calendario();
	
	//Chama a função de mouseover ao passar o mouse sobre o box dos circuitos
	mouseOver();
	
	//Chama a função que abre e fecha o popUp de mapa de localizacao
	popUpMapaLocalizacao();
	
	//Chama a função que da zoom no mapa de localização
	jqueryzomMapaLocalizacao();
	
	setaClickFotosMaisAcessadas();
	
	//Chama a função do googleAnalytics
	googleAnalytics();
	
	//Chama a função que troca o Bg do Botao da galeria de fotos do media center
	botaoGaleriaFotosMediaCenter();

});

/* ---------------------- Seta Over - Media Center -------------------*/

function botaoGaleriaFotosMediaCenter(){
	$(".miniaturaFoto").hover(function(){
		$(this).parent().addClass('bgMiniaturaFotoAtivo');		
	}
	,function(){
		$(this).parent().removeClass('bgMiniaturaFotoAtivo');
	});
}

/* ---------------------- Seta clique - Fotos mais acessadas -------------------*/

function setaClickFotosMaisAcessadas() {

    $('.topoVideo .miniPlayer .maisAcessadas').click(function() { 
	    $.scrollTo('.tituloFotoMediaCenter', 500);
	});
	
}

/* ---------------------- função mostrar mais fotos Media Center Fotos -------------------*/

function mostrarFotos(){

var btMaisFotos01 = $('.boxFotosRelacionados .boxFotos01 .btMaisFotos');
var btMaisFotos02 = $('.boxFotosRelacionados .boxFotos02 .btMaisFotos');

var btVoltarFotos02 = $('.boxFotosRelacionados .boxFotos02 .btVoltarFotos');
var btVoltarFotos03 = $('.boxFotosRelacionados .boxFotos03 .btVoltarFotos');


/*Fotos 01*/
	btMaisFotos01.click(function(){
		$('.boxFotos02').show();
		$('.boxFotos01').hide();
	});
	
	btVoltarFotos02.click(function(){
		$('.boxFotos01').show();
		$('.boxFotos02').hide();

	});
	
/*Fotos 02*/
	btMaisFotos02.click(function(){
		$('.boxFotos03').show();
		$('.boxFotos02').hide();
		
	});
	
	btVoltarFotos03.click(function(){
		$('.boxFotos02').show();
		$('.boxFotos03').hide();
	});
}

/* ---------------------- função mostrar legenda Media Center Fotos -------------------*/

function mostrarLegendaMediaCenterFotos(){
	
	$('.boxFotoMediaCenter').hover(function(){
		var legenda = $(this).find('.legendaFotoPrincipal');
		if(legenda.html()!=""){
			legenda.animate({marginTop: '0px'}, 500 );
		}
		
	}
	,function(){
		var legenda = $(this).find('.legendaFotoPrincipal');
		legenda.animate({marginTop: '58px'}, 500 );
	});
	
}

/* ---------------------- funcao popUp Mapa de Localiazação -------------------*/

function popUpMapaLocalizacao(){
	var popUp = $('#alertaPopUp');
	var fechar = popUp.find('.boxPopUp .bgBoxMapaLocalizacao .btFecharBoxMapa');
	
	$('.baseBoxEndereco .verMapaLocalizacao').click(function(){		
		popUp.fadeIn("slow");
		$('.mapaLocalizacaoIlheus').hide();
		$('.mapaLocalizacao').show();		
	});
	$('.baseBoxEndereco .verMapaLocalizacaoIlheus').click(function(){		
		popUp.fadeIn("slow");
		$('.mapaLocalizacaoIlheus').show();
		$('.mapaLocalizacao').hide();		
	});
	
	fechar.click(function(){
		var popUp = $('#alertaPopUp');				  
		popUp.fadeOut("fast");
	});
}

/*------------------------------------ Alinhando o Banner em Flash da Home ------------------------------------------*/

function onResizeHome(){
	$(window).resize(function(){
	  alinharFlashHome();
	});
}

function alinharFlashHome(){
	
	var bannerFlashHome = $('.bannerFlash');
	var tamanhoBanner = bannerFlashHome.css("width");
	var tamanhoDiv = $('.bannerTopoHome').css("width");
	
	var posicaoFinal = (parseInt(tamanhoDiv)/2)-(parseInt(tamanhoBanner)/2)-125;	
	
	bannerFlashHome.css('margin-left',posicaoFinal+"px");
	
}

/*------------------------------------ Pagina Alfandega ------------------------------------------*/
var fotoAtualAlfandega=1;

function animationAlfandega(){
	
	function loadImage(imagem){
		
		
		
	}
	
	function verificaBotoesAlfandega(){
		
		var setaNext = $('.pagAlfandega .conteudoAlfandega .SetaMenuDireita');
		var setaPrev = $('.pagAlfandega .conteudoAlfandega .SetaMenuEsquerda');
		
		if(fotoAtualAlfandega<8){			
			setaNext.removeClass("SetaMenuDireitaInativo");
		}
		if(fotoAtualAlfandega==8){
			setaNext.addClass("SetaMenuDireitaInativo");	
		}
		if(fotoAtualAlfandega>8){
			fotoAtualAlfandega=8;	
		}
		
		if(fotoAtualAlfandega==1){
			setaPrev.addClass("SetaMenuEsquerdaInativo");	
		}
		if(fotoAtualAlfandega>1){
			setaPrev.removeClass("SetaMenuEsquerdaInativo");
		}
		if(fotoAtualAlfandega<=1){
			fotoAtualAlfandega=1;
		}
		
	}
	
	function fadeInFadeOutFotoAlfandega(num){
		
		var foto = $('.pagAlfandega .conteudoAlfandega .fotoConteudoAlfandega');
		var foto02 = $('.pagAlfandega .conteudoAlfandega .segundaFotoAlfandega');
		
		if(foto02.css("z-index") != "2"){
			foto02.attr('src','i/fotoAlfandega0'+ num +'.jpg');
			
			foto.fadeOut(1000,function(){
				foto.css("z-index", "1");
				foto02.css("z-index", "2");
				foto.fadeIn(500);
			});
			
        }else{
			foto.attr('src','i/fotoAlfandega0'+ num +'.jpg');
			
			foto02.fadeOut(1000,function(){
				foto.css("z-index", "2");
				foto02.css("z-index", "1");
				foto02.fadeIn(500);
		    });
		}	
		
	}
	
	function mudaBgLink(btnumero, numero){
	
		$('.menuNumericoAlfandega a.menuNumerico').each(function(index, item) {  
			
			var linke =	$(this);			
			var i = index+1;
			
			linke.removeClass("numAtivo0"+i);
			
		});
		
		btnumero.addClass("numAtivo0"+numero);
		
	}
	
	//Acoes dos botoes da pagina Alfandega
	
	$('.pagAlfandega .conteudoAlfandega .SetaMenuDireita').click(function() {
																		  
		var linke =	$(this);
		var outroBt = $(this).parent().find('.SetaMenuEsquerda');
		var foto = linke.parent().find('.fotoConteudoAlfandega');
		var foto02 = linke.parent().find('.segundaFotoAlfandega');
		
		fotoAtualAlfandega++;
		
		verificaBotoesAlfandega();
		
		var btnumero = linke.parent().parent().find('.menuNumericoAlfandega .num0'+fotoAtualAlfandega);
		
		mudaBgLink(btnumero, fotoAtualAlfandega);
		
		fadeInFadeOutFotoAlfandega(fotoAtualAlfandega);	
          
    });
	
	$('.pagAlfandega .conteudoAlfandega .SetaMenuEsquerda').click(function() {
																		  
		var linke =	$(this);
		var outroBt = $(this).parent().find('.SetaMenuDireita');
		var foto = linke.parent().find('.fotoConteudoAlfandega');
		var foto02 = linke.parent().find('.segundaFotoAlfandega');
		
		fotoAtualAlfandega--;
		
		verificaBotoesAlfandega();
		
		var btnumero = linke.parent().parent().find('.menuNumericoAlfandega .num0'+fotoAtualAlfandega);
		
		mudaBgLink(btnumero, fotoAtualAlfandega);
		
		fadeInFadeOutFotoAlfandega(fotoAtualAlfandega);
          
    });	
	
	
	$('.menuNumericoAlfandega a.menuNumerico').each(function(index, item) {
		$(this).click(function() {   
			
			var linke =	$(this);
			var foto = linke.parent().parent().find('.conteudoAlfandega .fotoConteudoAlfandega');
			var foto02 = linke.parent().parent().find('.conteudoAlfandega .segundafotoConteudoAlfandega');
			
			fotoAtualAlfandega = index+1;
			
			verificaBotoesAlfandega();
			
			mudaBgLink(linke, index+1);
			
			fadeInFadeOutFotoAlfandega(fotoAtualAlfandega);
			
			return false;
			
		});
		
		$(this).hover(function(){
			$(this).addClass("numOver0"+(index+1));
		}, 
		function () {
			$(this).removeClass("numOver0"+(index+1));
		});
		
	});
	
	
}

/*-------------------------------------- Tooltips  -------------------------------*/
function setaTooltips() {

  //Tooltips Roteiro
  $('.pagRoteiro .bgBtBaseRoteiro a.btBaseRoteiro').Tooltip({
        delay:1,
        showURL: false,
        showBody: " - ",
        track:true,
        left: -25,
        top: 20,
        fixPNG: true
  });
  
   /*Tooltips Media Center mini thumb
  $('.miniPlayer a').TooltipMediaCenterJquery({
        delay:1,
        showURL: false,
        showBody: " - ",
        track:true,
        left: -25,
        top: 20,
        fixPNG: true
  });*/
  
}

/*---------------------------- Função Mostra Dica para Viajar  --------------------------------*/

function mostrarDicaViagen(){
	
	function escondeConteu(){
		
		$('.pagDicasViajar .dicaParaViajar a.btLinkDicasViajar').each(function() {
			
			var conteudo = $(this).parent().find('.conteudoBox');
			var mala = $(this).parent().find('.malacuidadosBagagem');
			
			conteudo.slideUp("slow");
			mala.fadeOut("slow");
																			   
		});
		
	}

	$('.pagDicasViajar .dicaParaViajar a.btLinkDicasViajar').each(function() {											   
																		   
		$(this).click(function() { 
							   
			var conteudo = $(this).parent().find('.conteudoBox');
			var mala = $(this).parent().find('.malacuidadosBagagem');
			
			if(conteudo.css('display')!='block'){
				escondeConteu();
				conteudo.slideDown("slow");
				mala.fadeIn("slow");
			}
			
		});
	});
}

/*---------------------------- Função Mostra Submenu Topo  --------------------------------*/

function mostraSubmenuTopo(){	
	
	var botao = $('.menuTopo .btTopoSubmenu');	
	
	//links especificos de cada submenu
	var btHistoria = $('.bgSubBtEspaco .btHistoria');
	var btServicos = $('.bgSubBtEspaco .btServicos');
	var btInternacionais = $('.bgSubBtRoteiros .btInternacionais');
	var btNacionais = $('.bgSubBtRoteiros .btNacionais');
	var btAlfandega = $('.bgSubBtCanalInfo .btAlfandega');
	var btExtravio = $('.bgSubBtCanalInfo .btExtravio');
	var btDicasViajar = $('.bgSubBtCanalInfo .btDicasViajar');
	var btDutyFree = $('.bgSubBtCanalInfo .btDutyFree');
	var btVistos = $('.bgSubBtCanalInfo .btVistos');
	var btTarifas = $('.bgSubBtCanalInfo .btTarifas');
	var btFotos = $('.bgSubBtMediaCenter .btFotos');
	var btVideos = $('.bgSubBtMediaCenter .btVideos');
	
	botao.hover(function(){
		var botaoOver = $(this).find('.botaoOver');
		var submenu = $(this).find('.bgSubBt');				 
						 
		botaoOver.fadeIn(250,function(){
			if(botaoOver.css('display')=='block'){						  
				submenu.slideDown("normal");
			}
		});		
				
	}, 
	function () {
		var botaoOver = $(this).find('.botaoOver');
		var submenu = $(this).find('.bgSubBt');	
		
		if(submenu.css('display')=='block'){
			submenu.hide();
		}
		if(botaoOver.css('display')=='block'){
			botaoOver.hide();
		}
		
	});
	
	//btHistoria
	btHistoria.hover(function(){		
		$(this).addClass('btHistoriaOver');	
	}, 
	function () {
		$(this).removeClass('btHistoriaOver');
	});
	
	//btServicos
	btServicos.hover(function(){		
		$(this).addClass('btServicosOver');	
	}, 
	function () {
		$(this).removeClass('btServicosOver');
	});
	
	//btInternacionais
	btInternacionais.hover(function(){		
		$(this).addClass('btInternacionaisOver');	
	}, 
	function () {
		$(this).removeClass('btInternacionaisOver');
	});
	
	//btNacionais
	btNacionais.hover(function(){		
		$(this).addClass('btNacionaisOver');	
	}, 
	function () {
		$(this).removeClass('btNacionaisOver');
	});
	
	//btAlfandega
	btAlfandega.hover(function(){		
		$(this).addClass('btAlfandegaOver');	
	}, 
	function () {
		$(this).removeClass('btAlfandegaOver');
	});
	
	//btExtravio
	btExtravio.hover(function(){		
		$(this).addClass('btExtravioOver');	
	}, 
	function () {
		$(this).removeClass('btExtravioOver');
	});
	
	//btDicasViajar
	btDicasViajar.hover(function(){		
		$(this).addClass('btDicasViajarOver');	
	}, 
	function () {
		$(this).removeClass('btDicasViajarOver');
	});
	
	//btDutyFree
	btDutyFree.hover(function(){		
		$(this).addClass('btDutyFreeOver');	
	}, 
	function () {
		$(this).removeClass('btDutyFreeOver');
	});
	
	//btVistos
	btVistos.hover(function(){		
		$(this).addClass('btVistosOver');	
	}, 
	function () {
		$(this).removeClass('btVistosOver');
	});
	
	//btTarifas
	btTarifas.hover(function(){		
		$(this).addClass('btTarifasOver');	
	}, 
	function () {
		$(this).removeClass('btTarifasOver');
	});
	
	//btFotos
	btFotos.hover(function(){		
		$(this).addClass('btFotosOver');	
	}, 
	function () {
		$(this).removeClass('btFotosOver');
	});
	
	//btVídeos
	btVideos.hover(function(){		
		$(this).addClass('btVideosOver');	
	}, 
	function () {
		$(this).removeClass('btVideosOver');
	});
	
}

/* --------------------------- Função - Efeitos Hover dos Campos  --------------------------- */

//Efeito Hover
function hoverClasse(elemento, classe, valor) {
	if (valor == '') {
		if (elemento.value == '')
			$(elemento).addClass(classe);	
	}
	else
	{
		if (elemento.value != valor)
			$(elemento).removeClass(classe);
	}
}

/* --------------------------- Função - Campo Passageiros --------------------------- */

function setaClickInputPassageiros() {
	
	/* Campos - Palavra Chave do Topo */
	$(".campoPassageiros").each(function () {
	    if (this.value != '')
	        $(this).removeClass('campoPassageiros');
	});
	
	$(".campoPassageiros").blur(function () { 
		 hoverClasse(this, 'campoPassageiros', '')
	});
	
	$(".campoPassageiros").focus(function () {
		hoverClasse(this, 'campoPassageiros', 'Passageiros')
	});
}

/* --------------------------- Função - Campo Buscar País --------------------------- */

function setaClickInputBuscarPais() {
	
	$(".campoFormMostrarBuscarPais").each(function () {
	    if (this.value != '')
	        $(this).removeClass('campoFormMostrarBuscarPais');
	});
	
	$(".campoFormMostrarBuscarPais").blur(function () { 
		 hoverClasse(this, 'campoFormMostrarBuscarPais', '')
	});
	
	$(".campoFormMostrarBuscarPais").focus(function () {
		hoverClasse(this, 'campoFormMostrarBuscarPais', 'BuscarPais')
	});
}

/* --------------------------- Função - Campo Buscar País --------------------------- */

function setaClickInputBuscarBlog() {
	
	$(".mostraCampoBuscaBlog").each(function () {
	    if (this.value != '')
	        $(this).removeClass('mostraCampoBuscaBlog');
	});
	
	$(".mostraCampoBuscaBlog").blur(function () { 
		 hoverClasse(this, 'mostraCampoBuscaBlog', '')
	});
	
	$(".mostraCampoBuscaBlog").focus(function () {
		hoverClasse(this, 'mostraCampoBuscaBlog', 'CampoBuscaBlog')
	});
}

/* --------------------------- Função - Campo Buscar Video --------------------------- */

function setaClickInputBuscarVideo() {
	
	$(".campoFormMostrarBuscarVideo").each(function () {
	    if (this.value != '')
	        $(this).removeClass('campoFormMostrarBuscarVideo');
	});
	
	$(".campoFormMostrarBuscarVideo").blur(function () { 
		 hoverClasse(this, 'campoFormMostrarBuscarVideo', '')
	});
	
	$(".campoFormMostrarBuscarVideo").focus(function () {
		hoverClasse(this, 'campoFormMostrarBuscarVideo', 'BuscarVideo')
	});
}

/* --------------------------- Função - Mostrar Calendário --------------------------- */

function setaClickInputCalendario() {
	
	//Campos - Palavra Chave do Topo 
	$(".mostrarCalendario").each(function () {
	    if (this.value != '')
	        $(this).removeClass('mostrarCalendario');
	});
	
	$(".mostrarCalendario").blur(function () { 
		
		if ($(this).value=='') {
		 	hoverClasse(this, 'mostrarCalendario', '');
		}
	});
	
	$(".mostrarCalendario").focus(function () {
		if ($(this).value!='') {
			hoverClasse(this, 'mostrarCalendario', 'Calendario');
		}
	});
}

/* --------------------------- Estilização Checkbox --------------------------- */

function estilizaCheckboxesMonteViagem() {
	$('.BgGeralInternas .BoxExtrasViagem [@type=checkbox]').checkbox({cls:'checkbox'});	
}

function estilizaCheckboxesNewsletter() {
	$('.BgGeralInternas .formNewsletter [@type=checkbox]').checkbox({cls:'checkboxNewsletter'});	
}

/* --------------------------- Estilização Selectbox --------------------------- */

function estilizacaoSelectboxMonteViagem(){
	
	/* Select Box - ID Busca Autor - Esterilização */
	jQuery('.selectMonteViagem').selectbox();
	
	/* Select Box - ID Busca Todos os selects do Formulário Cadastro - Esterilização */
	jQuery('.selectJsMedia').selectbox();
	
}

/* --------------------------- Mostrar Calendário --------------------------- */

function calendario(){

	// Datepicker
	$('.mostrarCalendario').datepicker({
		inline: true
	});
}

/* --------------------------- Mouse Over --------------------------- */

function mouseOver() {
	$('.BgGeralInternas .pagInternacional a.bgCircuito').each(function() {
	$(this).hover(function(){
		$(this).parent().addClass("mouseOver");																   
	}, 
	function () {
		$(this).parent().removeClass("mouseOver");
	});
	});
	
	$('.topoVideo').each(function() {
	$(this).hover(function(){
		$(this).parent().addClass("mouseOverThumb");																   
	}, 
	function () {
		$(this).parent().removeClass("mouseOverThumb");
	});
	});
	
}

/* --------------------------- Mouse Over Media Center Arquivo --------------------------- */

function mouseOverMediaCenterArquivo(){
	
	$('.linkMes .linkQtdMes').hover(function(){
		var topoLink = $(this).parent().find('.topoLinkMes');	
		var titulo =  $(this).parent().find('.tituloMes');
		if(titulo.hasClass('tituloMesDesativado')==false){
			topoLink.addClass("topoLinkMesOver");
		}
	}, 
	function () {
		var topoLink = $(this).parent().find('.topoLinkMes');	
		topoLink.removeClass("topoLinkMesOver");
	});
	
}

/* --------------------------- Mouse Over Media Center Arquivo --------------------------- */

function mouseOverRoteiro(){
	
	//Imprimir
	$('.pagRoteiro .menuTopoRoteiro .btRoteiroImprimir').hover(function(){
		$(this).addClass("btRoteiroImprimirOver");
	}, 
	function () {
		$(this).removeClass("btRoteiroImprimirOver");
	});
	
	//Atendimento On-line
	$('.pagRoteiro .menuTopoRoteiro .btRoteiroAtendimento').hover(function(){
		$(this).addClass("btRoteiroAtendimentoOver");
	}, 
	function () {
		$(this).removeClass("btRoteiroAtendimentoOver");
	});
	
	//Media Center
	$('.pagRoteiro .menuTopoRoteiro .btRoteiroMediaCenter').hover(function(){
		$(this).addClass("btRoteiroMediaCenterOver");
	}, 
	function () {
		$(this).removeClass("btRoteiroMediaCenterOver");
	});
	
	//Indique a um Amigo
	$('.pagRoteiro .menuTopoRoteiro .btRoteiroIndique').hover(function(){
		$(this).addClass("btRoteiroIndiqueOver");
	}, 
	function () {
		$(this).removeClass("btRoteiroIndiqueOver");
	});
	
	//Faça a sua Reserva
	$('.pagRoteiro .menuTopoRoteiro .btRoteiroFacaReserva').hover(function(){
		$(this).addClass("btRoteiroFacaReservaOver");
	}, 
	function () {
		$(this).removeClass("btRoteiroFacaReservaOver");
	});
	
	//Faça a sua Reserva de Preços
	$('.BgGeralInternas .pagRoteiro .boxPreco .menuPreco .btRoteiroFacaReserva').hover(function(){
		$(this).addClass("btRoteiroFacaReservaPrecoOver");
	}, 
	function () {
		$(this).removeClass("btRoteiroFacaReservaPrecoOver");
	});
	
	//Baixar Preço
	$('.BgGeralInternas .pagRoteiro .boxPreco .menuPreco .btRoteiroBaixarPreco').hover(function(){
		$(this).addClass("btRoteiroBaixarPrecoOver");
	}, 
	function () {
		$(this).removeClass("btRoteiroBaixarPrecoOver");
	});
	
}


/* ---------------------- funcao popUp Mapa de Localiazação -------------------*/
function jqueryzomMapaLocalizacao(){
	$(".jqzoom").jqueryzoom({

		xzoom: 280,        //zooming div default width(default width value is 200)
		yzoom: 229        //zooming div default width(default height value is 200)
	});
}

/* ---------------------- função mostrar vídeos Media Center Vídeos -------------------*/
	
function videoDetalhe(video,mcArqId){
    var playerVideo = $(".playerVideo");
    var htmlPlayerVideo = '';
    
    //apagando o html existente
    playerVideo.html(htmlPlayerVideo);
    
    //setando o html do player de video com o video a ser carregado    
    
    htmlPlayerVideo= "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='460' height='425'>";
    htmlPlayerVideo=htmlPlayerVideo+"<param name='movie' value='swf/player.swf' />";
    htmlPlayerVideo=htmlPlayerVideo+"<param name='quality' value='high' />";
    htmlPlayerVideo=htmlPlayerVideo+"<param name='flashvars' value=videoCarregar="+video+" />";
    htmlPlayerVideo=htmlPlayerVideo+"<embed src='swf/player.swf' width='460' height='425' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' flashvars=videoCarregar="+video+"></embed>";       
    htmlPlayerVideo=htmlPlayerVideo+"</object>";
    
    playerVideo.html(htmlPlayerVideo);
	
	if (mcArqId != ""){
	
		try{
		   var xmlhttp =  new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){};
	
		try{
			var xmlhttp =  new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e){};
	
		try{
		  var  xmlhttp =  new XMLHttpRequest();
		}catch(e){};
		
		xmlhttp.open("GET", "media_center_contAcessos.asp?mcArqId="+mcArqId, true);
		xmlhttp.send(null);
	}

}
	

/* ---------------------- funcao Google Analytics -------------------*/

function googleAnalytics(){
    try {

    var pageTracker = _gat._getTracker("UA-7938960-1");

    pageTracker._trackPageview();

    } catch(err) {}
}

