function cambiarMundo(mundo){
	var form = document.fCambiaMundo;
	form.mundo.value=mundo;
	form.submit();
}

function buscar(form){
	str   = document.f_search.patron.value;
	str = str.replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "").replace("'", "");	
	str = str.replace(/^\s*|\s*$/g,""); // trim
	document.f_search.patron.value = str;
	largo = str.length;

	/*if(largo <= 1){
		alert("Ingresa el texto que quieres buscar");
		document.f_search.patron.focus();
		return;
	}*/
	//valido que el patron no sea blanco
	if (document.f_search.patron.value == ""){
		alert("Ingresa el texto que quieres buscar");
		document.f_search.patron.focus();
		return;
	}
	// valido el largo
    if((largo < 2 )){
        alert("El texto debe contener al menos 2 caracteres.");
        document.f_search.patron.focus();
        return;
    }	
    
	//document.f_search.action='/easy/SearchDisplay';
	document.f_search.submit();
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// elimina bancos al principio y al final de una cadena
function trim(cadena){
	for(i=0; i<cadena.length; )	{
		if(cadena.charAt(i)==" ")
			cadena=cadena.substring(i+1, cadena.length);
		else
			break;
	}
	for(i=cadena.length-1; i>=0; i=cadena.length-1)	{
		if(cadena.charAt(i)==" ")
			cadena=cadena.substring(0,i);
		else
			break;
	}	
	return cadena;
}




/* PARA EL MENU DEL HEADER */
startList = function() {
	if (document.all&&document.getElementById) {
//alert('inload generico');
		navRoot = document.getElementById("menu");
		if (navRoot){
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}
				}
			}
		}
	}
}
window.onload=startList;

load = function(){
	exec_AJAXRPC('GET', '/easy/MostrarMenuHeader', 'mostrarMenuHeader');
}

function mostrarMenuHeader(text){
//alert('dis');
	if (text != ''){
		document.getElementById('divMenu').innerHTML = text;
		
		// para las funciones del menu
		if (document.all&&document.getElementById) {
			//alert('inload acetogen');
			navRoot = document.getElementById("menu");
			if (navRoot){
				for (i=0; i<navRoot.childNodes.length; i++) {
					node = navRoot.childNodes[i];
					if (node.nodeName=="LI") {
						node.onmouseover=function() {
							this.className+=" over";
						}
						node.onmouseout=function() {
							this.className=this.className.replace(" over", "");
						}
					}
				}
			}
		}
	}   
}


