//
// Funciones generales
// (c) 2001-2002
//     Fernando Sengáriz Martínez de Gońi
//


String.prototype.trim = function(){return this.replace(/^\s+|\s+$/g,'');}

// deteccion del navegador 

ns4 = (document.layers) ? true:false;
ie4 = (document.all) ? true:false;
dom = document.getElementById ? true:false;


// abrir ventana nueva

function abrirVentana (pag,tam_x,tam_y,vent,scroll,resize,menu,tool,status) {
 var pos_x, pos_y;
 scroll = (scroll==null) ? false : scroll;
 scroll = (scroll) ? "yes" : "no";
 resize = (resize==null) ? false : resize;
 resize = (resize) ? "yes" : "no";
 menu = (menu==null) ? false : menu;
 menu = (menu) ? "yes" : "no";
 tool = (tool==null) ? false : tool;
 tool = (tool) ? "yes" : "no";
 status = (status==null) ? false : status;
 status = (status) ? "yes" : "no";
 tam_x = (tam_x==null) ? 640 : tam_x;
 tam_y = (tam_y==null) ? 300 : tam_y;

 if (ns4 || ie4) {
 	var alto=window.screen.height;
 	var ancho=window.screen.width;
	pos_x = (ancho-tam_x)/2;
	pos_y = (alto-tam_y)/2-20;
 } else {
 	pos_x = 0;
 	pos_y = 0;
 }

 return(window.open(pag, vent, "toolbar="+tool+",directories=no,menubar="+menu+",scrollbars="+scroll+",location=no,status="+status+",resizable="+resize+",width="+tam_x+",height="+tam_y+",left="+pos_x+",top="+pos_y));
}


function abrirFoto (cual,tam_X,tam_Y) {
 abrirVentana("/verFoto.asp?foto=" + cual,tam_X,tam_Y,null,null,'fotos');
}

function on ( cual, imagen, accion ) {
 if (accion) {
 	eval("document." + cual).src = "/imagenes/" + imagen;
 } else {
 	eval("document." + cual).src = "/imagenes/" + imagen;
 }
}

function cambiarClase (src,estilo) {
 src.className = estilo;
}
