// JavaScript Document
function menu(vref){
 	document.getElementById('fmenu').action = vref;
 	document.getElementById('fmenu').submit(); 	
 }

function MM_jumpMenu1(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenu(selObj,restore){ //v3.0
  eval("window.open('"+selObj.options[selObj.selectedIndex].value+"')");
  if (restore) selObj.selectedIndex=0;
}

function replaceChars(campo) {
	temp = "" + campo.value;
	
	while (temp.indexOf('á')>-1) {
	pos= temp.indexOf('á');
	temp = "" + (temp.substring(0, pos) + '&aacute;' + 
	temp.substring((pos + 1), temp.length));
	}
	
	while (temp.indexOf('Á')>-1) {
	pos= temp.indexOf('Á');
	temp = "" + (temp.substring(0, pos) + '&Aacute;' + 
	temp.substring((pos + 1), temp.length));
	}

	while (temp.indexOf('é')>-1) {
	pos= temp.indexOf('é');
	temp = "" + (temp.substring(0, pos) + '&eacute;' + 
	temp.substring((pos + 1), temp.length));
	}

	while (temp.indexOf('É')>-1) {
	pos= temp.indexOf('É');
	temp = "" + (temp.substring(0, pos) + '&Eacute;' + 
	temp.substring((pos + 1), temp.length));
	}

	while (temp.indexOf('í')>-1) {
	pos= temp.indexOf('í');
	temp = "" + (temp.substring(0, pos) + '&iacute;' + 
	temp.substring((pos + 1), temp.length));
	}

	while (temp.indexOf('Í')>-1) {
	pos= temp.indexOf('Í');
	temp = "" + (temp.substring(0, pos) + '&Iacute;' + 
	temp.substring((pos + 1), temp.length));
	}

	while (temp.indexOf('ó')>-1) {
	pos= temp.indexOf('ó');
	temp = "" + (temp.substring(0, pos) + '&oacute;' + 
	temp.substring((pos + 1), temp.length));
	}

	while (temp.indexOf('Ó')>-1) {
	pos= temp.indexOf('Ó');
	temp = "" + (temp.substring(0, pos) + '&Oacute;' + 
	temp.substring((pos + 1), temp.length));
	}

    while (temp.indexOf('ú')>-1) {
	pos= temp.indexOf('ú');
	temp = "" + (temp.substring(0, pos) + '&uacute;' + 
	temp.substring((pos + 1), temp.length));
	}
	
    while (temp.indexOf('Ú')>-1) {
	pos= temp.indexOf('Ú');
	temp = "" + (temp.substring(0, pos) + '&Uacute;' + 
	temp.substring((pos + 1), temp.length));
	}

	while (temp.indexOf('ñ')>-1) {
	pos= temp.indexOf('ñ');
	temp = "" + (temp.substring(0, pos) + '&ntilde;' + 
	temp.substring((pos + 1), temp.length));
	}

	while (temp.indexOf('Ñ')>-1) {
	pos= temp.indexOf('Ñ');
	temp = "" + (temp.substring(0, pos) + '&Ntilde;' + 
	temp.substring((pos + 1), temp.length));
	}
	
	while (temp.indexOf('¿')>-1) {
	pos= temp.indexOf('¿');
	temp = "" + (temp.substring(0, pos) + '&iquest;' + 
	temp.substring((pos + 1), temp.length));
	}

	while (temp.indexOf('\r')>-1) {
	pos= temp.indexOf('\r');
	temp = "" + (temp.substring(0, pos) + '<p>' + 
	temp.substring((pos + 2), temp.length));
	}
	
	while (temp.indexOf('<a href')>-1) {
	pos= temp.indexOf('<a');
	temp = "" + (temp.substring(0, pos) + '<a target="_blank"' + 
	temp.substring((pos + 2), temp.length));
	}

	while (temp.indexOf('<A href')>-1) {
	pos= temp.indexOf('<A');
	temp = "" + (temp.substring(0, pos) + '<a target="_blank"' + 
	temp.substring((pos + 2), temp.length));
	}

	while (temp.indexOf('<np>')>-1) {
	pos= temp.indexOf('<np>');
	temp = "" + (temp.substring(0, pos) + '<nueva_pag>' + 
	temp.substring((pos + 24), temp.length));
	}

	while (temp.indexOf('&lt;')>-1) {
	pos= temp.indexOf('&lt;');
	temp = "" + (temp.substring(0, pos) + '<' + 
	temp.substring((pos + 4), temp.length));
	}
	
	while (temp.indexOf('&gt;')>-1) {
	pos= temp.indexOf('&gt;');
	temp = "" + (temp.substring(0, pos) + '>' + 
	temp.substring((pos + 4), temp.length));
	}
	
	campo.value = temp;
}
