<!--

var ventana = null;

function abreVentana(pagina, nombre, w, h) {

//alert(w + ", " + h)


//if (ventana) ventana.close();

ventana = open(pagina, nombre, 'width=' + w + ',height=' + h + ',resizable=no , scrollbars=yes, status=no');
ventana.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
ventana.focus();
}

function NotaPremsa(pagina, nombre, w, h) {
     ventana = open(pagina, nombre, 'width=' + w + ',height=' + h + ',resizable=no ,scrollbars=yes,status=no,menubar=no');
ventana.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
ventana.focus();
}

function AbrirVentana(pagina, nombre, w, h) {
	ventana = open(pagina, nombre, 'width=' + w + ',height=' + h + ',resizable=no ,scrollbars=yes,status=no,menubar=no');
ventana.focus();
ventana.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
}

function MaxVentana(pagina,nombre) {
var w, h;
w = screen.availWidth-100;
h = screen.availHeight-200;
ventana= open(pagina, nombre,'width=' + w + ',height=' + h + ',resizable=yes ,scrollbars=yes,status=no,menubar=no');
ventana.focus();
ventana.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
}




function AbrirCatalogo(pagina, nombre, w, h) {
	ventana = open(pagina, nombre, 'width=' + w + ',height=' + h + ',resizable=no ,scrollbars=no,status=no,menubar=no');
ventana.focus();
ventana.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
}
function AbrirFicha(pagina, nombre, w, h) {
	ventana = open(pagina, nombre, 'width=' + w + ',height=' + h + ',resizable=no ,scrollbars=no,status=no,menubar=no');
ventana.focus();
ventana.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
}


function abrirEnNuevaVentana()
{
   // obtenemos todos los elementos <a> dentro del documento
   var As = document.getElementsByTagName('a');
   // generamos un bucle para asignar los eventos
   for (var i = 0; i < As.length; i++)
   {
      var el = As[i];
      // comprobamos que posee el atributo rel y es igual a nuevaVentana
      if (el.getAttribute('rel') == 'nuevaVentana')
      {
         el.onclick = function()
         {
            // vamos a abrir una nueva ventana con la dirección del enlace (href)
            // y a cancelar la llamada habitual con return false
            window.open(this.href);
            return false;
         };
      }
   }
}



var titulopordefecto = "Oratge"; //Si no se especifica un título al llamar a la función colocará el que se especifique aquí
var ventana;
var cont=0;

function Abre_Oratge(cual,titulo)
{
if(cont==1){ventana.close();ventana=null}
if(titulo==null){titulo=titulopordefecto}
ventana=window.open('','ventana','resizable=yes,scrollbars=no')
ventana.document.write('<html><head><title>' + titulo + '</title><link rel="icon" href="/favicon.png" type="image/png"><link rel="shortcut icon" href="/favicon.png" type="image/png"></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><a href="javascript:window.close()"><img src="' + cual + '" onLoad="opener.redimensionar(this.width, this.height)" border="0"></a>');
ventana.document.close();
cont++;
}
function redimensionar(ancho, alto)
{
ventana.resizeTo(ancho+12,alto+28);
ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2); //centra la ventana. Eliminar si no se quiere centrar el popup
}
// SCRIPT PARA PASAR VARIABLES EN EL REL DE LOS HREF


/**
 * OnClick v1.0 - Accessible Onclick Javascript
 * (c) 2008 Alejandro Arco <http://www.alejandroarco.es>
 * MIT-style license
 */



function e(y){y.setAttribute('name','onclick');y.setAttribute('href','#onclick');var o,i,f,p,r='';o=y.getAttribute('rel');i=o.indexOf('[')+1;f=o.indexOf(']');p=o.substring(i,f).split(',');for(i=0;i<p.length;i++){if(i==0)r+=p[i]+'(';else if(i==1)r+=p[i];else r+=','+p[i];if(i==p.length-1)r+=')'}eval(r);}var s=function(){if(!document.getElementsByTagName)return null;var x,i,y,o;x=document.getElementsByTagName('a');for(i=0;i<x.length;i++){y=x[i];o=y.getAttribute('rel');if(o!=''&&o!=null&&o.indexOf('onclick[')==0)y.onclick=function (){e(this);return false;}}return true;}
var a,b;a=window.attachEvent;b=window.addEventListener;if(document.all&&a)a('onload',s);else if(b)b('load',s,false)






//ESTE ES PARA ABRIR POPUP ACCESIBLE
function acc_popup(url,w,h) { 
var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=" + w + " ,height=" + h ;
ventana= window.open(url,"",opciones);
ventana.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
ventana.focus();
}

//ESTE ES PARA ABRIR POPUP ACCESIBLE CON BARRAS SCROLL
function acc_popup2(url,w,h) { 
var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=" + w + " ,height=" + h ;
ventana= window.open(url,"",opciones);
ventana.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
ventana.focus();
}

//ESTE ES PARA ABRIR POPUP MAXIMIZADO ACCESIBLE
function MaxiVentana(url) {
var w, h;
w = screen.availWidth-100;
h = screen.availHeight-100;
var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=" + w + " ,height=" + h ;
ventana= window.open(url,"",opciones);
ventana.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
ventana.focus();
}


//ESTE ES PARA ABRIR _BLANK ACCESIBLE

function blank(URL) {
var temporalForm = document.createElement('form');
with (temporalForm) {
setAttribute('method', 'GET');
setAttribute('action', URL);
setAttribute('target', '_blank');
}

var paramsString = URL.substring(URL.indexOf('?') + 1, URL.length);
var paramsArray = paramsString.split('&');

for (var i = 0; i < paramsArray.length; ++i) {
var elementIndex = paramsArray[i].indexOf('=');
var elementName = paramsArray[i].substring(0, elementIndex);
var elementValue = paramsArray[i].substring(elementIndex + 1, paramsArray[i].length);

var temporalElement = document.createElement('input');
with(temporalElement) {
setAttribute('type', 'hidden');
setAttribute('name', elementName);
setAttribute('value', elementValue);
}

temporalForm.appendChild(temporalElement);
}

document.body.appendChild(temporalForm);
temporalForm.submit();
document.body.removeChild(temporalForm);
}
