
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 == "Palabras clave" || document.busca.busqueda.value == "") {
        	alert("Por favor, introduzca el término a buscar")
                document.busca.busqueda.focus()
                return false}
	}		


function MFXiSM(){
	L=new Array(numMenu);
	for(j=0;j<numMenu;j++){L[j]="MFX"+j;}
	spd=10;
	stp=3;
	cl=1;
	gSL=0;
	var d=document;
	nn=d.layers?1:0;
	rng=0;
	wO=-1;
	wait=-1; 
	var n=navigator;
	op=n.userAgent.toLowerCase().indexOf("opera")!=-1;
	mac=d.all && n.appVersion.toLowerCase().indexOf("mac")!=-1;
	OM=op||mac;
	gT=new Array();
	gL=new Array();
	gHt=new Array();
	gW=new Array();
	gML=new Array();
	gH='hidden';
	gV='visible';
	for(i=0;i < L.length;i++){
		L[i]=(nn)?eval('d.'+L[i]):d.all?eval('d.all.'+L[i]+'.style'):d.getElementById(L[i]).style;
		mos=i&1;
		gML[i]=mos?0:1;
		if(gML[i]){
			if(i==0){
				gT[i]=pI(L[i].top);
				gL[i]=pI(L[i].left)
			}else{
				gL[i]=gL[i-2];gT[i]=gT[i-2]+gHt[i-2]
			}
			gHt[i]=nn?L[i].clip.height:d.all?pI(L[i].pixelHeight):pI(L[i].height);
			gW[i]=nn?L[i].clip.width:d.all?pI(L[i].pixelWidth):pI(L[i].width);
			L[i].left=gL[i];
			L[i].top=gT[i];
			L[i].visibility=gV
			}
			if(!gML[i]){gT[i]=gT[i-1]+gHt[i-1];
			gL[i]=gL[i-1];
			gHt[i]=nn?L[i].clip.height:d.all?pI(L[i].pixelHeight):pI(L[i].height);
			gW[i]=nn?L[i].clip.width:d.all?pI(L[i].pixelWidth):pI(L[i].width);
			L[i].left=gL[i]+gSL;
			L[i].top=gT[i];
			}
	}

function MFXef(){
	var a=0;
	while(a<d.links.length){
		d.links[a].blur();
		++a}
	}
	d.onmouseup=MFXef;
	MFXrSR()
}

function MFXrM(n){
	if(!rng && n+2 < L.length){
		if(wO==-1){
			oS=stp;L[n+1].visibility=OM?gH:gV;
			MFXoS(n+2)
			}else{
				if(wO==n&&cl){
					cS=gHt[n+1];
					L[n+1].visibility=OM?gH:gV;
					MFXcS(n+2)
					}
				if(wO!=n){
					cS=gHt[wO+1];
					L[wO+1].visibility=OM?gH:gV;MFXcS(wO+2);
					wait=n
				}
			}
		}
	}

function MFXoS(n){
	rng=1;	
	for(i=n; i < L.length; i+=2){
		L[i].top=pI(L[i].top)+stp
		}
	nn?L[n-1].clip.height=oS:L[n-1].clip='rect(' + 0 +' '+ gW[n-1] +' '+ oS +' '+ 0 +')';
	oS+=stp;
	if(pI(L[n].top) < pI(L[n-1].top)+gHt[n-1]){
		setTimeout('MFXoS('+n+')',spd)
		}else{
			rng=0;
			wO=n-2;
			L[n-1].visibility=gV
		}
	}

function MFXcS(n){
	rng=1;
	for(i=n; i < L.length; i+=2){
		L[i].top=pI(L[i].top)-stp}nn?L[n-1].clip.height=cS:L[n-1].clip= 'rect('+0+' '+gW[n-1]+' '+cS+' '+0+')';
		cS-=stp;
		if(pI(L[n].top) > pI(L[n-2].top)+gHt[n-2]){
			setTimeout('MFXcS('+n+')',spd)
			}else{
				nn?L[n-1].clip.height=cS:L[n-1].clip= 'rect('+0+' '+gW[n-1]+' '+0+' '+0+')';
				rng=0;	
				wO=-1;
				if(wait!=-1)MFXrM(wait);
				L[n-1].visibility=gH;wait=-1
			}
		}
function pI(n){
	return parseInt(n)
	}

function MFXrSR(){
	var sr=document.location.search;
	if(sr!=''){sr = sr.replace(/\?/,'').split('&');
		for(var i=0;i<sr.length;i++){
			sr[i]=sr[i].split('=');
			if(sr[i][0]=='mfxsr'){MFXrM(pI(sr[i][1]))}
		}
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}