var stringtrim=new String(location.protocol+"//"+location.hostname+"/");var completeurl=new String(location.href);var cutfrom=stringtrim.length+3;var relativeurl=completeurl.slice(cutfrom,completeurl.length);var certificaurl="/"+certificaLocalization(completeurl.slice(cutfrom,completeurl.length));if(certificaurl.charAt(certificaurl.length-1)!="/"){certificaurl+="/"}certificaurl+="index";var actualurl=""+document.location;if(actualurl.charAt(actualurl.length-1)!="/"){actualurl+="/"}function openFull(a,b){var w=screen.width;var h=screen.height;var c=0;var d=0;var e="/"+b+"/videos/fullscreen/"+a;var f='width='+w+',height='+h+',top='+d+',left='+c+',toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=yes';var g=window.open(e,'wtc',f);g.resizeTo(w,h);g.focus()}function openPopup(w,h,a){var b=(screen.width-w)/2;var c=(screen.height-h)/2;var d='width='+w+',height='+h+',top='+c+',left='+b+',toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=yes';var e=window.open(a,'wtc',d);e.resizeTo(w,h);e.focus()}function certificaLocalization(a){a=a.replace(/fotos/gi,'galleries');a=a.replace(/peliculas|filmes/gi,'movies');a=a.replace(/sinopsis|sinopse/gi,'synopsis');a=a.replace(/descargas/gi,'downloads');a=a.replace(/personajes|personajens/gi,'characters');a=a.replace(/episodios/gi,'episodes');a=a.replace(/programacion|programacao/gi,'schedule');a=a.replace(/concursos|concurso|contests/gi,'contests');a=a.replace(/especiales|especiais/gi,'specials');a=a.replace(/bloques|blocos/gi,'blocks');return a}



//Acomoda background en firefox
//window.onresize = resize;
function resize()
{
	/*
	if (window.innerWidth <= 1024)
	{
		document.getElementById('container').style.backgroundPosition = '-210px 0px';
	}
	else
	{
		document.getElementById('container').style.backgroundPosition = 'center top';
	}
	*/
}


//pulldown paises
function changeCountry(countryId){
	var index = window.location.href.indexOf('/', 7);
	var actualCountry = window.location.href.substring(index, index+3);
	var followPath = window.location.href.substring(index+4);

	window.location.href = countryId + followPath;
	return true;
}

function changePulldownCountry()
{
	var countries = document.getElementById('countryId');
	var index = window.location.href.indexOf('/', 7);
	var actualCountry = window.location.href.substring(index, index+3);
	
	for(i=0; i < countries.length; i++)
	{
		if(countries.options[i].value.substring(0, 3) == actualCountry){							
				countries.options.selectedIndex = i;
			}
	}
}