function anadir_tooltip(texto,esto,camino){
t=texto
texto=document.getElementById("enlace"+texto)
if(!texto.primero){texto.primero=texto.innerHTML}
if(isNaN(texto.ensenar)){texto.ensenar=-1}
var pepe=texto.ensenar
pepe=pepe*-1
texto.ensenar=pepe
if (texto.ensenar==1){
	esto.innerHTML='<img class="img_tk1" src="'+ camino +'/au_gn_up.gif">';
	texto.innerHTML=texto.innerHTML+"<blockquote class='tooltip'>"+explicacion[t]+"</blockquote>"
}
if (texto.ensenar==-1){
	texto.innerHTML=texto.primero
}
}

function anadir_bloque(texto,esto,camino){
t=texto
texto=document.getElementById("enlace"+texto)
if(!texto.primero){texto.primero=texto.innerHTML}
if(isNaN(texto.ensenar)){texto.ensenar=-1}
var pepe=texto.ensenar
pepe=pepe*-1
texto.ensenar=pepe
if (texto.ensenar==1){
	esto.innerHTML='<img class="img_tk1" src="'+ camino +'au_gn_up.gif">';
	texto.innerHTML=texto.innerHTML+"<blockquote class='block_grande'>"+explicacion[t]+"</blockquote>"
}
if (texto.ensenar==-1){
	texto.innerHTML=texto.primero
}
}

function anadir_bloque_flecha(texto,esto,bloque,camino){
t=texto
texto=document.getElementById("enlace"+texto)
if(!texto.primero){texto.primero=texto.innerHTML}
if(isNaN(texto.ensenar)){texto.ensenar=-1}
var pepe=texto.ensenar
pepe=pepe*-1
texto.ensenar=pepe
if (texto.ensenar==1){
	esto.innerHTML='<img class="img_tk1" src="'+ camino +'au_gn_flecha_azul.jpg" align="top">';
	texto.innerHTML=texto.innerHTML+"<blockquote class='"+ bloque +"'>"+explicacion[t]+"</blockquote>"
}
if (texto.ensenar==-1){
	texto.innerHTML=texto.primero
}
}

function pinta_tooltip(texto, tipo, vinetas, camino){
	for (w=0;w<texto.length;w++){
		if (vinetas) {
			document.writeln('<div id="enlace'+w+'" class="'+tipo+'"><LI><B>'+texto[w]+'</B><a onfocus="blur()" href="#" onclick="anadir_tooltip('+w+',this,\''+camino+'\')"><img class="img_tk1" src="'+ camino +'au_gn_down.gif"></a></div>');
		} else {
			document.writeln('<div id="enlace'+w+'" class="'+tipo+'"><B>'+texto[w]+'</B><a onfocus="blur()" href="#" onclick="anadir_tooltip('+w+',this,\''+camino+'\')"><img class="img_tk1" src="'+ camino +'au_gn_down.gif"></a></div>');
		}
	}
}

function pinta_bloque(texto, tipo, camino){
	for (w=0;w<texto.length;w++){
	document.writeln('<div id="enlace'+w+'" class="'+tipo+'"><B>'+texto[w]+'</B><a onfocus="blur()" href="#" onclick="anadir_bloque('+w+',this,\''+camino+'\')"><img class="img_tk1" src="'+ camino +'au_gn_down.gif"></a></div>');
	}
}

function pinta_bloque_flecha(texto, tipo, bloque, camino){
	for (w=0;w<texto.length;w++){
	document.writeln('<div id="enlace'+w+'"><a onfocus="blur()" href="#" onclick="anadir_bloque_flecha('+w+',this,\''+bloque+'\',\''+camino+'\')"><img class="img_tk1" src="'+ camino +'au_gn_flecha_azul.jpg" align="top"></a>&nbsp;<font class="'+ tipo +'">'+texto[w]+'</font></div>');
	}
}

// ************** Funciones de Parpadeo de Texto ***********************************
function NormalinitArray() 
{
	for (var i = 0; i < NormalinitArray.arguments.length; i++) 
		{
			this[i] = NormalinitArray.arguments[i];
		}
	this.length = NormalinitArray.arguments.length;
}
var Normalcolors = new NormalinitArray(
"#003e68", // colores lanbide (azul)
"#ffffec" // amarillo (lanbide)
);
Normaldelay = 0.390000;
Normallink = 0;
function NormallinkDance() 
{
	Normallink = (Normallink+1)%Normalcolors.length;
    document.links("srctectextNormal").style.color = Normalcolors[Normallink];
	setTimeout("NormallinkDance()",Normaldelay*1000);
}
// ***********************************************************************************

// ****************** Marquesina de Noticias *****************************************

//Specify the marquee's width (in pixels)
var marqueewidth=500
//Specify the marquee's height
var marqueeheight=80
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=2
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1

marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
var actualheight=''
var cross_marquee, ns_marquee

function populate(){
	if (iedom){
		cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
		cross_marquee.style.top=marqueeheight+8
		cross_marquee.innerHTML=marqueecontent
		actualheight=cross_marquee.offsetHeight
	}
	else if (document.layers){
		ns_marquee=document.ns_marquee.document.ns_marquee2
		ns_marquee.top=marqueeheight+8
		ns_marquee.document.write(marqueecontent)
		ns_marquee.document.close()
		actualheight=ns_marquee.document.height
	}
	lefttime=setInterval("scrollmarquee()",50)
}

function scrollmarquee(){
	if (iedom){
		if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
		cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed
		else
		cross_marquee.style.top=marqueeheight+8
	}
	else if (document.layers){
		if (ns_marquee.top>(actualheight*(-1)+8))
		ns_marquee.top-=copyspeed
		else
		ns_marquee.top=marqueeheight+8
	}
}

// ***********************************************************************************

// ****************** Evaluación de Test *****************************************

function evaluar() {

	var suma = 0;

	// Calcular resultado.
	for (var i = 0; i < document.thisForm.elements.length; i++) {
		if (document.thisForm.elements[i].type=="radio" && document.thisForm.elements[i].checked == true) {
			suma = suma + Number(document.thisForm.elements[i].value);
		}
	}
	document.all["resul"].innerHTML = "<B>PUNTUACIÓN TOTAL: "+ suma +"</B>"
	document.all["K1"].style.visibility = "hidden";
	document.all["K1"].style.display = "none";
	document.all["K2"].style.visibility = "visible";
	document.all["K2"].style.display = "block";

}

// ***********************************************************************************

// *************** Validacion de Fechas ********************

   function esDigito(sChr){
    var sCod = sChr.charCodeAt(0);
    return ((sCod > 47) && (sCod < 58));
   }

   function valSep(oTxt){
    var bOk = false;
    var sep1 = oTxt.value.charAt(2);
    var sep2 = oTxt.value.charAt(5);
    bOk = bOk || ((sep1 == "-") && (sep2 == "-"));
    bOk = bOk || ((sep1 == "/") && (sep2 == "/"));
    return bOk;
   }

   function finMes(oTxt){
    var nMes = parseInt(oTxt.value.substr(3, 2), 10);
    var nAno = parseInt(oTxt.value.substr(6), 10);
    var nRes = 0;
    switch (nMes){
     case 1: nRes = 31; break;
     case 2: nRes = 28; break;
     case 3: nRes = 31; break;
     case 4: nRes = 30; break;
     case 5: nRes = 31; break;
     case 6: nRes = 30; break;
     case 7: nRes = 31; break;
     case 8: nRes = 31; break;
     case 9: nRes = 30; break;
     case 10: nRes = 31; break;
     case 11: nRes = 30; break;
     case 12: nRes = 31; break;
    }
    return nRes + (((nMes == 2) && (nAno % 4) == 0)? 1: 0);
   }

   function valDia(oTxt){
    var bOk = false;
    var nDia = parseInt(oTxt.value.substr(0, 2), 10);
    bOk = bOk || ((nDia >= 1) && (nDia <= finMes(oTxt)));
    return bOk;
   }

   function valMes(oTxt){
    var bOk = false;
    var nMes = parseInt(oTxt.value.substr(3, 2), 10);
    bOk = bOk || ((nMes >= 1) && (nMes <= 12));
    return bOk;
   }

   function valAno(oTxt){
    var bOk = true;
    var nAno = oTxt.value.substr(6);
    bOk = bOk && ((nAno.length == 4));
    if (bOk){
     for (var i = 0; i < nAno.length; i++){
      bOk = bOk && esDigito(nAno.charAt(i));
     }
    }
    return bOk;
   }

   function valFecha(oTxt){
    var bOk = true;
    if (oTxt.value != ""){
     bOk = bOk && (valAno(oTxt));
     bOk = bOk && (valMes(oTxt));
     bOk = bOk && (valDia(oTxt));
     bOk = bOk && (valSep(oTxt));
     if (!bOk){
      oTxt.focus();
	  return false;
     } else return true;
    }
   }



// *********************************************************
