var PeliFlash=null;
function inicia(){
	PeliFlash=window.document.videoadorini;	
	// En algunos navegadores se precisa esperar para
	// poder conocer y modificar algunas variables
	var timerID=setTimeout('inicia1()',50);
	PeliFlash.SetVariable("indice",0);
}

function cambia_titulo(){
	PeliFlash.SetVariable("indice",2);
}

function popupvideo(enlace)
{
	var popupUrl = window.document.getElementById('videoUrl').value;
	if (popupUrl.indexOf("video.php?id=1") != -1) {
		// If the url contains the id=1 parameter it is only the chapter 3, so window dimensions are different
		window.open(popupUrl, 'adorini', 'width=710, height=404, status=0, toolbar=0, menubar=0, scrollbars=1, resizable=1');
	} else {
		window.open(popupUrl, 'adorini', 'width=467, height=271, status=0, toolbar=0, menubar=0, scrollbars=1, resizable=1');
	}	
}

var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

function insertFlash(protocol, content, width, height) {
	if ( MM_FlashCanPlay ) {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase="' + protocol + '://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' +  width + '" height="' + height + '">\n');
		// document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
		document.write('<param name="movie" value="'+ content +'" />\n');
		document.write('<param name="quality" value="high" />\n');
		// document.write('<param name="bgcolor" value="#ffffff" />\n');
		document.write('<embed src="'+ content +'" quality="high" width="' + width + '" height="' + height + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
		document.write('</object>\n');
	} 
}