//Esta variable "lang" se usa para detectar si en la url hay el texto "ES0", "EN0" etc y lo pone en la url del swf, el swf lee esa //parte de la url y en base a eso pone el texto de la precarga en el idioma que corresponde
var ur = document.URL;
var lang = "";
 if (ur.indexOf('ES0') != -1)
 lang="ES0";
 if (ur.indexOf('NL0') != -1)
 lang="NL0";
 if (ur.indexOf('PT0') != -1)
 lang="PT0";
 if (ur.indexOf('EN0') != -1)
 lang="EN0";

//--------------------Función para llamar más de una vez a window.onload--------------------------
function addLoadEvent (func) { 
var oldonload = window.onload; 
if (typeof window.onload != 'function') { 
window.onload = func; 
} else { 
window.onload = function() { 
if (oldonload) { 
oldonload(); 
} 
func(); 
} 
} 
}
addLoadEvent (AsigFuncVidComm);

function AsigFuncVidComm(){
	
	var ImgSeminario = document.getElementById('ImgSeminarioCom');
	ImgSeminario.onclick = function() {onclick=verVideo("../Media/ViCom-ES-ES-OT-Seminario-090525.swf?" + lang + "","486px","864px","VideoVisible");}
	
	var ImgBenAH = document.getElementById('ImgBenAH');
	ImgBenAH.onclick = function() {onclick=verVideo("../Media/ViCom-EN-EN-Benelux-AH-090612.swf?" + lang + "","486px","864px","VideoVisible");}	
	
  var ImgBenLH = document.getElementById('ImgBenLH');
	ImgBenLH.onclick = function() {onclick=verVideo("../Media/ViCom-EN-EN-Benelux-LH-090711.swf?" + lang + "","486px","864px","VideoVisible");}	
	
	var ImgBenDP = document.getElementById('ImgBenDP');
	if(ImgBenDP)
	ImgBenDP.onclick = function() {onclick=verVideo("../Media/ViCom-NL-NL-Benelux Daniel-091124.swf?" + lang + "","486px","864px","VideoVisible");}	
	
	
/*	var Docum = document.getElementById('Docum');
	Docum.onclick = function() {onclick=verVideo("../Documents/EN/ViCom-ES-00-AP-PT-Documation2008-0806-1280x720CM.swf?" + lang + "","534px","950px","VideoVisible");}
	
	var Ajunt = document.getElementById('Ajunt');
	Ajunt.onclick = function() {onclick=verVideo("../Documents/EN/ViCom-ES-PT-AP-PT-CityConcil-080618.swf?" + lang + "","335px","747px","VideoVisible");}
	
	var AjuntPT = document.getElementById('AjuntPT');
	AjuntPT.onclick = function() {onclick=verVideo("../Documents/EN/ViCom-ES-PT-AP-PT-CityConcil-080618_subt_PT.swf?" + lang + "","335px","747px","VideotVisible");}*/
	
	
	
	var CerrarVideoCom = document.getElementById('CerrarVideoCom');
	CerrarVideoCom.onclick = function() {onclick=CerrarVideo();}
	
	var ImgVeloVideoCom = document.getElementById('ImgVeloVideoCom');
	ImgVeloVideoCom.onclick = function() {onclick=CerrarVideo();}
	
	
}
//_______________________Para mostrar Video en la misma división_______________________

function verVideo(peli,alto,ancho,clasediv)
{
	document.getElementById('ImgVeloVideoCom').src= "/Images/fondoVelo.gif";
	document.getElementById('DivVideoCom').className=clasediv;
	document.getElementById('veloVideoCom').className='veloVideoOpacidad';
	document.getElementById('ImgLogoSobreVelo-VideoCom').src= "/Images/auraportal-logo.png";

	document.getElementById('DivContVideoCom').innerHTML = "<code><object id=\"Animacion\" data=\" " + peli + "\" type=\"application/x-shockwave-flash\" height=\""+ alto +"\" width=\""+ ancho +"\"> <param name=\"quality\" value=\"high\"/> <param name=\"menu\" value=\"false\"/> <param name=\"movie\" title=\"Animacion\" value=\"" + peli + "\"/><param name=\"wmode\" value=\"transparent\"/></object> </code>";
}
//_______________________Código para Cerrar Video _______________________

function CerrarVideo()
{
	document.getElementById('DivVideoCom').className='VideoInvisible';
	document.getElementById('DivContVideoCom').innerHTML = '&nbsp;';
	document.getElementById('veloVideoCom').className = 'veloVideoTransp';	
	document.getElementById('ImgLogoSobreVelo-VideoCom').src= "/Images/trans.gif";
}