
//===========================================================
// Gracias por interesarte en nuestro código. 
// Esto es el detector del Módulo Flash
// Revision 2007.10.31
// Énoe, Realidad Virtual: www.enoe.es
//===========================================================


var isFlash4 = false;
var isFlash5 = false;
var isFlash6 = false;
var isFlash7 = false;
var isFlash8 = false;
var isFlash9 = false;
var isFlash10 = false;
var isFlash11 = false;

var isIE45 = false;

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;		// true si la plataforma es Windows
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true si la plataforma es Windows
var isMac= (navigator.userAgent.indexOf('Mac') != -1) ? true : false;

// VBScript.  Detección en IE/Windows
if(isIE && isWin){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('isFlash4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('isFlash5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
	document.write('isFlash6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
	document.write('isFlash7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
	document.write('isFlash8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
	document.write('isFlash9 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
	document.write('isFlash10 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');
	document.write('isFlash11 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.11"))) \n');
	document.write('</SCR' + 'IPT\> \n');
}

// Detección del plug-in Flash en Mozilla
function detectFlash(){
	if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash 2.0"]
		|| navigator.plugins["Shockwave Flash"]){

			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
			isFlash4 = flashVersion >= 4;
			isFlash5 = flashVersion >= 5;
			isFlash6 = flashVersion >= 6;
			isFlash7 = flashVersion >= 7;
			isFlash8 = flashVersion >= 8;
			isFlash9 = flashVersion >= 9;
			isFlash10 = flashVersion >= 0;
			isFlash11 = flashVersion >= 1;

		}
	}
}

detectFlash();

if ( (navigator.userAgent.indexOf('MSIE 4.5') != -1) && (navigator.userAgent.indexOf('Mac') != -1)) {
	isIE45=true; isFlash5=true;
}

// Devuelve el código HTML para incrustar el archivo SWF
function flashEmbed(swf,width,height,bgcolor,qual,transp,flashvars) {
		if (!bgcolor) bgcolor="#000000";
		if (!qual) qual='HIGH';
		var code = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ID="flash" NAME="flash" '
		+ 'WIDTH="'+width+'" HEIGHT="'+height+'" '
		+ 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		+ '<PARAM NAME="MOVIE" VALUE="'+swf+'">'
		+ '<PARAM NAME="PLAY" VALUE="true">'
		+ '<PARAM NAME="QUALITY" VALUE="'+qual+'">'
		+ '<PARAM NAME="MENU" VALUE="false">';
		+ '<PARAM NAME="allowScriptAccess" VALUE="always">';


		if (transp) code+='<PARAM NAME=wmode VALUE=transparent>';
		if (flashvars) code+='<PARAM NAME="FlashVars" VALUE="' + flashvars + '">';

		code+='<PARAM NAME=bgcolor VALUE="'+bgcolor+'"> '
		+ '<EMBED ID="flash" NAME="flash" SRC="'+swf+'" '
		+ 'WIDTH="'+width+'" HEIGHT="'+height+'" '
		+ 'PLAY="true" '
		+ 'QUALITY="'+qual+'" '
		+ 'MENU="false" '
		+ 'BGCOLOR="'+bgcolor+'" ';
		+ 'allowScriptAccess="always" ';

		if (transp) code+='wmode=transparent ';
		if (flashvars) code+='FlashVars="' + flashvars + '" ';

		code+='TYPE="application/x-shockwave-flash" '
		+ 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
		+ '</EMBED>'
		+ '</OBJECT>';

		return(code);
}


function insertaFlashPrincipalEs(enclave) {
	document.write(flashEmbed("flash/main_es.swf",731,596,"#000000",false,false,enclave));
}
function insertaFlashPrincipalCa(enclave) {
	document.write(flashEmbed("flash/main_ca.swf",731,596,"#000000",false,false,enclave));
}

function insertaPanorama() {
	document.write(flashEmbed("qtvr.swf",732,500,"#000000",'high',false,"allowFullScreen=true&allowScriptAccess=sameDomain&preview=preview_kemet.jpg&movie=kemet.swf?xml_file=kemet.xml"));
}



