//var acc='x';
////-----------------------------------------------------
function get(id){
    return document.getElementById(id).value;
}


////++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function limp(){
    
    document.getElementById('s_id1').value='';
    document.getElementById('s_id2').value='';
    document.getElementById('g_id1').value='';
    document.getElementById('g_id2').value='';
    document.getElementById('c_id1').value='';
    document.getElementById('c_id2').value='';
    var frame = document.getElementById("preview2"),
    frameDoc = frame.contentDocument || frame.contentWindow.document;
    frameDoc.documentElement.innerHTML = "";
}


function pdf(){    
  
    var grado=get('g_id1');
    var curso=get('c_id1');
    
     window.open('app/model/listado.php?grado='+grado+'&curso='+curso, "preview2");

}

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

function pdf1(){    
  
    var grado=get('g_id1');
    var curso=get('c_id1');
    
     window.open('app/model/listado1.php?grado='+grado+'&curso='+curso, "preview2");

}

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


function excel(){



    var grado=get('g_id1');
    var curso=get('c_id1');


      if (grado==""){
          alert("Seleccione Grado");
          return 0;
      }

      if (curso==""){
          alert("Seleccione Curso");
          return 0;
      }

window.open('reporteexcel.php?grado='+grado+'&curso='+curso, "preview2");

        
}


////-----------------------------------
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 retornar_menu_docente(){
    
    var dir=parametro('rol');
    
    if(dir=='4'){
        document.location.href="../menu.php";
    }

    else{

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

        if(dir=='5'){
        var id=parametro('id');
        document.location.href="../menu_coordinador.php?id="+id+"";
        }


    }

}