	

	var timed = 0;
	var scrollGo = false;
	var delay=100;
	var space=100;
	
	
	scroll_start();
	

function OpenQualia() { 
  window.open("http://www.qualiasolutions.com");
}
function OpenEncuesta()
{
		var x = window.open('Encuestas/Default.aspx', 'Encuesta','width=500, height=500,top=100,left=100,scrollbars=2,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1');
		x.focus();
}
function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}
function esfecha(fec){
	var fecha2=fec.value;
	if(fecha2=="")
	    return (0);
	else{
            if (fecha2.split("/").length!=3) {

                        if (fecha2.split("-").length!=3)
			{
				
				alert("Fecha incorrecta.");							
				document.Form1.reset();
				return(0);
			}
                        else 
				var fecha=fecha2.split("-");

            }

            else 
		var fecha=fecha2.split("/");

            dia = parseInt(fecha[0]);
            mes = parseInt(fecha[1]);
            ano = parseInt(fecha[2]);

            if (isNaN(dia) || dia<1 || dia>31){
				alert('Fecha incorrecta.'); 
				document.Form1.reset();							
				return(0);
			}

            if (isNaN(mes) || mes<1 || mes>12) {
				alert('Fecha incorrecta.');
				document.Form1.reset();
				return(0);
		}

            if (isNaN(ano) || ano<1 || ano>9999){
				alert('Fecha incorrecta.');
				document.Form1.reset();
				return(0);
			}

 

            if ((mes==4 || mes==6 || mes==9 || mes==11) && dia==31){
				alert('Fecha incorrecta.');
				document.Form1.reset();
				return(0);
			}

 

            if (mes==2){

                        if (dia>29)
			{
				alert('Fecha incorrecta.');
				document.Form1.reset();
				return(0);
			}

                        if (dia==29 && ((ano/4)!=parseInt(ano/4,10))) 					{
				alert('Fecha incorrecta.');
				document.Form1.reset();
				return(0);
			}

            }
	}

}

function NoticiaLeerMas(IdNoticia) 
{
	var x = window.open('NoticiaLeerMas.aspx?Id=' + IdNoticia, 'NoticiaLeerMas','width=610, height=500,top=100,left=100,scrollbars=1,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0');
	x.focus();
}
function Cambio()
{
if(document.getElementById('Otras').checked==true)
	if(document.getElementById('caja').value=="")
	{
		alert('Rellene la cantidad.');
	}
	else
	{
	
		if(isNaN(document.getElementById('caja').value))
		{
			alert("Solo se admiten valores enteros (p.e. 100)");
			document.getElementById('caja').value="";
		}
		else
		{
			document.getElementById('Otras').value=document.getElementById('caja').value;
			document.Form1.submit();
		}
	}
else
	document.Form1.submit();
}




	function scroll_start() {
	
	var i=0;
	
	msg="PORTAL     EL    REFUGIO    -    ANTES    DE    COMPRARLO    PIENSA    EN    ADOPTARLO    ";
	
	for (i=0;i<space;i++)
	
	msg=" "+msg;
	
	scrollGo=true;
	
	timerid=window.setTimeout("scrollmsg(0)",delay);
}



function scrollmsg(pos) {

	var out = "";
	
	scrollGo=false;
	
	if (pos < msg.length)
	
	self.status = msg.substring(pos, msg.length);
	
	else
	
	pos=-1;
	
	++pos;
	
	scrollGo=true;
	
	timerid=window.setTimeout("scrollmsg("+pos+")",delay);

}





