function isset(variable_name) {
    try {
	if (typeof(eval(variable_name)) != 'undefined')
	if (eval(variable_name) != null)
	    return true;
    } catch(e) { }
    return false;
    }

function get_isset(variable_name) {
    var variable_name = document.getElementById(variable_name).value;
    alert(variable_name);
    try {
	if (typeof(eval(variable_name)) != 'undefined')
	if (eval(variable_name) != null)
	    return true;
    } catch(e) { }
    return false;
    }

function mostrar(id, lang){
    var idiomas = new Array( 'es', 'eu', 'en', 'fr' );
    for ( var i = 0; i <= idiomas.length; i++ ){
	if ( idiomas[i] != lang && isset($('intro'+id+idiomas[i])) ){
	    $('#intro'+id+idiomas[i]).hide();
            $('#titulo'+id+idiomas[i]).hide();
            }        
        }
    $('#titulo'+id+lang).fadeIn();
    $('#intro'+id+lang).fadeIn();        
    return false;        
    }
    
    
//validar correo electronico
function isEmailAddress( id_elemento ){
    var s = document.getElementById(id_elemento).value;
    var filter=/^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
    if (filter.test(s))
        return true;
    else
        return false;
    }
    
    
function abrir_popup( url ){
    window.open( url , '' , 'width=650,height=750,scrollbars=yes');
    }
    
function ir_a( url ){
    document.location.href = url;
    }
    
function mueveReloj(){
	momentoActual = new Date()
	hora = momentoActual.getHours()
	minuto = momentoActual.getMinutes()
	segundo = momentoActual.getSeconds()
	
	str_segundo = new String (segundo)
	if (str_segundo.length == 1) 
		segundo = "0" + segundo
		
	str_minuto = new String (minuto)
	if (str_minuto.length == 1) 
		minuto = "0" + minuto

	str_hora = new String (hora)
	if (str_hora.length == 1) 
		hora = "0" + hora
		
	horaImprimible = hora + ":" + minuto + ":" + segundo
	
	document.getElementById('reloj').value = horaImprimible
	
	setTimeout("mueveReloj()",1000)
} 
