<!--

///9////////////////////////////
///menu de arriba///////
function MM_nbGroup(event, grpName) { //v3.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    if ((nbArr = document[grpName]) != null)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = args[i+1];
      nbArr[nbArr.length] = img;
  } }
 
}



///10////////////////////////////
///menu de la izquierda (desplegables)///////
function MFXinitMenu(){
	IE = document.all ? 1:0;
	NN = document.layers ? 1:0;
	HIDDEN = (NN) ? 'hide' : 'hidden';
	VISIBLE = (NN) ? 'show' : 'visible';
	myLayer=new Array();
	mySpeed=5;
	subLeft=0;
	closes=true;
if (NN || IE) {
	myLayer[0]=(NN) ? document.MFX0 : document.all.MFX0.style;
	myLayer[1]=(NN) ? document.MFX1 : document.all.MFX1.style;
	myLayer[2]=(NN) ? document.MFX2 : document.all.MFX2.style;
	myLayer[3]=(NN) ? document.MFX3 : document.all.MFX3.style;
	myLayer[4]=(NN) ? document.MFX4 : document.all.MFX4.style;
	myLayer[5]=(NN) ? document.MFX5 : document.all.MFX5.style;
	myLayer[6]=(NN) ? document.MFX6 : document.all.MFX6.style;
	myLayer[7]=(NN) ? document.MFX7 : document.all.MFX7.style;
	myLayer[8]=(NN) ? document.MFX8 : document.all.MFX8.style;
	myLayer[9]=(NN) ? document.MFX9 : document.all.MFX9.style;
	myLayer[10]=(NN) ? document.MFX10 : document.all.MFX10.style;
	myLayer[11]=(NN) ? document.MFX11 : document.all.MFX11.style;
	myLayer[12]=(NN) ? document.MFX12 : document.all.MFX12.style;
	myLayer[13]=(NN) ? document.MFX13 : document.all.MFX13.style;
	myLayer[16]=(NN) ? document.MFX14 : document.all.MFX14.style;
	myLayer[15]=(NN) ? document.MFX15 : document.all.MFX15.style;
	myLayer[14]=(NN) ? document.MFX16 : document.all.MFX16.style;
	myLayer[17]=(NN) ? document.MFX17 : document.all.MFX17.style;
	myLayer[18]=(NN) ? document.MFX18 : document.all.MFX18.style;
} else {
	myLayer[0]= document.getElementById("MFX0").style;
	myLayer[1]= document.getElementById("MFX1").style;
	myLayer[2]= document.getElementById("MFX2").style;
	myLayer[3]= document.getElementById("MFX3").style;
	myLayer[4]= document.getElementById("MFX4").style;
	myLayer[5]= document.getElementById("MFX5").style;
	myLayer[6]= document.getElementById("MFX6").style;
	myLayer[7]= document.getElementById("MFX7").style;
	myLayer[8]= document.getElementById("MFX8").style;
	myLayer[9]= document.getElementById("MFX9").style;
	myLayer[10]= document.getElementById("MFX10").style;
	myLayer[11]= document.getElementById("MFX11").style;
	myLayer[12]= document.getElementById("MFX12").style;
	myLayer[13]= document.getElementById("MFX13").style;
	myLayer[16]= document.getElementById("MFX14").style;
	myLayer[15]= document.getElementById("MFX15").style;
	myLayer[14]= document.getElementById("MFX16").style;
	myLayer[17]= document.getElementById("MFX17").style;
	myLayer[18]= document.getElementById("MFX18").style;
}
	running=false;
	whichOpen=-1;
	lastMain=myLayer.length-2;
	MFXmain=new Array();
	for(i=0; i<myLayer.length; i++){
		mainORsub= i % 2;
		MFXmain[i] = mainORsub ? 0:1;
	}
	myTop=new Array();
	myLeft=new Array();
	myHeight=new Array();
	myWidth=new Array();
	mySlide=new Array();
	for(i=0; i<myLayer.length; i++){
		if((!IE)&&MFXmain[i]){
			if(i==0){
				myTop[i]=parseInt(myLayer[i].top);
				myLeft[i]=myLayer[i].left;
			} else {
				myLeft[i]=myLeft[i-2];
				myTop[i]=myTop[i-2]+myHeight[i-2];
			}
			if (NN) {
			    myHeight[i]=myLayer[i].clip.height;
				myWidth[i]=myLayer[i].clip.width;
			} else {
			    myHeight[i]=parseInt(myLayer[i].height);
				myWidth[i]=parseInt(myLayer[i].width);
			}
			myLayer[i].left=myLeft[i];
			myLayer[i].top=myTop[i];
			myLayer[i].visibility=VISIBLE;
		}
		if((!IE)&&!MFXmain[i]){
			myTop[i]=myTop[i-1]+myHeight[i-1];
			myLeft[i]=myLeft[i-1];
			if (NN) {
				myHeight[i]=myLayer[i].clip.height;
				myWidth[i]=myLayer[i].clip.width;
			} else {
				myHeight[i]=parseInt(myLayer[i].height);
				myWidth[i]=parseInt(myLayer[i].width);
			}
			mySlide[i]=myTop[i]+myHeight[i];
			myLayer[i].left=myLeft[i]+subLeft;
			myLayer[i].top=myTop[i];
		}
		if((IE)&&MFXmain[i]){
			if(i==0){
				myLeft[i]=myLayer[i].pixelLeft;
				myTop[i]=myLayer[i].pixelTop;
			}else{
				myLeft[i]=myLeft[i-2];
				myTop[i]=myTop[i-2]+myHeight[i-2];
			}
			myHeight[i]=myLayer[i].pixelHeight;
			myWidth[i]=myLayer[i].pixelWidth;
			myLayer[i].left=myLeft[i];
			myLayer[i].top=myTop[i];
			myLayer[i].visibility=VISIBLE;
		}
		if((IE)&&!MFXmain[i]){
				myTop[i]=myTop[i-1]+myHeight[i-1];
				myLeft[i]=myLeft[i-1];
				myHeight[i]=myLayer[i].pixelHeight;
				myWidth[i]=myLayer[i].pixelWidth;
				myLayer[i].pixelLeft=myLeft[i]+subLeft;
				myLayer[i].pixelTop=myTop[i];
				mySlide[i]=myTop[i]+myHeight[i];
		}
	}
}
//----------------------------

function MFXrunMenu(myName,newspeed){
ieStep=0;
thereS=false;
thereC=false;
if(newspeed>0){mySpeed=newspeed;}
first=myName;
if(whichOpen==-1&&!running&&MFXmain[myName]&&!(whichOpen==myName)){
running=true;
if(NN){
	myLayer[myName+1].clip.height=0;
} else if(IE){
	myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ (0) +" "+ ("auto") +")";
} else {
	myLayer[myName+1].height=0;
}
myLayer[myName+1].visibility=VISIBLE;
MFXopenMenuS(myName);
MFXopenMenuC(myName);
}
if(whichOpen>=0&&!running&&!(whichOpen==myName)){
	running=true;
	second=whichOpen;
	ieStep1=myHeight[second+1];
	thereCS=false;
	thereCC=false;
	MFXcloseMenuS(second);
	MFXcloseMenuC(second);
}
if(whichOpen>=0&&!running&&whichOpen==myName&&closes){
	running=true;
	second=whichOpen;
	ieStep1=myHeight[second+1];
	thereCS=false;
	thereCC=false;
	MFXcloseMenuS(second);
	MFXcloseMenuC(second);
	}

}

function MFXstopCloseS(myName){
	running=false;
	thereCS=true;
	if(closes&&first==whichOpen){whichOpen=-1;}
	else{whichOpen=-1;
	MFXrunMenu(first);
	}
}

function MFXstopOpenS(myName){
	running=false;
	thereS=true;
	if(IE){myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ ("auto") +" "+ ("auto") +")";}
	whichOpen=myName;
}

function MFXopenMenuS(myName){
	myStep=mySpeed;
	if((!IE)&&!thereS&&!(first==lastMain)){
		if(parseInt(myLayer[first+2].top)+myStep>mySlide[first+1]){
		myStep=mySlide[first+1]-parseInt(myLayer[first+2].top);
		}
		for(i=first+2; i<myLayer.length; i+=2){
			myLayer[i].top= parseInt(myLayer[i].top) + myStep;
		}
		if(parseInt(myLayer[first+2].top)==mySlide[first+1]){
			MFXstopOpenS(first)
		}
		if(running)setTimeout('MFXopenMenuS(first)',10);
	}
	if(IE&&!thereS&&!(first==lastMain)){
		if(myLayer[first+2].pixelTop+myStep>mySlide[first+1]){
			myStep=mySlide[first+1]-myLayer[first+2].pixelTop;
		}
		for(i=first+2; i<myLayer.length; i+=2){
			myLayer[i].pixelTop+=myStep;
		}
		if(myLayer[first+2].pixelTop==mySlide[first+1]){
			MFXstopOpenS(first)
		}
		if(running)setTimeout('MFXopenMenuS(first)',10);
		else {
			if (document.all.divMenuTerra) document.all.divMenuTerra.style.height=myLayer[18].pixelTop + parseInt(myLayer[18].width);
		}
	}
}


function MFXopenMenuC(myName){
	myStep=mySpeed;
	if (thereC) return;
	if(NN&&!thereC){
		if ((myLayer[first+1].clip.height+myStep)>myHeight[first+1]){
			myLayer[first+1].clip.height=myHeight[first+1]
		}
		if(myLayer[first+1].clip.height==myHeight[first+1]){
			thereC=true;
			whichOpen=first;
			MFXstopOpenS(first);
		}else{
			myLayer[first+1].clip.height+=myStep;
		}
		if(running)setTimeout('MFXopenMenuC(first)',10);
	}
	if((!NN)&&!thereC){
		ieStep+=myStep;
		myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ (ieStep) +" "+ ("auto") +")";

		if(ieStep>=myHeight[first+1]){
			thereC=true;
			whichOpen=first;
			MFXstopOpenS(first)
		}
		if(running)setTimeout('MFXopenMenuC(first)',10);
	}
}

function MFXcloseMenuS(myName){
	myStep=mySpeed;
	if((!IE)&&!thereCS&&!(second==lastMain)){
		if(parseInt(myLayer[second+2].top)-myStep<myTop[second+2]){
			myStep=parseInt(myLayer[second+2].top)-myTop[second+2];
		}
		for(i=second+2; i<myLayer.length; i+=2){
			myLayer[i].top = parseInt(myLayer[i].top) - myStep;
		}
		if(parseInt(myLayer[second+2].top)==myTop[second+2]){
			MFXstopCloseS(second);
		}
		if(running)setTimeout('MFXcloseMenuS(second)',10);
	}
	if((IE)&&!thereCS&&!(second==lastMain)){
		if(myLayer[second+2].pixelTop-myStep<myTop[second+2]){
			myStep=myLayer[second+2].pixelTop-myTop[second+2];
		}
		for(i=second+2; i<myLayer.length; i+=2){
			myLayer[i].pixelTop-=myStep;
		}
		if(myLayer[second+2].pixelTop==myTop[second+2]){
			MFXstopCloseS(second);
		}
		if(running)setTimeout('MFXcloseMenuS(second)',10);
		else {
			if (document.all.divMenuTerra) document.all.divMenuTerra.style.height=myLayer[18].pixelTop + parseInt(myLayer[18].width);
		}
	}
}

function MFXcloseMenuC(myName){
	myStep=-mySpeed;
	ieStep1-=mySpeed;
	if(NN&&!thereCC){
		if ((myLayer[second+1].clip.bottom+myStep)<0){
			myLayer[second+1].clip.bottom=0;
		}
		if(myLayer[second+1].clip.bottom==0){
			thereCC=true;
			if(second==lastMain)MFXstopCloseS(second);
		}else{
			myLayer[second+1].clip.bottom+=myStep;
		}
		if(running)setTimeout('MFXcloseMenuC(second)',10);
	}
	if((!NN)&&!thereCC){
		if(ieStep1<=0){
			myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ (0) +" "+ ("auto") +")";
			thereCC=true;
			if(second==lastMain)MFXstopCloseS(second);
		} else {
		myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ (ieStep1) +" "+ ("auto") +")";
		}
		if(running)setTimeout('MFXcloseMenuC(second)',10);
	}
}


///12////////////////////////////
///salto a otra p‡gina///////
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

 
var speed=50 
 
var loop, timer 

var initialised; 

function comprobarUrl(url)
{
	if (!isWhitespace(url.value)){
		if(url.value.indexOf(".")==-1){
			warnInvalid(url,"La URL asociada no tiene extensión. Por favor, indíquela.");
			return false;
		}
		else{
			var valorUrl = url.value;
			var indice = valorUrl.lastIndexOf(".");
			var terminos = valorUrl.split(".");
			var extension = valorUrl.substring(indice+1,valorUrl.length);		
			
			if(terminos.length<3){
				warnInvalid(url,"Por favor, indique la URL asociada según el formato www.direccion.extension.");
				return false;
			}
			else{
				if(terminos[0].toUpperCase()!="WWW"){
					warnInvalid(url,"La URL asociada debe comenzar por 'www'.");
					return false;
				}
				if(extension.length!=2 && extension.length!=3){
					warnInvalid(url,"No se puede introducir una URL sin especificar la dirección según el formato www.direccion.extension.");
					return false;
				}
				if(valorUrl.substring(0,indice).length==0){
					warnInvalid(url,"La extensión de la URL asociada es incorrecta. Por favor verifíquela e intentelo de nuevo.");
					return false;
				}
			}
		}
	}
	
	return true;
}



function isInteger2(q)
{   
	var s = quitaEspacios(q.value);
	for (var i=1; i < s.length; i++)
	{
 					var c = s.charAt(i);
 					if (!isDigit(c))  return false;
	}
		
	document.f.codigoRef.value=s.substring(1,s.length);
	var codigo=quitaEspacios(document.f.codigoRef.value);
	if(codigo=="") return false;
		
	 return true;
}

function openLink(){
	var browser = navigator.appName;
	var pagina = "";

	if(browser == "Netscape"){
		if(document.formBanner.fbanner.value!="vacio"){
			pagina = "http://" + document.formBanner.fbanner.value;	
			window.open(pagina);
		}
	}
	else{
		if(document.all["formBanner"].fbanner.value!="vacio"){
			pagina = "http://" + document.all["formBanner"].fbanner.value;
			document.formBanner.action = pagina;
			document.formBanner.submit();
		}
	}

}


//-->

