function notas_asign(n){

var id = parametro( 'id' ); 

document.location.href ="mostrar_notas_alumno/notas.php?codigo="+id+"&n="+n;

}

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


function anolectivo(n){

var parametros = {"accion":'mostrar_anolectivo'};
        $.ajax({
                data:  parametros,
                url:   'verificar_2.php',
                type:  'post',
                success: function(opciones){$("#anolectivo").html(opciones);}})

if (n==2){

   var id = parametro( 'id' );
   
  
   var parametros1 = {"accion":'mostrar_usuario',"id":id};
   

   $.ajax({
                data:  parametros1,
                url:   'verificar_2.php',
                type:  'post',
                success: function(opciones){
                              
                document.getElementById('usuario').value=opciones;
                
                }})
                
}

}

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

function mostrar_clave(){

 
  if (clave.checked==true){
      
       var id = parametro( 'id' );       
       var parametros = {"accion":'mostrar_password',"id":id};
   
      $.ajax({
                data:  parametros,
                url:   'verificar_2.php',
                type:  'post',
                success: function(opciones){
                              
                document.getElementById('password').value=opciones;
                
                }})
         
   }
   else{
   
       document.getElementById('password').value="";
   }


}

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



function  seleccionar_periodo(){
      
      var p="<CENTER><SELECT id='periodos'><OPTION VALUE='0'>Periodos</OPTION><OPTION VALUE='1'>1</OPTION>";
          p=p+"<OPTION VALUE='2'>2</OPTION>";
          p=p+"<OPTION VALUE='3'>3</OPTION>";
          p=p+"<OPTION VALUE='4'>4</OPTION>";
          p=p+"<OPTION VALUE='5'>Informe Final</OPTION>";
          p=p+"</SELECT></CENTER>";


      $("#dialog").html(p);

      $( "#dialog" ).dialog({
          width: '300px',
          position:[530,340],

          buttons: {
          "Aceptar": function () {

           var per=document.getElementById('periodos').value;          
           window.open('rendimiento_academico/faltantes_rendimiento.php?periodo='+per);

           $(this).dialog("close");
           },

          "Cancelar": function () {
          $(this).dialog("close");}


          }
      });

}

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

function planillas_pendientes(){

      var p="<CENTER><SELECT style='font-size: 14px;width: 150px;' id='periodos'>";
          p=p+"<OPTION VALUE='0'>Periodos</OPTION>";
          p=p+"<OPTION VALUE='1'>1</OPTION>";
          p=p+"<OPTION VALUE='2'>2</OPTION>";
          p=p+"<OPTION VALUE='3'>3</OPTION>";
          p=p+"<OPTION VALUE='4'>4</OPTION>";
          p=p+"<OPTION VALUE='5'>Informe Final</OPTION>";
          p=p+"</SELECT></CENTER>";

      var s="<CENTER><SELECT style='font-size: 14px;width: 150px;' id='sedes'>";
          s=s+"<OPTION VALUE='0'>Sedes</OPTION>";
          s=s+"<OPTION VALUE='1'>SEDE PRINCIPAL</OPTION>";
          s=s+"</SELECT></CENTER>";


      $("#dialog").html(p+s);


      $( "#dialog" ).dialog({
          width: '300px',
          position:[530,300],

          buttons: {
          "Aceptar": function () {

           var per=document.getElementById('periodos').value;
           var s=document.getElementById('sedes').value;
          
           window.open("planillas_pendientes/planillas_por_digitar.php?periodo="+per+"&sede="+s);

           $(this).dialog("close");
           },

          "Cancelar": function () {
          $(this).dialog("close");}


          }
      });

}

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


function calcular_nota_convivencia(){

      var p="<CENTER><SELECT id='periodos'><OPTION VALUE='0'>Periodos</OPTION><OPTION VALUE='1'>1</OPTION>";
          p=p+"<OPTION VALUE='2'>2</OPTION>";
          p=p+"<OPTION VALUE='3'>3</OPTION>";
          p=p+"<OPTION VALUE='4'>4</OPTION>";
          p=p+"<OPTION VALUE='5'>Informe Final</OPTION>";
          p=p+"</SELECT></CENTER>";


      $("#dialog").html(p);

      $( "#dialog" ).dialog({
          width: '300px',
          position:[530,340],

          buttons: {
          "Aceptar": function () {

           var per=document.getElementById('periodos').value;
           window.open('convivencia/calcular_nota.php?periodo='+per);

           $(this).dialog("close");
           },

          "Cancelar": function () {
          $(this).dialog("close");}


          }
      });

}

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

function alumnos_excel(){

document.location.href ="reportes_excel/alumnos_excel.php";

}

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

function editar_alumno(){
 var codigo = parametro( 'id' );  
 window.location="datos_alumno/datos_alumno.html?oper=2&codigo="+codigo+"&retornar=2";
 
}

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

function activar_alumno(){

  //document.location.href="autorizar_boletin/boletin.php?&grado="+grado+"&curso="+curso;
 document.location.href="autorizar_boletin/boletin.php?&grado=7&curso=1";
}

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

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