
n = (document.layers)? 1:0
ie = (document.all)? 1:0

agt=navigator.userAgent.toLowerCase();

function textarea (nombre,columnas,filas,wrap,estilo,texto,html) {
	//si es explorer
	if (ie)
	{
		//si es mac
		if (agt.indexOf('mac')!=-1)
		{
			document.write("<textarea name='"+ nombre +"'  cols='"+ ( columnas * 0.86 )+"' rows='"+ ( filas * 1.02 ) +"' wrap='"+ wrap +"' class='"+ estilo +"' "+ html +">"+ texto +"</textarea>");
		}
		//si no lo es
		else
		{
			document.write("<textarea name='"+ nombre +"'  cols='"+ columnas +"'          rows='"+ filas +"'           wrap='"+ wrap +"' class='"+ estilo +"' "+ html +">"+ texto +"</textarea>");
		}
	}
	//si es netscape
	else    { document.write("<textarea name='"+ nombre +"'  cols='"+ ( columnas * 0.65 )+"' rows='"+ ( filas * 0.8 ) +"' wrap='"+ wrap +"' class='"+ estilo +"' "+ html +">"+ texto +"</textarea>"); }
}

function text_input (nombre,tipo,longitud,valor,maximo,estilo,html) {
	if (ie)
	{
		//si es mac
		if (agt.indexOf('mac')!=-1)
		{
			document.write("<input name='"+ nombre +"' type='"+ tipo +"' size='"+ ( longitud * 0.89 ) +"' value='"+ valor +"' maxlength='"+ maximo +"' class='"+ estilo +"' "+ html +">");
		}
		
		//si no lo es
		else
		{
			document.write("<input name='"+ nombre +"' type='"+ tipo +"' size='"+ longitud +"' value='"+ valor +"' maxlength='"+ maximo +"' class='"+ estilo +"' "+ html +">");
		}
	}
	//si es netscape
	else    { document.write("<input name='"+ nombre +"' type='"+ tipo +"' size='"+ ( longitud * 0.6 ) +"' value='"+ valor +"' maxlength='"+ maximo +"' class='"+ estilo +"' "+ html +">"); }
}

function resetBuscador() {
	if (document.busca.busqueda.value == "Palabras clave") document.busca.busqueda.value = "";
	}
	
function right(e) {
	if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
		return false;
	else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
		alert(" No es necesario usar el botón derecho ");
		return false;
	}
	return true;
}	
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;	

function checkData (){
	if (document.busca.busqueda.value == "buscar por ...") {
        	alert("Por favor, introduzca el término a buscar")
                document.busca.busqueda.focus()
                return false}
	}		
