function abrirListadoFotos(pEntidad,pIdExterno){ 

    if( pIdExterno != -1){     
        var ancho = 750;
        var alto = 550;
        var posY = ((screen.availHeight - alto)/2);
        //posY = 3
        var posX = ((screen.availWidth - ancho)/2);
        //posX = 0

        var ruta = '/racingclubferrol/fotos/listadoFotos.jsp';
        var parametros = '?entidad=' + pEntidad + '&idExterno=' + pIdExterno;
        window.open(ruta + parametros,'GaleriaFotografica','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + ancho + ',height=' + alto + ',left=' + posX + ',top=' + posY );                
    }
    else{
        alert('Non Existe Unha Galeria de Fotos');
    }                          

}       

function abrirListadoFotosPrivada(pEntidad,pIdExterno){ 

    if( pIdExterno != -1){     
        var ancho = 750;
        var alto = 550;
        var posY = ((screen.availHeight - alto)/2);
        //posY = 3
        var posX = ((screen.availWidth - ancho)/2);
        //posX = 0

        var ruta = '/racingclubferrol/privada/fotos/listadoEditableFotos.jsp';
        var parametros = '?entidad=' + pEntidad + '&idExterno=' + pIdExterno;
        window.open(ruta + parametros,'GaleriaFotografica','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + ancho + ',height=' + alto + ',left=' + posX + ',top=' + posY );                
    }
    else{
        alert('Para Engadir Fotos Debes Gardar Primeiro os Datos de ' + pEntidad);
    }                          

}   

function abrirListadoArquivos(pEntidad,pIdExterno){ 

    if( pIdExterno != -1){     
        var ancho = 710;
        var alto = 550;
        var posY = ((screen.availHeight - alto)/2);
        //posY = 3
        var posX = ((screen.availWidth - ancho)/2);
        //posX = 0

        var ruta = '/racingclubferrol/arquivos/listadoArquivos.jsp';
        var parametros = '?entidad=' + pEntidad + '&idExterno=' + pIdExterno;
        window.open(ruta + parametros,'ListadoArquivos','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + ancho + ',height=' + alto + ',left=' + posX + ',top=' + posY );                
    }
    else{
        alert('Para Engadir Arquivos Debes Gardar Primeiro os Datos de ' + pEntidad);
    }                          
}

function abrirListadoArquivosPrivado(pEntidad,pIdExterno){ 

    if( pIdExterno != -1){     
        var ancho = 710;
        var alto = 550;
        var posY = ((screen.availHeight - alto)/2);
        //posY = 3
        var posX = ((screen.availWidth - ancho)/2);
        //posX = 0

        var ruta = '/racingclubferrol/privada/arquivos/listadoEditableArquivos.jsp';
        var parametros = '?entidad=' + pEntidad + '&idExterno=' + pIdExterno;
        window.open(ruta + parametros,'ListadoArquivos','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=' + ancho + ',height=' + alto + ',left=' + posX + ',top=' + posY );                
    }
    else{
        alert('Para Engadir Arquivos Debes Gardar Primeiro os Datos de ' + pEntidad);
    }                          

}   


function pulseEnter(oEvento){
    var iAscii;

    if (oEvento.keyCode)
        iAscii = oEvento.keyCode;
    else if (oEvento.which)
        iAscii = oEvento.which;
    else
        return false;

    if (iAscii == 13) 
        document.getElementById("idFormLogin").submit();

    return true;
} 		

               

/* *************************************************************************** */

function marcarOpcion(pCheck){
    var checkSiMostrar = document.getElementById('siMostrar');
    var checkNoMostrar = document.getElementById('noMostrar');

    if(pCheck == 'siMostrar'){
        if(checkSiMostrar.checked)
            checkNoMostrar.disabled = true;
	else
            checkNoMostrar.disabled = false;
    }

    if(pCheck == 'noMostrar'){
        if(checkNoMostrar.checked)
            checkSiMostrar.disabled = true;
	else
            checkSiMostrar.disabled = false;
    }
}


function comprobarOpcion(){

    var checkSiMostrar = document.getElementById('siMostrar');
    var checkNoMostrar = document.getElementById('noMostrar');

    if(checkSiMostrar.checked)
        checkNoMostrar.disabled = true;
    else
        checkNoMostrar.disabled = false;

    if(checkNoMostrar.checked)
        checkSiMostrar.disabled = true;
    else
        checkSiMostrar.disabled = false;

}

function esEmail(valor) {
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){   
        return (true)
    } else {   
        return (false);
    }
}

/* ************************************ Equipo ***************************** */
function redireccionarEquipoPrincipal()
{	
      var form = document.getElementById("formComboEquipos");
      form.action = '/racingclubferrol/indexCategoriasInferiores.jsp';                             
      form.submit();   	        
}

/* ************************************ Equipo ***************************** */
function redireccionarEquipoPartes()
{	
      var form = document.getElementById("formParte");
      form.action = '/racingclubferrol/privada/parte/index2.jsp';                             
      form.submit();   	        
}

/* ************************************ Equipo ***************************** */
function redireccionarEquipoSanciones()
{	
      var form = document.getElementById("formSanciones");
      form.action = '/racingclubferrol/privada/sanciones/index2.jsp';                             
      form.submit();   	        
}
/* ************************************ Equipo ***************************** */
function redireccionarEquipoJugadores()
{	
      var form = document.getElementById("formJugador");
      form.action = '/racingclubferrol/privada/jugador/index2.jsp';                             
      form.submit();   	        
}
/* ************************************ Equipo ***************************** */
function redireccionarEquipoPartidos()
{	
      var form = document.getElementById("formPartidos");
      form.action = '/racingclubferrol/privada/partido/index2.jsp';                             
      form.submit();   	        
}
