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



//-----------------------------------
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];
}

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

function pdf(){
    
    var per=get('p_id1');
  
    if(per==''){
        alert('Ingrese Periodo');
        exit();
    }
    
   var parametros = {"accion":'verificar_descarga',"periodo":per};
        $.ajax({
                data:  parametros,
                url:   '../autorizar_boletin/consultas.php',
                type:  'post',
                success:function (response){
               
                    if (response=='NO'){
                        alert(" - DESCARGA NO AUTORIZADA - ");
                    }else{
                        window.open("app/model/reportes/boletin_academico.php?per="+per,"preview2");
                    }
                    
                
                    
           }
        });
   
}

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

function retornar_inicio(){
    document.location.href="../menu_estudiante.php";
}