function get(id){
    return document.getElementById(id).value;
}

//--------------------------------------

function limpiar_r(){


    document.getElementById('s_id1').value='';
    document.getElementById('s_id2').value='';

    document.getElementById('p_id1').value='';
    document.getElementById('p_id2').value='';

    document.getElementById('j_id1').value='';
    document.getElementById('j_id2').value='';

    document.getElementById('tf_id1').value='';
    document.getElementById('tf_id2').value='';

    document.getElementById('ft_id1').value='';
    document.getElementById('ft_id2').value='';

    document.getElementById('cantidad').value='20';
    
    document.getElementById('s_id1').focus();


}

//--------------------------------------

function mostrar_pdf(){

var v1=get('s_id1');
var v2=get('p_id1');
var v3=get('j_id1');
var v4=get('ft_id1');
var v5=get('cantidad');

if (v1=="") {
    alert("Digite Sede");
    return 0;
}

if (v2=="") {
    alert("Digite Periodo");
    return 0;
}

if (v3=="") {
    alert("Digite Jornada");
    return 0;
}

if (v4=="") {
    alert("Digite Falta");
    return 0;
}

    window.open('faltas_total_pdf.php?sede='+v1+'&periodo='+v2+'&jornada='+v3+'&falta='+v4+'&cantidad='+v5,'preview2');


}

//--------------------------------------

function retornar(){
 
     var dir=parametro('rol');

    
    if(dir=='1'){
        
        var id=parametro('id');
    
        location.href="../menu_profesor.php?rol=1";
    }   
    if(dir=='4'){
       
        document.location.href="../faltas_lucho/ingresar_f.php";
    }
    

        
}

////-----------------------------------
function parametro( name ){
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp ( regexS );
	var tmpURL = window.location.href;
	var results = regex.exec( tmpURL );
	if( results == null )
		return "";
	else
		return results[1];
}