str = "Ediciones encuentro ";
blnk = " ";
str += blnk;
mcnt = 0;
msg = "";
stcnt=0;

function wiper()
{
   stcnt++;
   if (stcnt>3)
      {
        stcnt = 0;
        msg += str.substring(mcnt,mcnt+1);
        mcnt++;
        if (mcnt >= str.length) { mcnt=0; msg=""; pausa(0); }
		else {
			csr = "_";
			if (stcnt & 1) csr ="_"; // Caracter para cursor...
			window.status = msg+csr;
			timeID = window.setTimeout("wiper()",20);
		}
      }
	else {
		csr = "_";
		if (stcnt & 1) csr ="_"; // Caracter para cursor...
		window.status = msg+csr;
		timeID = window.setTimeout("wiper()",20);
	}
}

function pausa(n)
{
	 stcnt++;
	 if (n==20) {
		csr = "_";
		if (stcnt & 1) csr ="_"; // Caracter para cursor...
		window.status = str+csr;
		timeID = window.setTimeout("wiper()",20);
	 }
	else {
		
		csr = "_";
		if (stcnt & 1) csr =" "; // Caracter para cursor...
		window.status = str +csr;
		n=n+1;
		timeID = window.setTimeout("pausa("+n+")",250);
	 }

}
//wiper();
/*
var message=""; 

function clickIE() {if (document.all) {(message);return false;}} 
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) { 
if (e.which==2||e.which==3) {(message);return false;}}} 
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} 
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} 

document.oncontextmenu=new Function("return false") 

*/


function ifn_cscripts_isValidRequiredFormField(inputVal) {
	inputStr = "" + inputVal;
	return eval(
		(inputStr.length != 0)
		&& (inputStr != "null")
		&& (inputStr != "undefined")
	)
	return true;
}
//.............................................................
function ifn_cscripts_checkEmailFormField(emailFormField) {

	if (!ifn_cscripts_isValidEmailFormField (emailFormField.value)) {
	  alert('Debe de introducir una dirección de email correcta.\nPuede contener letras, números, \".\", \"_\" y \"-\"');
	  emailFormField.focus();
	  return false;
	}
	return true;
}
//.............................................................
function ifn_cscripts_isValidEmailFormField (texto) {

	if (texto == '') return false;
	var ind = texto.indexOf('@');
	if (ind == -1) return false;

	var dominio = "";
	var subdominioRoot = "";
	var subdominioHost = "";
	var usuario = "";

	usuario = texto.substring(0,ind);
	if (!ifn_cscripts_isValid(usuario))	return false;

 	dominio = texto.substring(ind+1);
	if (!ifn_cscripts_isValid(dominio))	return false;

	var ind2 = dominio.lastIndexOf('.');
	if (ind2 == -1) return false;
	else {
		  subdominioHost = dominio.substring(0,ind2);
		  if (subdominioHost.length==0) return false;

		  subdominioRoot = dominio.substring(ind2+1);
		  if ((subdominioRoot.length <= 1) ||
			  (ifn_cscripts_isChar(subdominioRoot) == false))	return false
	}

	return true;
}
//.............................................................
function ifn_cscripts_isValid(inputVal) {
	inputStr = "" + inputVal;
	return eval(
		(inputStr.length != 0)
		&& (inputStr != "null")
		&& (inputStr != "undefined")
	)
	return true;
}
//.............................................................
function ifn_cscripts_isNum(inputVal) {
	// Retorna True si la cadena contiene sÃ³lo nÃºmeros positivos
	inputStr = "" + inputVal;
	return (!isNaN(inputStr))
}
//.............................................................
function ifn_cscripts_isChar (Cadena) {
// Retorna True si la cadena contiene sÃ³lo letras
var inputStr = "" + Cadena;
var result = false;
var abc ="abcdefghijklmnopqrstuvwxyz"
	for (var i=0; i < inputStr.length; i++) {
		var oneChar = inputStr.charAt (i);
		result = false;
		for (var j = 0; j < abc.length; j++)
			if (oneChar ==  abc.charAt (j) || oneChar == (abc.charAt (j)).toUpperCase()) {
				result = true;
			}
		if (result == false)
			break;
	}
	return result;
}

function minusculas(nombreform,campo)
{
	if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
			form = eval("document."+nombreform);
		}
		else {
			form = document.forms[""+nombreform+""];
		}
		
		var cadena;
		cadena = eval("form."+campo+".value");
		cadena = cadena.toLowerCase();
		eval('form.'+campo+'.value=cadena');

}
function seguro(ruta) {

	if (confirm("¿Estás seguro?")) {
		location.href=ruta;
		
	}

}

function seguro_bool() {

	if (confirm("¿Estás seguro de esta acción?")) {

		return true;
	} else { return false; }

}


function redirect(ruta) {

	location.href=ruta;

}

function mostrar(idlibro) {
//var idlibro = "Menu_"+id;


	document.getElementById(idlibro).style.visibility='visible';
	document.getElementById(idlibro).style.display='block';
}

function ocultar(idlibro) {
//var idlibro = "Menu_"+id;

		document.getElementById(idlibro).style.visibility='hidden';
		document.getElementById(idlibro).style.display='none';

}
function mostrarsindisplay(idlibro) {
//var idlibro = "Menu_"+id;


	document.getElementById(idlibro).style.visibility='visible';
//	document.getElementById(idlibro).style.display='block';
}

function ocultarsindisplay(idlibro) {
//var idlibro = "Menu_"+id;

		document.getElementById(idlibro).style.visibility='hidden';
//		document.getElementById(idlibro).style.display='none';

}
function position(event,capa){


	var x = event.clientX;
	var y = event.clientY;
	

	
	document.getElementById(capa).style.top=y + 0+"px";
	document.getElementById(capa).style.left=x + 30 +"px";

	
}

function positionfija(x,y,capa){


	document.getElementById(capa).style.top=y + 0+"px";
	document.getElementById(capa).style.left=x + 30 +"px";

	
}
/*
function mostrar (div)
{
var div1= div+"_1";
var div2= div+"_2";

	divobj = document.getElementById(div1);
	divobj.style.display = 'none';	
	divobj = document.getElementById(div2);
	divobj.style.display = 'block';	
}

function ocultar (div)
{
var div1= div+"_1";
var div2= div+"_2";

	divobj = document.getElementById(div1);
	divobj.style.display = 'block';	
	divobj = document.getElementById(div2);
	divobj.style.display = 'none';	


}
*/
function checkarea(limite) {
  				void(d=document);
  				void(el=d.getElementsByTagName('TEXTAREA'));
  				resul=0;
   
  				for(i=0;i<el.length;i++) {

						if  ( el[i].value.length > limite ) {

								resul=el[i].value.length;
								break;
						}
						else { resul = limite; }
					}
					return resul;

};


var estamos = "";
var ir="";
var semaforo=0;
function blind (vamos)
{
	if ((estamos != vamos) && (semaforo ==0))  {
		semaforo=1;
		if ( estamos !="" ) {
			Effect.Fade(estamos);
			document.getElementById(estamos).style.visibility='hidden';	
			document.getElementById(estamos).style.display='none';				}
		
		document.getElementById(vamos).style.visibility='visible';
		Effect.BlindDown(vamos);
		estamos = vamos;
		ir=vamos;
		
	}
	semaforo = 0;
};

var loop_noticias = true;
var contador = 0;
function StartNoticias(){ 

var speed=1;

if (I2.document.body.scrollHeight >0 ) {
	if  (loop_noticias ){
		I2.scrollBy(0,speed) ;
		contador = contador + speed;
		if (contador >= I2.document.body.scrollHeight ) {
			contador = 0;
			I2.scrollBy(0,-parseInt(I2.document.body.scrollHeight)) ;
			StartNoticias();
		} else {
		timeID = window.setTimeout("StartNoticias()",50);
		}
		}
	} else {
		if (contador == 0) {
				contador = 1;
			timeID = window.setTimeout("StartNoticias()",1000);
		}
	}
	
	
} 

function stopNoticias() {
	 loop_noticias = false;
}

function sigueNoticias() {
	loop_noticias = true; 
		StartNoticias();
}

var loop = true;
var despl = 0;

function PerformScroll(speed){ 
	if(loop){

		//loop=true; 

		if ( (( despl + 400 < I1.document.body.scrollWidth ) && ( despl  + speed >= 0 ) ) ||  (  ( despl + 400 >= I1.document.body.scrollWidth )         &&   ( speed < 0   )         )) {
		despl = despl + speed;
		I1.scrollBy(speed,0) ;
		timeID = window.setTimeout("PerformScroll("+speed+")",50);
		//lse objScroller.up(speed) 
		
		I1.posocionscrollI1(speed);
		} else {
			  if (despl < 0) { despl = 0;}
			 
		}
	} 
}  
 
function StopScroll(){ 
    loop=false ;
    //if(timer) clearTimeout(timer) 
} 

function reSize()
{

	
	var  control_iframe;
	var oFrame = new Array();
	var oBody = new Array();
	
	
	try{	
		for ( i =2; i<=5 ;i++) {
		
		control_iframe =eval ( "iframe"+i);
		

		if ( control_iframe == 1 ) {

			oFrame[i] = document.getElementById('I'+i);
			
			oBody[i]	=	eval("I"+i+".document.body");
			oFrame[i].style.height = oBody[i].scrollHeight+"px" ;		

		}		

		}
	}
	catch(e)
	{
		window.status =	'Error: ' + e.number + '; ' + e.description;
	}
	
}


var control_acciones = 0;
function menuacciones ()
{
		if ( control_acciones == 0) {
			Effect.SlideLeft('acciones');
			control_acciones = 2;
			timeID = window.setTimeout("control_acciones=1",1000);
		
		}
		if ( control_acciones == 1) {
		
		Effect.SlideRight('acciones');
				control_acciones = 2;
			timeID = window.setTimeout("control_acciones=0",1000);
				
		}		
}

function replace(texto,s1,s2){
	return texto.split(s1).join(s2);
}
// --> 