//------------------------------------------------------------------------------
function mostrar(id1,id2,tabla,ancho, alto){

  $("#dialog").dialog({
          width: ancho,
          height: alto
                 
  });
   var parametros = {"accion":'listado',"tabla":tabla,"id1":id1,"id2":id2};
                    $.ajax({
                    data:  parametros,
                    url:"catalogos.php",
                    type: "POST",
                success: function(opciones){$("#dialog").html(opciones);}})
}


//-------------------------------------------------------
function mostrar_lista(id1,id2,codigo,nombre){

    document.getElementById(id1).value=codigo;
    document.getElementById(id2).value=nombre;

    $("#dialog").click(function () {
            $(this).dialog('close');
    });

    
}


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

function limpiar(){

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

}

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

function pdf(){

var per=document.getElementById('p_id1').value;

window.open("reporte.php?periodo="+per);
}

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

function retornar(){

location.href="../menu.php";

}

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

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

    if(rd=='1'){
            location.href="../menu.php";
    }

    if(rd=='2'){
        var id=parametro('id');
        location.href="../menu_profesor.php?id="+id+'&dir=2';
    }

    if(rd=='3'){
      location.href="../menu_coordinador.php?dir=3";
    }
}

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