function AtualizaCharge(strCharge)
	{
	document.getElementById("MultimidiaCharge").src = strCharge
	}	

function TocaMultimidia()
	{
	var strURL = unescape(location.href);
	var intPosTipo = strURL.indexOf('?t=');
	var intPosLink = strURL.indexOf('|l=');
	var intPosDescr = strURL.indexOf('|d=');
	var intPosChapeu = strURL.indexOf('|c=');

	if ((intPosLink > -1) && (intPosDescr > -1) && (intPosChapeu > -1) && (intPosTipo > -1)) {
		var strTipo = strURL.substr(intPosTipo + 3, 1);
		var strLink = strURL.substr(intPosLink + 3, intPosDescr - intPosLink - 3);
		var strDescr = strURL.substr(intPosDescr + 3, intPosChapeu - intPosDescr - 3);
		var strChapeu = strURL.substr(intPosChapeu + 3);

		if (strTipo == 'V') {
			activateVideoAvulso(strLink, strChapeu, strDescr)
			}

		if (strTipo == 'A') {
			activateAudioAvulso(strLink)
			}
		}
	}


function ContabilizaMSN(){
	
	var s_account='msnportalbresportes';
	s.linkInternalFilters='javascript:,BR-Esportes'; s.trackExternalLinks=true;
	s.channel='msn.br';
	s.pageName='Esportes Galeria de fotos:';
	s.prop1='Esportes';
	s.prop2='pt-br';
	s.prop3='';
	s.prop4='';

	if (dominioparceiro){
		var s_code=s.t();if(s_code)document.write(s_code);
		var cImage = new Image;var RF= escape(parent.document.referrer);
		cImage.src ='http://c.msn.com/c.gif?DI=2349&PI=9566&TP=http://esportes.msn.com.br/esportes'+ document.location.pathname +'&PS=10300&RF="'+ RF +'" ';
	}
}

function MostraFoto(foto)
{
	ContabilizaMSN();
	
	fotos =	document.frmFotos.arrayFotos.value;
	legendas =	document.frmFotos.arrayLegenda.value;
	alts = document.frmFotos.arrayAlts.value;
	
	arrayFotos = fotos.split("|");
	arrayLegendas = legendas.split("|");
	arrayAlts = alts.split("|");
	
	imagem = document.getElementById("TagImagemFotos")
	legenda = document.getElementById("TagLegendaFotos")

	imagem.src = arrayFotos[foto];
	//imagem.alt = arrayAlts[foto];
	imagem.alt = arrayLegendas[foto];
	legenda.innerHTML = arrayLegendas[foto];
}
	
function NavegaFotos(sentido)	
{
	//chamada para o google analytics
	if (dominioparceiro)
	{
		_uacct = "UA-2249725-6";
	} else {
		_uacct = "UA-2249725-1";
	}
	
	urchinTracker();

	valorinicial = document.frmFotos.valorinicial.value
	fotos =	document.frmFotos.arrayFotos.value;
	legendas =	document.frmFotos.arrayLegenda.value;
	alts = document.frmFotos.arrayAlts.value;
	
	arrayFotos = fotos.split("|");
	arrayLegendas = legendas.split("|");
	arrayAlts = alts.split("|");

	imagem = document.getElementById("TagImagemFotos")
	legenda = document.getElementById("TagLegendaFotos")

	//primeira
	if(parseInt(sentido)==0)
	{
		imagem.src = arrayFotos[0];
		//imagem.alt = arrayAlts[0];
		imagem.alt = arrayLegendas[0];
		legenda.innerHTML = arrayLegendas[0];
		document.frmFotos.valorinicial.value = 0;

	}
	else
		//anterior
		if(parseInt(sentido)==1)
		{
			if(parseInt(valorinicial)!= 0)
			{
				ContabilizaMSN();
				pos = parseInt(valorinicial) - 1;
				imagem.src = arrayFotos[pos];
				//imagem.alt = arrayAlts[pos];
				imagem.alt = arrayLegendas[pos];
				legenda.innerHTML = arrayLegendas[pos];
				document.frmFotos.valorinicial.value = pos;
			}	
		}
		//proximo
		else
		{
			if(parseInt(valorinicial) < (arrayFotos.length - 1))
			{
				ContabilizaMSN();
				pos = parseInt(valorinicial) + 1;
				imagem.src = arrayFotos[pos];
				//imagem.alt = arrayAlts[pos];
				imagem.alt = arrayLegendas[pos];
				legenda.innerHTML = arrayLegendas[pos];
				document.frmFotos.valorinicial.value = pos;
			}
		}	
}	

function AbrePopup(url) 
  { 
  var urlorigem,strorigem,idx01,idx02;

  urlorigem = window.location;
  strorigem = String(urlorigem)
  idx01 = strorigem.indexOf("msn.lancenet.com.br")
  idx02 = strorigem.indexOf("lancenet.msn.com.br")
  idx03 = strorigem.indexOf("msn.desenv.lancenet")
  idx04 = strorigem.indexOf("msn.prod.lancenet")
  if ((idx01 >= 0) || (idx02 >= 0) || (idx03 >= 0) || (idx04 >= 0)){
	  location.href = url;
  }
  else {
  window.open(url,'LancePopupGaleria','width=350,height=310,toolbars=no')   
  }
  }

