function paginadoBusquedaAvanzada(mipagina) {
	var ff=window.document.bava;
	ff.pagina.value=mipagina;
	ff.submit();
}

function mostrarOferta(Id,Tabla) {
	window.location.href="oferta.html?tipo="+Tabla+"&id="+Id;
}

function zoomFotos(n) {
	posX=(screen.width/2)-400;
	posY=(screen.height/2)-300;
	var zoom = window.open("foto_zoom.html?Id="+n,"","width=800,height=600,left="+posX+",top="+posY+",status=no,resizable=yes,scrollbars=no"); 
}

function validarFichaVentaCompra() {

	var ok=0;

	var ff=window.document.FVentaCompra;
	
	event.returnValue=false;

	validacion = /[^a-z-.@0-9A-Z]/g;
	validacionTelefono = /[^+ 0-9]/g;
	validacionNumerica = /[^0-9]/g;

	if (ff.Nombre.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Nombre'.\n\n");
	} else {
		if(ff.Nombre.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Nombre'.\n\n");
		}
	}


	if (ff.Direccion.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Dirección'.\n\n");
	} else {
		if(ff.Direccion.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Dirección'.\n\n");
		}
	}

	if (ff.Codigo_Postal.value.length != 5 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Código Postal'.\n\n");
	} else {
		if (validacionNumerica.test(ff.Codigo_Postal.value)) {
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Código Postal'.\n\n");
		}
	}

	if (ff.Poblacion.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Población'.\n\n");
	} else {
		if(ff.Poblacion.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Población'.\n\n");
		}
	}

	if (ff.Provincia.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Provincia'.\n\n");
	} else {
		if(ff.Provincia.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Provincia'.\n\n");
		}
	}

	if (validacionTelefono.test(ff.Telefono.value) || (ff.Telefono.value.length<6)) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Teléfono'.\nLos únicos caracteres válidos para este campo son '+', ' ' y números del 0 al 9\n\n");
	}


	if (ff.Fax.value.length>0){
		if (validacionTelefono.test(ff.Fax.value) || (ff.Fax.value.length<6)) {
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Fax'.\nLos únicos caracteres válidos para este campo son '+', ' ' y números del 0 al 9\n\n");
		}
	}

	if (checkEmail(ff.eMail.value)) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'eMail'.\nEl formato válido es usuario@dominio.tld\n\n");
	}

	if (ff.Tipo_de_Inmueble.options[ff.Tipo_de_Inmueble.selectedIndex].text == "") {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Tipo de Inmueble'.\n\n");
	}

	if (ff.Direccion_Inmueble.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Dirección'.\n\n");
	} else {
		if(ff.Direccion_Inmueble.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Dirección'.\n\n");
		}
	}

	if (ff.Codigo_Postal_Inmueble.value.length != 5 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Código Postal'.\n\n");
	} else {
		if (validacionNumerica.test(ff.Codigo_Postal_Inmueble.value)) {
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Código Postal'.\n\n");
		}
	}

	if (ff.Poblacion_Inmueble.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Población'.\n\n");
	} else {
		if(ff.Poblacion_Inmueble.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Población'.\n\n");
		}
	}

	if (ff.Provincia_Inmueble.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Provincia'.\n\n");
	} else {
		if(ff.Provincia_Inmueble.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Provincia'.\n\n");
		}
	}


	if (ff.Observaciones.value.length < 1 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Observaciones'.\n\n");
	}


	if (ok==0) {
		ff.submit();
	} else {
		event.returnValue=false;	
	}
}

function validarFichaBusca() {

	var ok=0;

	var ff=window.document.FVentaCompra;
	
	event.returnValue=false;

	validacion = /[^a-z-.@0-9A-Z]/g;
	validacionTelefono = /[^+ 0-9]/g;
	validacionNumerica = /[^0-9]/g;

	if (ff.Nombre.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Nombre'.\n\n");
	} else {
		if(ff.Nombre.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Nombre'.\n\n");
		}
	}


	if (ff.Direccion.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Dirección'.\n\n");
	} else {
		if(ff.Direccion.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Dirección'.\n\n");
		}
	}

	if (ff.Codigo_Postal.value.length != 5 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Código Postal'.\n\n");
	} else {
		if (validacionNumerica.test(ff.Codigo_Postal.value)) {
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Código Postal'.\n\n");
		}
	}

	if (ff.Poblacion.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Población'.\n\n");
	} else {
		if(ff.Poblacion.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Población'.\n\n");
		}
	}

	if (ff.Provincia.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Provincia'.\n\n");
	} else {
		if(ff.Provincia.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Provincia'.\n\n");
		}
	}

	if (validacionTelefono.test(ff.Telefono.value) || (ff.Telefono.value.length<6)) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Teléfono'.\nLos únicos caracteres válidos para este campo son '+', ' ' y números del 0 al 9\n\n");
	}


	if (ff.Fax.value.length>0){
		if (validacionTelefono.test(ff.Fax.value) || (ff.Fax.value.length<6)) {
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Fax'.\nLos únicos caracteres válidos para este campo son '+', ' ' y números del 0 al 9\n\n");
		}
	}

	if (checkEmail(ff.eMail.value)) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'eMail'.\nEl formato válido es usuario@dominio.tld\n\n");
	}

	if (ff.Tipo_de_Inmueble.options[ff.Tipo_de_Inmueble.selectedIndex].text == "") {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Tipo de Inmueble'.\n\n");
	}

	if (ff.Superficie_Minima.value.length < 1 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Superficie'.\n\n");
	}

	if (ff.Precio_Maximo.value.length < 1 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Precio'.\n\n");
	}

	if (ff.Zona_Preferida.value.length < 1 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Zona'.\n\n");
	}

	if (ff.Observaciones.value.length < 1 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Observaciones'.\n\n");
	}


	if (ok==0) {
		ff.submit();
	} else {
		event.returnValue=false;	
	}
}

function validarContacto() {

	var ok=0;

	var ff=window.document.FContacto;

	validacion = /[^a-z-.@0-9A-Z]/g;
	validacionTelefono = /[^+ 0-9]/g;

	if (ff.Persona_de_Contacto.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Persona de Contacto'.\n\n");
	} else {
		if(ff.Persona_de_Contacto.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Persona de Contacto'.\n\n");
		}
	}

	if (checkEmail(ff.eMail.value)) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'eMail'.\nEl formato válido es usuario@dominio.tld\n\n");
	}

	if (validacionTelefono.test(ff.Telefono.value) || (ff.Telefono.value.length<6)) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Teléfono'.\nLos únicos caracteres válidos para este campo son '+', ' ' y números del 0 al 9\n\n");
	}

	if (ff.Tipo_de_Soporte.options[0].selected) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Tipo de Soporte'.\n\n");
	}

	if (ff.mensaje.value.length < 1 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Comentarios'.\n\n");
	}

	if (ok==0){
		ff.submit();
	} else {
		event.returnValue=false;	
	}
}

function validarFContactar() {

	var ok=0;

	var ff=window.document.FContactar;

	validacion = /[^a-z-.@0-9A-Z]/g;
	validacionTelefono = /[^+ 0-9]/g;

	if (ff.PersonaContacto.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Persona de Contacto'.\n\n");
	} else {
		if(ff.PersonaContacto.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Persona de Contacto'.\n\n");
		}
	}

	if (checkEmail(ff.eMail.value)) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'eMail'.\nEl formato válido es usuario@dominio.tld\n\n");
	}

	if (validacionTelefono.test(ff.Telefono.value) || (ff.Telefono.value.length<6)) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Teléfono'.\nLos únicos caracteres válidos para este campo son '+', ' ' y números del 0 al 9\n\n");
	}

	if (ff.Tipo_de_Soporte.options[0].selected) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Tipo de Soporte'.\n\n");
	}

	if (ff.mensaje.value.length < 1 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Comentarios'.\n\n");
	}

	if (ok==0){
		ff.submit();
	} else {
		event.returnValue=false;	
	}
}

function validarFFtp(ff) {

	var ok=0;

	validacion = /[^a-z-., _@0-9A-Z]/g;
	
	if (validacion.test(ff.fullname.value)) {
		ok=1;
	}
	if (validacion.test(ff.password.value)) {
		ok=1;
	}
	if (validacion.test(ff.userid.value)) {
		ok=1;
	}

	if (ff.fullname.value.length < 3 ){
		ok=1;
	} else {
		if(ff.fullname.value.length > 81){
			ok=1;
		}
	}
	if (ff.password.value.length < 3 ){
		ok=1;
	} else {
		if(ff.password.value.length > 31){
			ok=1;
		}
	}
	if (ff.userid.value.length < 3 ){
		ok=1;
	} else {
		if(ff.userid.value.length > 31){
			ok=1;
		}
	}
	if (ok==0){
		ff.submit();
	} else {
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nEl campo 'Empresa' deberá tener entre 4 y 81 caracteres, los campos 'Identificador de Usuario' y 'Contraseña' deberán tener entre 4 y 31 caracteres.\n\nLos caracteres válidos son: de la A a la Z (mayúsculas y minúsculas), 0 a 9, espacio, coma, punto, guión y arroba.\n");
		event.returnValue=false;
	}
}

function validarFEmail(ff) {

	var ok=0;

	validacion = /[^a-z-., _@0-9A-Z]/g;
	
	if (validacion.test(ff.FullName.value)) {
		ok=1;
	}
	if (validacion.test(ff.Password.value)) {
		ok=1;
	}

	if (ff.FullName.value.length < 3 ){
		ok=1;
	} else {
		if(ff.FullName.value.length > 100){
			ok=1;
		}
	}
	if (ff.Password.value.length < 3 ){
		ok=1;
	} else {
		if(ff.Password.value.length > 32){
			ok=1;
		}
	}
	if (ok==0){
		ff.submit();
	} else {
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nEl campo 'Nombre con el que se firma' deberá tener entre 3 y 100 caracteres :\n Los caracteres válidos son: de la A a la Z (mayúsculas y minúsculas), 0 a 9, espacio, coma, punto, guión y arroba.\n\nEl campo 'Contraseña' deberá tener entre 3 y 32 caracteres :\n Los caracteres válidos son: de la A a la Z (mayúsculas y minúsculas), 0 a 9, espacio, coma, punto, guión y arroba.\n\n");
		event.returnValue=false;
	}
}


function validarWebMail() {

	var ok=0;

	var ff=window.document.FWebMail;

	validacion = /[^a-z-.@0-9A-Z]/g;
	
	if (validacion.test(ff.User.value)) {
		ok=1;
	}
	if (validacion.test(ff.Password.value)) {
		ok=1;
	}

	if (ff.User.value.length < 3 ){
		ok=1;
	} else {
		if(ff.User.value.length > 128){
			ok=1;
		}
	}
	if (ff.Password.value.length < 3 ){
		ok=1;
	} else {
		if(ff.Password.value.length > 128){
			ok=1;
		}
	}
	if (ok==0){
		ff.submit();
	} else {
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nIntroduzca un Identificador de usuario y contraseña válidos.\n\n");
		event.returnValue=false;
	}
}


function validarContacto() {

	var ok=0;

	var ff=window.document.FContacto;

	validacion = /[^a-z-.@0-9A-Z]/g;
	validacionTelefono = /[^+ 0-9]/g;

	if (ff.Empresa.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Empresa'.\n\n");
	} else {
		if(ff.Empresa.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Empresa'.\n\n");
		}
	}

	if (ff.Persona_de_Contacto.value.length < 3 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Persona de Contacto'.\n\n");
	} else {
		if(ff.Persona_de_Contacto.value.length > 128){
			ok=1;
			alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Persona de Contacto'.\n\n");
		}
	}

	if (checkEmail(ff.eMail.value)) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'eMail'.\nEl formato válido es usuario@dominio.tld\n\n");
	}

	if (validacionTelefono.test(ff.Telefono.value) || (ff.Telefono.value.length<6)) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Teléfono'.\nLos únicos caracteres válidos para este campo son '+', ' ' y números del 0 al 9\n\n");
	}

	if (ff.Tipo_de_Soporte.options[0].selected) {
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Tipo de Soporte'.\n\n");
	}

	if (ff.mensaje.value.length < 1 ){
		ok=1;
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nRellene correctamente el campo 'Comentarios'.\n\n");
	}

	if (ok==0){
		ff.submit();
	} else {
		event.returnValue=false;	
	}
}


function checkEmail(emailStr) {
   if (emailStr.length == 0)
     return true;
   var emailPat=/^(.+)@(.+)$/;
   var specialChars="()<>@,;:\".[]";
   var validChars="[^s" + specialChars + "]";
   var quotedUser="(\"[^\"]*\")";
   var ipDomainPat=/^(d{1,3})[.](d{1,3})[.](d{1,3})[.](d{1,3})$/;
   var atom=validChars + '+';
   var word="(" + atom + "|" + quotedUser + ")";
   var userPat=new RegExp("^" + word + "(." + word + ")*$");
   var domainPat=new RegExp("^" + atom + "(." + atom + ")*$");
   var matchArray=emailStr.match(emailPat);

   if (matchArray == null)
      return false;

   var user=matchArray[1];
   var domain=matchArray[2];

   if (user.match(userPat) == null)
      return false;

   var IPArray = domain.match(ipDomainPat);
   if (IPArray != null) {
      for (var i = 1; i <= 4; i++) {
         if (IPArray[i] > 255)
         	return false;
   		}

   return true;
	 }

   var domainArray=domain.match(domainPat);
   if (domainArray == null)
      return false;

   var atomPat=new RegExp(atom,"g");
   var domArr=domain.match(atomPat);
   var len=domArr.length;

   if (domArr[domArr.length-1].length < 2 || domArr[domArr.length-1].length > 3)
      return false;

   if (len < 2)
      return false;

   return true;
}


function validarUsuarios() {

	var ok=0;

	var ff=window.document.FUsuarios;

	validacion = /[^a-z-.@0-9]/gi;
	
	if (validacion.test(ff.User.value)) {
		ok=1;
	}
	if (validacion.test(ff.Password.value)) {
		ok=1;
	}

	if (ff.User.value.length < 3 ){
		ok=1;
	} else {
		if(ff.User.value.length > 128){
			ok=1;
		}
	}
	if (ff.Password.value.length < 3 ){
		ok=1;
	} else {
		if(ff.Password.value.length > 128){
			ok=1;
		}
	}
	if (ok==0){
		ff.submit();
	} else {
		alert("Se ha detectado un error en la validación del formulario de datos :\n\nIntroduzca un Identificador de usuario y contraseña válidos.\n\n");
		event.returnValue=false;
	}
}

function texto_es(xvar) {
	var browsername = navigator.appName;
	if(browsername == 'Microsoft Internet Explorer') {
		obj1=document.all['cont_dommia_es'];
	} else {
		obj1=document.getElementById('cont_dommia_es');
	}

	if (xvar=='servicio') {
		obj1.innerHTML='Desde 1.998 ofreciendo servicio y atención personalizada a nuestros clientes.<br><br>';
	}

	if (xvar=='innovacion') {
		obj1.innerHTML='Soluciones antispam y antivirus para su correo electrónico.<br><br>';
	}

	if (xvar=='flexibilidad') {
		obj1.innerHTML='Soporte de Perl, ASP y PHP en sus soluciones de hospedaje estándar.<br><br>';
	}

	if (xvar=='solidaridad') {
		obj1.innerHTML='Colabora con <a class="link_int" href="http://www.bayt-al-thaqafa.org" target="_blank">Bayt Al-Thaqafa</a>, una fundación de apoyo a los inmigrantes arabomusulmanes que viven en Cataluña.<br>';
	}

	if (xvar=='solucion') {
		obj1.innerHTML='Servicios en internet para empresas: registro de dominios, hospedaje, correo electrónico, diseño, maquetación y programación de páginas web.<br>';
	}
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

 function MM_showHideLayers() { //v2.0
   var i, visStr, args, theObj;
   args = MM_showHideLayers.arguments;
   for (i=0; i<(args.length-2); i+=3) { //with arg triples (objNS,objIE,visStr)
     visStr   = args[i+2];
     if (navigator.appName == 'Netscape' && document.layers != null) {
       theObj = eval(args[i]);
       if (theObj) theObj.visibility = visStr;
     } else if (document.all != null) { //IE
       if (visStr == 'show') visStr = 'visible'; //convert vals
       if (visStr == 'hide') visStr = 'hidden';
       theObj = eval(args[i+1]);
       if (theObj){
		pageWidth=(ie)?document.body.offsetWidth:innerWidth;
		theObj.style.left=(pageWidth - 780)/2;
		theObj.style.visibility = visStr;
		}
  } }
}

function Mostrar_Ocultar(capa,imagen) {
	if(document.getElementById(capa).style.display == 'inline') {
		document.getElementById(capa).style.display = 'none';
		MM_swapImage('img_'+imagen,'','images/m_verde_'+imagen+'.gif',1);
	} else {
		document.getElementById(capa).style.display = 'inline';
		MM_swapImage('img_'+imagen,'','images/m_verde_'+imagen+'-.gif',1);
	}
}

/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;


/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */

function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 3.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it
    if (currentColor.indexOf("rgb") >= 0) 
    {
        var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1,
                                     currentColor.indexOf(')'));
        var rgbValues = rgbStr.split(",");
        currentColor = "#";
        var hexChars = "0123456789ABCDEF";
        for (var i = 0; i < 3; i++)
        {
            var v = rgbValues[i].valueOf();
            currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
        }
    }

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function