//MOSTRAR DIV OCULTOS
function show(id)
{
	//alert ('show ' + id);
	
	el = document.getElementById(id);
	if (el.style.display == 'none')
	{
		el.style.display = '';
		el = document.getElementById('more' + id);
		//el.innerHTML = 'less...';
	} else {
		el.style.display = 'none';
		el = document.getElementById('more' + id);
		//el.innerHTML = 'more...';
	}
}



// =========================================
// = Developed By Josema Gonzalez (EnZo)   =
// = Version 1                             =
// = http://isiajax.sourceforge.net        =
// = License: GPL (General Public License) =
// =========================================

function isiAJAX(idmain, idloader) {

	this.objAjax = null;		//Objeto XMLHttp
	this.idmain = idmain;		//Id de la capa que va a cargar el contenido nada mas abrir la web
	this.idloader = idloader;	//Id de la capa que va a hacer la funcion de cargador
	this.debug = true;		//Si es true devolvera un alert cuando haya un error al recibir los datos
	this.aborta = true;		//Si es false cancelara cualquier proceso
	this.working = false;		//Si es true significa que esta descargando, sirve para identificar si this.aborta la pondre en false
	this.noajax = 'Su navegador no es compatible para trabajar con esta web.';

	//Hace todo el proceso de transferencia
	this.Request =
		function (data) {
			var parent = this;
			data = this.Default(data);
			this.objAjax.open(data.method, data.url, data.async);
			if (data.headers)
				for (var i=0; i<data.headers.length; i+=2)
					this.objAjax.setRequestHeader(data.headers[i], data.headers[i+1])
			if (data.async) {
				this.working = true;
				this.Cargador(true);
				this.objAjax.onreadystatechange =
					function () {
						if (parent.objAjax.readyState == 4) {
							if (parent.aborta) {
								if (data.onComplete)
									data.onComplete(parent.objAjax, data);
								if ((parent.objAjax.status == 200 || parent.objAjax.status == 304) && data.onOK)
									data.onOK(parent.objAjax, data);
								else if (data.onError)
									data.onError(parent.objAjax, data);
								else if (parent.debug)
									alert('Error: '+parent.objAjax.status+' '+parent.objAjax.statusText);
									//La siguiente line comentarla en producción para que no cargue paginas con descripción de errores
									data.onOK(parent.objAjax, data);
							}
							else 
								parent.aborta = true;
							parent.Cargador(false);
							parent.working = false;
						} 
						else 
						{
						$(data.id).innerHTML = "<img src='../images/loading_trans.gif'  border=0>"
						}
						
					};
			}
			this.objAjax.send(data.param);
		};

	//Hace el proceso correspondiente una vez recibido el objeto ajax
	this.Actualiza =
		function (objAjax, data) {
			switch (data.type) {
				case 1: {
					if (data.iner == 0)
						$(data.id).innerHTML = objAjax.responseText + $(data.id).innerHTML;
					else if (data.iner == 1)
						$(data.id).innerHTML = $(data.id).innerHTML + objAjax.responseText;
					else
						$(data.id).innerHTML = objAjax.responseText;
					break;
				}
				case 2: {
					var objxml = new isiXML(objAjax.responseXML);
					data.id(objxml.Query(data.query), objAjax);
					break;
				}
				case 3: {
					if (data.iner == 0)
						$(data.id).value = objAjax.responseText + $(data.id).value;
					else if (data.iner == 1)
						$(data.id).value = $(data.id).value + objAjax.responseText;
					else
						$(data.id).value = objAjax.responseText;
					break;
				}
				case 4: {
					var obj = $(data.id);
					var objxml = new isiXML(objAjax.responseXML);
					var resultado = objxml.Query('SELECT node.value, atrib.value');
					var total = obj.options.length;
					if (total > 0)
						for (var i=0; i<=total; ++i)
							obj.remove(obj.options[i])
					for (var i=0; i<resultado.length; ++i) {
						var newone = new Option(resultado[i][0], resultado[i][1]);
						try {//Otros
							obj.add(newone, obj.options.length);
						}
						catch(ex) {//IE
							obj.add(newone, obj.options[obj.options.length]);
						}
					}
					break;
				}
				case 5: {
					eval(objAjax.responseText);
					break;
				}
			}
		};

	//Link normal (tipo=1)
	this.Link =
		function (url, id, iner) {
			this.Request({
				url: this.Url(url),
				id: id,
				async: (id) ? true : false,
				iner: iner,
				type: 1,
				onOK: this.Actualiza
			});
		};

	//Formulario (tipo=1)
	this.Form =
		function (idform, id, iner) {
			var form = $(idform);
			this.Request({
				url: this.Url(form.action),
				method: form.method,
				id: id,
				param: this.DataForm(form),
				async: (id) ? true : false,
				iner: iner,
				type: 1,
				onOK: this.Actualiza
			});
		};

	//Devuelve un array con los valores consultados a un xml
	this.XML =
		function (url, funcion, query) {
			this.Request({
				url: this.Url(url),
				id: funcion,
				query: query,
				type: 2,
				onOK: this.Actualiza
			});
		};

	//Para editar el valor de los inputs
	this.Value =
		function (url, id, iner) {
			this.Request({
				url: this.Url(url),
				id: id,
				iner: iner,
				type: 3,
				onOK: this.Actualiza
			});
		};

	//Para editar las listas desplegables select
	this.Select =
		function (url, id) {
			this.Request({
				url: this.Url(url),
				id: id,
				type: 4,
				onOK: this.Actualiza
			});
		};

	//Hace un eval de lo que devuelve (tipo=4)
	this.Run =
		function (url) {
			this.Request({
				url: this.Url(url),
				type: 5,
				onOK: this.Actualiza
			});
		};

	//Para cambiar fotos
	this.Img = 
		function (url, id, w, h) {
			var temp = new Image();
			var parent = this;
			this.working = true;
			this.Cargador(true);
			temp.onload = function () {
				if (parent.aborta) {
					$(id).src = temp.src;
					if (w) $(id).width = w;
					if (h) $(id).height = h;
				}
				parent.Cargador(false);
				parent.aborta = true;
				parent.working = false;
			};
			temp.onerror = function () {
				parent.Cargador(false);
				parent.aborta = true;
				parent.working = false;
				if (parent.debug)
					alert('Error: 404 Not Found');
			};
			temp.src = url;
		};

	//Aborta cualquier peticion			//alert('aborta: '+this.aborta+'\nworking: '+this.working)
	this.Cancel = 
		function () {
			if (this.working) {
				this.Cargador(false);
				this.aborta = false;
				this.working = false;
				this.objAjax.abort();
			}
			else
				this.aborta = true;
		};

	//Recoge y da formato a los datos de un formulario para enviarlos
	this.DataForm =
		function (obj) {
			var resultado='';
			this.Add =
				function (nombre, valor) {
					resultado += nombre+'='+valor;
					if ((i+1) < obj.length) 
						resultado+='&';
				};
			for (i=0; i<obj.length; i++) {
				var tipo = obj[i].type;
				var nombre = obj[i].name;
				//alert(nombre + '=' + obj[i].value);
				if (tipo == 'select-multiple') {
					var n=0;
					for (j=0; j<obj[i].options.length; j++)
						if (obj[i].options[j].selected)
							this.Add(nombre+'['+(n++)+']',obj[i].options[j].value);
				}
				else if (tipo == 'radio' || tipo == 'checkbox') {
					if (obj[i].checked) 
					this.Add(nombre,obj[i].value);
				}
				else if (tipo == 'textarea' ) {
					this.Add(nombre, escape(obj[i].value));
				}
				else
					this.Add(nombre,obj[i].value);
			}
			return (resultado);
		};

	//Recoge atributos de un elemento CSS - (Script oficial: http://www.squidfingers.com/code/snippets/?id=getcssprop)
	this.CSS =
		function (obj, atributo) {
			if (obj.style[atributo])
				return (obj.style[atributo]);
			else if (obj.currentStyle)
				return (obj.currentStyle[atributo]);
			else if (document.defaultView && document.defaultView.getComputedStyle)
				return document.defaultView.getComputedStyle(obj,"").getPropertyValue(atributo);
			else
				return (null);
		};

	//Retorna los valores por defecto de los parametos y agrega las cabeceras post si las necesitara
	this.Default =
		function (obj) {
			var argumentos = {			
				url: this.homepage,
				method: 'GET',
				async: true
			};
			for (var i in argumentos)
				if (obj[i] == null)
					obj[i] = argumentos[i];
			if (obj.method.toUpperCase() == 'GET' && obj.param) {
				obj.url += (obj.url.indexOf('?') == -1) ? '?'+obj.param : '&'+obj.param;
				obj.param = null;
			}
			else if (obj.method.toUpperCase() == 'POST' && obj.headers == null)
				obj.headers = ['Content-Type','application/x-www-form-urlencoded; charset=ISO-8859-1'];
			return (obj);
		};

	//Devuelve la url a partir de la almohadilla 
	this.Url =
		function (str) {
			var resultado='', obj = str.split('#');
			if (obj.length > 1) {
				for (var i=1; i<obj.length; ++i) {
					resultado += obj[i];
					if ((i+1) < obj.length) 
						resultado+='#';
				}
			}
			else
				resultado = obj[0];
			return (resultado);
		};

	//Gestiona la capa cargador para ponerla visible o no
	this.Cargador =
		function (onoff, id) {
			if (id == null)
				id = this.idloader;
			//if (id && (this.working || !onoff))
			if (id)
				$(id).style.visibility = (onoff) ? 'visible' : 'hidden';
		};
	this.Cargador(false);

	//Crea el objeto XMLHTTP
	if (typeof XMLHttpRequest != 'undefined')	//Mozilla & OPERA
		this.objAjax = new XMLHttpRequest();
	else if (typeof ActiveXObject != 'undefined') //IE
		this.objAjax = (Number(navigator.appVersion.substr(0,3)) >= 5) ? new ActiveXObject('Msxml2.XMLHTTP') : new ActiveXObject('Microsoft.XMLHTTP');
	if (this.objAjax == null) 
		alert(this.noajax);
	else if (this.idmain && window.location.hash != '' && window.location.hash != '#')
		this.Link(window.location.href, this.idmain);
}
function $(id) {
	return (document.getElementById(id));
}
/*
url: '',			//url web
method: 'GET',		//metodo de transferencia
async: true,		//si es true recibira datos si es false no
param: null,		//parametos en plan: var1=valor1&var2=valor2
id: null,			//id donde va a ser cargado
headers: null,		//cabeceras
iner: null,
type: null,
onOK: null,
onError: null,
onComplete: null
*/









//------------------------------------------------------------------------------------------------------------------

//AJAX

coded = 0;

var objXMLHttp

//Esta función carga una página en el div id 
function cargapag(id,pag) {
	
	coded = id;

  objXMLHttp=createXmlHttpObject()
  
  if (objXMLHttp==null) {
    alert ('¡Tu navegador no sopote el objeto XMLHttpRequest!');
    return;
  }
  
  
	 //Si la URL de la página lleva variables concatena un sid, sino lo mete como variable
	 var url=pag + '&sid=' + Math.random(); // prevent caching
	
	if (pag.indexOf('?') == -1) 
	{
	url=pag + '?sid=' + Math.random(); // prevent caching
	}
  
  objXMLHttp.onreadystatechange = stateChanged;
  objXMLHttp.open('GET',url,true); // GET method
	   
	objXMLHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
	objXMLHttp.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
	objXMLHttp.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
	objXMLHttp.setRequestHeader("Pragma", "no-cache");

//objXmlHttp.setRequestHeader('Content-Type', 'text/xml; charset=UTF-8'); 
  objXMLHttp.send(null); // always use null for GET method
}



//Esta función carga una página en el div id 
function cargaform(id,pag) {
	
	coded = id;
	
		var str = '';
		var elem = document.getElementById('myform').elements;
		for(var i = 0; i < elem.length; i++)
		{
			
			str +=  "&" + elem[i].name  + "=" + elem[i].value 

		} 
	
  objXMLHttp=createXmlHttpObject()
  
  if (objXMLHttp==null) {
    alert ('¡Tu navegador no sopote el objeto XMLHttpRequest!');
    return;
  }
  
  
	 //Si la URL de la página lleva variables concatena un sid, sino lo mete como variable
	 var url=pag + '?sid=' + Math.random() + str; // prevent caching
	
  objXMLHttp.onreadystatechange = stateChanged;
  objXMLHttp.open('GET',url,true); // GET method
	   
	objXMLHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
	objXMLHttp.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
	objXMLHttp.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
	objXMLHttp.setRequestHeader("Pragma", "no-cache");

//objXmlHttp.setRequestHeader('Content-Type', 'text/xml; charset=UTF-8'); 
  objXMLHttp.send(null); // always use null for GET method
	
	
	   
}




function subscribe(id,pag) {
	
	coded = id;

  objXMLHttp=createXmlHttpObject()
  
  if (objXMLHttp==null) {
    alert ('¡Tu navegador no sopote el objeto XMLHttpRequest!');
    return;
  }
  
  //var url=pag + '?eml=' + str + '&sid=' + Math.random(); // prevent caching
  var url=pag + '&sid=' + Math.random(); // prevent caching
  objXMLHttp.onreadystatechange = stateChanged;
  objXMLHttp.open('GET',url,true); // GET method
	   
	objXMLHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
	objXMLHttp.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
	objXMLHttp.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
	objXMLHttp.setRequestHeader("Pragma", "no-cache");

//objXmlHttp.setRequestHeader('Content-Type', 'text/xml; charset=UTF-8'); 
  objXMLHttp.send(null); // always use null for GET method
}
  
function createXmlHttpObject() {
  var req = null;
  try {
    req = new XMLHttpRequest(); //ie7, ff, safari
  }
  catch (e) {
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP"); //later ie
    }
    catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP") // earlier ie
      }
      catch (e) {
        // could not create XMLHttpRequest object
        return false;
      }
    }
  }
  return req;
}

function stateChanged()
{
	
	code = coded
	
  if (objXMLHttp.readyState == 0)  {
    document.getElementById(code).innerHTML = "<img src='../images/loading.gif'  vspace=10>"; //uninitialized
  }
  else if(objXMLHttp.readyState == 1)  {
    document.getElementById(code).innerHTML = "<img src='../images/loading.gif'   vspace=10>"; //loading
  }
  else if(objXMLHttp.readyState == 2)  {
    document.getElementById(code).innerHTML = "<img src='../images/loading.gif'   vspace=10>"; //loaded
  }
  else if(objXMLHttp.readyState == 3)  {
    document.getElementById(code).innerHTML = "<img src='../images/loading.gif'   vspace=10>"; //interactive
  }
  else if (objXMLHttp.readyState == 4 || objXMLHttp.readyState == "complete") {
	
	var resultado = objXMLHttp.responseText; // Coloca o retornado pelo Ajax nessa variável 
	resultado = resultado.replace(/\+/g," "); // Resolve o problema dos acentos (saiba mais aqui: http://www.plugsites.net/leandro/?p=4) 
	resultado = unescape(resultado); // Resolve o problema dos acentos 
	
	
	//alert(resultado);
	
	document.getElementById(code).innerHTML = resultado; 
	
  }
} 



//------------------------------------------------------------------------------------------------------------------


<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->



//------------------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------------------
function P7_Scrub(obj) { //v1.0 by PVII
 if(obj.blur){obj.blur();}
}
//------------------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------------------

/***********************************************
* IFrame SSI script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe","ficha"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function dyniframesize() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById){ //begin resizing iframe procedure
dyniframe[dyniframe.length] = document.getElementById(iframeids[i]);
if (dyniframe[i] && !window.opera){
dyniframe[i].style.display="block"
if (dyniframe[i].contentDocument && dyniframe[i].contentDocument.body.offsetHeight) //ns6 syntax
dyniframe[i].height = dyniframe[i].contentDocument.body.offsetHeight+FFextraHeight; 
else if (dyniframe[i].Document && dyniframe[i].Document.body.scrollHeight) //ie5+ syntax
dyniframe[i].height = dyniframe[i].Document.body.scrollHeight;
}
}
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

if (window.addEventListener)
window.addEventListener("load", dyniframesize, false)
else if (window.attachEvent)
window.attachEvent("onload", dyniframesize)
else
window.onload=dyniframesize
//------------------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------------------

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}


//------------------------------------------------------------------------------------------------------------------

//MOSTRAR/OCULTAR LAYERS
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
//MOSTRAR/OCULTAR LAYERS

//VALIDAR FORMULARIOS

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe contener una dirección de correo electrónico.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' debe contener un número.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' debe contener un número entre '+min+' y '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es obligatorio.\n'; }
  } if (errors) alert('Se han producido los siguientes errores:\n'+errors);
  document.MM_returnValue = (errors == '');
}


//------------------------------------------------------------------------------------------------------------------
//POSICIONAR EL CURSOR

function sf(){
	//document.busqueda.busca.focus();
	}


//------------------------------------------------------------------------------------------------------------------
//RECOGIDA DE LA RESOLUCION

<!-- Begin
//var xy = navigator.appVersion;
//xz = xy.substring(0,4);
//document.cookie = "ScreenWidth=" + screen.width
//document.cookie = "ScreenHeight=" + screen.height
// End -->

//------------------------------------------------------------------------------------------------------------------
//OPENER

function newWindow(file,window) { 
msgWindow=open(file,window,'resizable=no,width=200,height=200');
if (msgWindow.opener == null) 
msgWindow.opener = self;
}

//------------------------------------------------------------------------------------------------------------------
//MOSTRAR OCULTAR LAYERS


function faq(faq_,num_){
	esconde_faq(num_);
	if(document.getElementById(faq_).style.visibility=="visible"){
		document.getElementById(faq_).style.visibility="hidden";
		document.getElementById(faq_).style.display="none";
	}else{
		document.getElementById(faq_).style.display="Inline";
		document.getElementById(faq_).style.visibility="visible";
	}
}
function esconde_faq(num_){
var n, tmp
for (n=1;n<=parseInt(num_);n++) {
	tmp="fi"+n
		document.getElementById(tmp).style.visibility="hidden";
		document.getElementById(tmp).style.display="none";		
	if (n==num_){
   break;} 
	}
}


function faq1(faq_,num_){
	esconde_faq1(num_);
	if(document.getElementById(faq_).style.visibility=="visible"){
		document.getElementById(faq_).style.visibility="hidden";
		document.getElementById(faq_).style.display="none";
	}else{
		document.getElementById(faq_).style.display="Inline";
		document.getElementById(faq_).style.visibility="visible";
	}
}
function esconde_faq1(num_){
var n, tmp
for (n=1;n<=parseInt(num_);n++) {
	tmp="fii"+n
		document.getElementById(tmp).style.visibility="hidden";
		document.getElementById(tmp).style.display="none";		
	if (n==num_){
   break;} 
	}
}

function cambia_img(nom_,img_){
nom_.src=img_;
}



function ventanas(ventana,num_){
	esconde_ventanas(num_);
	if(document.getElementById(ventana).style.visibility=="visible"){
		document.getElementById(ventana).style.visibility="hidden";
		document.getElementById(ventana).style.display="none";
	}else{
		document.getElementById(ventana).style.display="Inline";
		document.getElementById(ventana).style.visibility="visible";
	}
}
function esconde_ventanas(num_){
var n, tmp
for (n=1;n<=parseInt(num_);n++) {
	tmp="ventana"+n
		document.getElementById(tmp).style.visibility="hidden";
		document.getElementById(tmp).style.display="none";		
	if (n==num_){
   break;} 
	}
}




function muestra_MZ(apartado){
	
	lugar='menuoff'+apartado
	document.getElementById(lugar).style.visibility="hidden";
	document.getElementById(lugar).style.display="none";
	
	lugar='menuon'+apartado
	document.getElementById(lugar).style.visibility="visible";
	document.getElementById(lugar).style.display="Inline";		

}

function muestra(apartado,num_total){
	muestra_todos('menuoff',num_total);
	esconde_muestra('menuon',num_total);
	
	lugar='menuoff'+apartado
	document.getElementById(lugar).style.visibility="hidden";
	document.getElementById(lugar).style.display="none";
	
	lugar='menuon'+apartado
	document.getElementById(lugar).style.visibility="visible";
	document.getElementById(lugar).style.display="Inline";		

}

function muestra_todos(seccion,num_total){
var n, tmp
for (n=1;n<=parseInt(num_total);n++) {
	tmp=seccion+n
		document.getElementById(tmp).style.visibility="visible";
		document.getElementById(tmp).style.display="Inline";		
	if (n==num_total){
   break;} 
	}
}



function esconde_muestra(seccion,num_total){
var n, tmp
for (n=1;n<=parseInt(num_total);n++) {
	tmp=seccion+n
		document.getElementById(tmp).style.visibility="hidden";
		document.getElementById(tmp).style.display="none";		
	if (n==num_total){
   break;} 
	}
}

//------------------------------------------------------------------------------------------------------------------
//PRELOAD

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_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_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];}
}


//------------------------------------------------------------------------------------------------------------------


/*
 *  md5.js 1.0b 27/06/96
 *
 * Javascript implementation of the RSA Data Security, Inc. MD5
 * Message-Digest Algorithm.
 *
 * Copyright (c) 1996 Henri Torgemane. All Rights Reserved.
 *
 * Permission to use, copy, modify, and distribute this software
 * and its documentation for any purposes and without
 * fee is hereby granted provided that this copyright notice
 * appears in all copies.
 *
 * Of course, this soft is provided "as is" without express or implied
 * warranty of any kind.
 *
 *
 * Modified with german comments and some information about collisions.
 * (Ralf Mieke, ralf@miekenet.de, http://mieke.home.pages.de)
 */



function array(n) {
  for(i=0;i<n;i++) this[i]=0;
  this.length=n;
}



/* Einige grundlegenden Funktionen müssen wegen
 * Javascript Fehlern umgeschrieben werden.
 * Man versuche z.B. 0xffffffff >> 4 zu berechnen..
 * Die nun verwendeten Funktionen sind zwar langsamer als die Originale,
 * aber sie funktionieren.
 */

function integer(n) { return n%(0xffffffff+1); }

function shr(a,b) {
  a=integer(a);
  b=integer(b);
  if (a-0x80000000>=0) {
    a=a%0x80000000;
    a>>=b;
    a+=0x40000000>>(b-1);
  } else
    a>>=b;
  return a;
}

function shl1(a) {
  a=a%0x80000000;
  if (a&0x40000000==0x40000000)
  {
    a-=0x40000000;
    a*=2;
    a+=0x80000000;
  } else
    a*=2;
  return a;
}

function shl(a,b) {
  a=integer(a);
  b=integer(b);
  for (var i=0;i<b;i++) a=shl1(a);
  return a;
}

function and(a,b) {
  a=integer(a);
  b=integer(b);
  var t1=(a-0x80000000);
  var t2=(b-0x80000000);
  if (t1>=0)
    if (t2>=0)
      return ((t1&t2)+0x80000000);
    else
      return (t1&b);
  else
    if (t2>=0)
      return (a&t2);
    else
      return (a&b);
}

function or(a,b) {
  a=integer(a);
  b=integer(b);
  var t1=(a-0x80000000);
  var t2=(b-0x80000000);
  if (t1>=0)
    if (t2>=0)
      return ((t1|t2)+0x80000000);
    else
      return ((t1|b)+0x80000000);
  else
    if (t2>=0)
      return ((a|t2)+0x80000000);
    else
      return (a|b);
}

function xor(a,b) {
  a=integer(a);
  b=integer(b);
  var t1=(a-0x80000000);
  var t2=(b-0x80000000);
  if (t1>=0)
    if (t2>=0)
      return (t1^t2);
    else
      return ((t1^b)+0x80000000);
  else
    if (t2>=0)
      return ((a^t2)+0x80000000);
    else
      return (a^b);
}

function not(a) {
  a=integer(a);
  return (0xffffffff-a);
}

/* Beginn des Algorithmus */

    var state = new array(4);
    var count = new array(2);
        count[0] = 0;
        count[1] = 0;
    var buffer = new array(64);
    var transformBuffer = new array(16);
    var digestBits = new array(16);

    var S11 = 7;
    var S12 = 12;
    var S13 = 17;
    var S14 = 22;
    var S21 = 5;
    var S22 = 9;
    var S23 = 14;
    var S24 = 20;
    var S31 = 4;
    var S32 = 11;
    var S33 = 16;
    var S34 = 23;
    var S41 = 6;
    var S42 = 10;
    var S43 = 15;
    var S44 = 21;

    function F(x,y,z) {
        return or(and(x,y),and(not(x),z));
    }

    function G(x,y,z) {
        return or(and(x,z),and(y,not(z)));
    }

    function H(x,y,z) {
        return xor(xor(x,y),z);
    }

    function I(x,y,z) {
        return xor(y ,or(x , not(z)));
    }

    function rotateLeft(a,n) {
        return or(shl(a, n),(shr(a,(32 - n))));
    }

    function FF(a,b,c,d,x,s,ac) {
        a = a+F(b, c, d) + x + ac;
        a = rotateLeft(a, s);
        a = a+b;
        return a;
    }

    function GG(a,b,c,d,x,s,ac) {
        a = a+G(b, c, d) +x + ac;
        a = rotateLeft(a, s);
        a = a+b;
        return a;
    }

    function HH(a,b,c,d,x,s,ac) {
        a = a+H(b, c, d) + x + ac;
        a = rotateLeft(a, s);
        a = a+b;
        return a;
    }

    function II(a,b,c,d,x,s,ac) {
        a = a+I(b, c, d) + x + ac;
        a = rotateLeft(a, s);
        a = a+b;
        return a;
    }

    function transform(buf,offset) {
        var a=0, b=0, c=0, d=0;
        var x = transformBuffer;

        a = state[0];
        b = state[1];
        c = state[2];
        d = state[3];

        for (i = 0; i < 16; i++) {
            x[i] = and(buf[i*4+offset],0xff);
            for (j = 1; j < 4; j++) {
                x[i]+=shl(and(buf[i*4+j+offset] ,0xff), j * 8);
            }
        }

        /* Runde 1 */
        a = FF ( a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
        d = FF ( d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
        c = FF ( c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
        b = FF ( b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
        a = FF ( a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
        d = FF ( d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
        c = FF ( c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
        b = FF ( b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
        a = FF ( a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
        d = FF ( d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
        c = FF ( c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
        b = FF ( b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
        a = FF ( a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
        d = FF ( d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
        c = FF ( c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
        b = FF ( b, c, d, a, x[15], S14, 0x49b40821); /* 16 */

        /* Runde 2 */
        a = GG ( a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
        d = GG ( d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
        c = GG ( c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
        b = GG ( b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
        a = GG ( a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
        d = GG ( d, a, b, c, x[10], S22,  0x2441453); /* 22 */
        c = GG ( c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
        b = GG ( b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
        a = GG ( a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
        d = GG ( d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
        c = GG ( c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
        b = GG ( b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
        a = GG ( a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
        d = GG ( d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
        c = GG ( c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
        b = GG ( b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */

        /* Runde 3 */
        a = HH ( a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
        d = HH ( d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
        c = HH ( c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
        b = HH ( b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
        a = HH ( a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
        d = HH ( d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
        c = HH ( c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
        b = HH ( b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
        a = HH ( a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
        d = HH ( d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
        c = HH ( c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
        b = HH ( b, c, d, a, x[ 6], S34,  0x4881d05); /* 44 */
        a = HH ( a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
        d = HH ( d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
        c = HH ( c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
        b = HH ( b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */

        /* Runde 4 */
        a = II ( a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
        d = II ( d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
        c = II ( c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
        b = II ( b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
        a = II ( a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
        d = II ( d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
        c = II ( c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
        b = II ( b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
        a = II ( a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
        d = II ( d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
        c = II ( c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
        b = II ( b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
        a = II ( a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
        d = II ( d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
        c = II ( c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
        b = II ( b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */

        state[0] +=a;
        state[1] +=b;
        state[2] +=c;
        state[3] +=d;

    }
    /* Mit der Initialisierung von Dobbertin:
       state[0] = 0x12ac2375;
       state[1] = 0x3b341042;
       state[2] = 0x5f62b97c;
       state[3] = 0x4ba763ed;
       gibt es eine Kollision:

       begin 644 Message1
       M7MH=JO6_>MG!X?!51$)W,CXV!A"=(!AR71,<X`Y-IIT9^Z&8L$2N'Y*Y:R.;
       39GIK9>TF$W()/MEHR%C4:G1R:Q"=
       `
       end

       begin 644 Message2
       M7MH=JO6_>MG!X?!51$)W,CXV!A"=(!AR71,<X`Y-IIT9^Z&8L$2N'Y*Y:R.;
       39GIK9>TF$W()/MEHREC4:G1R:Q"=
       `
       end
    */
    function init() {
        count[0]=count[1] = 0;
        state[0] = 0x67452301;
        state[1] = 0xefcdab89;
        state[2] = 0x98badcfe;
        state[3] = 0x10325476;
        for (i = 0; i < digestBits.length; i++)
            digestBits[i] = 0;
    }

    function update(b) {
        var index,i;

        index = and(shr(count[0],3) , 0x3f);
        if (count[0]<0xffffffff-7)
          count[0] += 8;
        else {
          count[1]++;
          count[0]-=0xffffffff+1;
          count[0]+=8;
        }
        buffer[index] = and(b,0xff);
        if (index  >= 63) {
            transform(buffer, 0);
        }
    }

    function finish() {
        var bits = new array(8);
        var        padding;
        var        i=0, index=0, padLen=0;

        for (i = 0; i < 4; i++) {
            bits[i] = and(shr(count[0],(i * 8)), 0xff);
        }
        for (i = 0; i < 4; i++) {
            bits[i+4]=and(shr(count[1],(i * 8)), 0xff);
        }
        index = and(shr(count[0], 3) ,0x3f);
        padLen = (index < 56) ? (56 - index) : (120 - index);
        padding = new array(64);
        padding[0] = 0x80;
        for (i=0;i<padLen;i++)
          update(padding[i]);
        for (i=0;i<8;i++)
          update(bits[i]);

        for (i = 0; i < 4; i++) {
            for (j = 0; j < 4; j++) {
                digestBits[i*4+j] = and(shr(state[i], (j * 8)) , 0xff);
            }
        }
    }

/* Ende des MD5 Algorithmus */

function hexa(n) {
 var hexa_h = "0123456789abcdef";
 var hexa_c="";
 var hexa_m=n;
 for (hexa_i=0;hexa_i<8;hexa_i++) {
   hexa_c=hexa_h.charAt(Math.abs(hexa_m)%16)+hexa_c;
   hexa_m=Math.floor(hexa_m/16);
 }
 return hexa_c;
}


var ascii="01234567890123456789012345678901" +
          " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"+
          "[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";

function MD5(nachricht)
{
 var l,s,k,ka,kb,kc,kd;

 init();
 for (k=0;k<nachricht.length;k++) {
   l=nachricht.charAt(k);
   update(ascii.lastIndexOf(l));
 }
 finish();
 ka=kb=kc=kd=0;
 for (i=0;i<4;i++) ka+=shl(digestBits[15-i], (i*8));
 for (i=4;i<8;i++) kb+=shl(digestBits[15-i], ((i-4)*8));
 for (i=8;i<12;i++) kc+=shl(digestBits[15-i], ((i-8)*8));
 for (i=12;i<16;i++) kd+=shl(digestBits[15-i], ((i-12)*8));
 s=hexa(kd)+hexa(kc)+hexa(kb)+hexa(ka);
 return s;
}



//-------------------------
function GP_popupConfirmMsg(msg) { //v1.0
  document.MM_returnValue = confirm(msg);
}

//--------------------------


//contador de caracteres de textarea
<!-- Dynamic Version by: Nannette Thacker -->
<!-- http://www.shiningstar.net -->
<!-- Original by :  Ronnie T. Moore -->
<!-- Web Site:  The JavaScript Source -->
<!-- Use one function for multiple text areas on a page -->
<!-- Limit the number of characters per textarea -->
<!-- Begin
function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
cntfield.value = maxlimit - field.value.length;
}
//  End -->


function changeContent(id,shtml) {
   if (document.getElementById || document.all) {
      var el = document.getElementById? document.getElementById(id): document.all[id];
      if (el && typeof el.innerHTML != "undefined") el.innerHTML = shtml;
   }
}


								

