function resizeMedia(media,width,height) 
{
   mediaObj = document.getElementById(media);
   mediaObj.style.width=width;
   mediaObj.style.height=height;
}


function loadhtml(url) 
{
	// Ponemos en el banner de imágenes, las imágenes generales
	var PeliBanner=parent.document.banner;
	PeliBanner.SetVariable("_root.cab",0);
	
	ifr = document.getElementById("areaCentral");
	//alert(url);
	ifr.src = url;
}

function loadhtmlContenidoSector(url) 
{
	ifr = document.getElementById("areaCentral");
	//alert(url);
	ifr.src = url;
}

function loadhtmlheader(url,sector) 
{
	var PeliFlash=parent.document.cabecera;
	var PeliBanner=parent.document.banner;

	//var prueba = PeliFlash.GetVariable("s");
	
	
	PeliFlash.SetVariable("_root.s",sector);
	PeliBanner.SetVariable("_root.cab",sector);
	
	ifr = parent.document.getElementById("areaCentral");
	
	//alert(url);
	ifr.src = url;
	
}

function loadfromheader(url,sector) 
{
	var PeliFlash=parent.document.banner;

	//var prueba = PeliFlash.GetVariable("s");
	
	
	PeliFlash.SetVariable("_root.cab",sector);
	
	ifr = parent.document.getElementById("areaCentral");
	
	//alert(url);
	ifr.src = url;
	
}


function loadhtmllateral(url,option) 
{
	var PeliFlash=parent.document.menulateral;
	var PeliBanner=parent.document.banner;

	//var prueba = PeliFlash.GetVariable("s");
	
	
	PeliFlash.SetVariable("_root.option",option);
	PeliBanner.SetVariable("_root.cab",0);
	
	ifr = parent.document.getElementById("areaCentral");
	
	//alert(url);
	ifr.src = url;
	
	
	
}

function openfoto(img,imageWidth,imageHeight) {

	
	l = screen.width / 2 
	t = screen.height / 2 

	l -= imageWidth;
	t -= imageHeight; 

	
	
	imageName = "../images/comite/"+img;
	opt = "width=" + imageWidth + ",height=" + imageHeight + ",left="+l+",top="+t+",maxbutton=0";
	alt = "&copy; Soma";
U
 	newWindow = window.open("","newWindow",opt);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<a href="javascript:self.close();"><img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt="'+alt+'" border="0"></a>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function openfotoSindicatos(img,imageWidth,imageHeight) {

	
	l = screen.width / 2 
	t = screen.height / 2 

	l -= imageWidth;
	t -= imageHeight; 

	
	
	imageName = "../images/sindicatosComarcales/"+img;
	opt = "width=" + imageWidth + ",height=" + imageHeight + ",left="+l+",top="+t+",maxbutton=0";
	alt = "&copy; Soma";
 	newWindow = window.open("","Sindicato",opt);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<a href="javascript:self.close();"><img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt="'+alt+'" border="0"></a>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}



function abre_ventana04(theURL,winName,features) { //v2.0
   
  var winl = (screen.width - 700) / 2;
  var wint = (screen.height - 380) / 2;
 
  features = 'width=425,height=310,top='+wint+',left='+winl+',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=0'
 
  window.open(theURL,'v',features);
  
}

function abre_ficha(theURL) { //v2.0
   
 l = screen.width / 2 
	t = screen.height / 2 

	l -= 500;
	t -= 400; 
	URLFinal= "fichas/"+theURL

 
  
  features = 'width=500,height=400,top='+t+',left='+l+',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,titlebar=0'
 
  window.open(URLFinal,'Ficha',features);
  
}

function abre_video(theURL) { //v2.0
   
 l = screen.width / 2 
	t = screen.height / 2 

	l -= 500;
	t -= 400; 
	

 	URLFinal="http://publics.somafiaugt.com/"+theURL
  
  features = 'width=455,height=430,top='+t+',left='+l+',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,titlebar=0'
 
  window.open(URLFinal,'Ficha',features);
  
}

function llaneza01(){
abre_ventana04('../flash/images/llaneza01.swf');
}

function llaneza02(){
abre_ventana04('../flash/images/llaneza02.swf');
}

function llaneza03(){
abre_ventana04('../flash/images/llaneza03.swf');
}

function llaneza04(){
abre_ventana04('../flash/images/llaneza04.swf');
}

function llaneza05(){
abre_ventana04('../flash/images/llaneza05.swf');
}

function llaneza06(){
abre_ventana04('../flash/images/llaneza06.swf');
}

function assa01(){
abre_ventana04('../flash/images/assa01.swf');
}

function assa02(){
abre_ventana04('../flash/images/assa02.swf');
}

function assa03(){
abre_ventana04('../flash/images/assa03.swf');
}

function purif01(){
abre_ventana04('../flash/images/purif01.swf');
}

function purif02(){
abre_ventana04('../flash/images/purif02.swf');
}

function purif03(){
abre_ventana04('../flash/images/purif03.swf');
}

function fixFlash() {
  if (document.getElementsByTagName) {
      var objs = document.getElementsByTagName("object");
      for (i=0; i<objs.length; i++) {
        objs[i].outerHTML = objs[i].outerHTML;
        //alert(objs[i]);
      }
   }
}