//ABRIR VENTANA FOTO
function msg()
{
window.alert('Página temporalmente desactivada.')
}


function Ver2(ID)
{ventana=window.open("foto.asp?id="+ID,"window","toolbars=0,scrollbars=1,location=0,statusbars=0,menubars=0,resizable=0,width=10,height=10,left=100,top=75");
  ventana.moveTo(((screen.width/2)-(175)),((screen.height/2)-(150)));
}


//ABRIR VENTANA
function Win(URL,ancho,alto) {
if (ancho==null){
	ancho=350;
	alto=300;
}
if (scroll==null){
scroll=1
}
ventana=window.open(URL,"Win","toolbars=0,scrollbars="+scroll+",location=0,statusbars=0,menubars=0,resizable=0,width="+ancho+",height="+alto+",left=185,top=320");
}


//ABRIR VENTANA
function popup() {
window.open("popup.asp","Win","toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=410,height=230,left=185,top=120");
}


//ABRIR VENTANA FOTO

function Ver(ID)
{ventana=window.open("jugador.asp?id="+ID,"Win","toolbars=0,scrollbars=1,location=0,statusbars=0,menubars=0,resizable=0,width=300,height=300,left=100,top=75");
  ventana.moveTo(((screen.width/2)-(175)),((screen.height/2)-(150)));
}



//ENLACE QUE CIERRA VENTANA
function get(url) {
  opener.location = url;
  self.close()
}

//ADAPTA VENTANA A FOTO
function resizePage(){
  x=document.images['foto'].width;
  y=document.images['foto'].height;
  x=x+40;
  y=y+90; 
  window.resizeTo(x,y);
}

function confirma(URL)
{
var respuesta=confirm("¿El registro se borrará, está seguro?");
if (respuesta==true)
setTimeout("location.href='"+URL+"'",00000);
}

// Esta función permitirá validar la fecha
function fechas(caja)
{ 
   if (caja)
   {  
      borrar = caja;
      if ((caja.substr(2,1) == "/") && (caja.substr(5,1) == "/"))
      {      
         for (i=0; i<10; i++)
	     {	
            if (((caja.substr(i,1)<"0") || (caja.substr(i,1)>"9")) && (i != 2) && (i != 5))
			{
               borrar = '';
               break;  
			}  
         }
	     if (borrar)
	     { 
	        a = caja.substr(6,4);
		    m = caja.substr(3,2);
		    d = caja.substr(0,2);
		    if((a < 1900) || (a > 2050) || (m < 1) || (m > 12) || (d < 1) || (d > 31))
		       borrar = '';
		    else
		    {
		       if((a%4 != 0) && (m == 2) && (d > 28))	   
		          borrar = ''; // Año no bisiesto, es febrero y el dia es mayor a 28.
			   else	
			   {
		          if ((((m == 4) || (m == 6) || (m == 9) || (m==11)) && (d>30)) || ((m==2) && (d>29)))
			         borrar = '';	      				  	 
			   }  // else
		    } // fin else
         } // if (error)
      } // if ((caja.substr(2,1) == "/") && (caja.substr(5,1) == "/"))			    			
	  else
	     borrar = '';
	  if (borrar == '')
	     alert('Fecha errónea, escríbala de nuevo.');
   } // if (caja)   
} // FUNCION