		//--------- ACCEPT/REJECT INSCRIPTED --------------
		function acceptDelInscriptedMsg(uId, uName, value){
			if (value == 1)
				blockInfoMsg('Está seguro que desea aceptar a <b>' + uName + '</b>?<br><br><input type="button" value="Aceptar" class="inputButton" onclick="acceptDelInscripted(' + uId + ', ' + value + ')">&nbsp;&nbsp;<input type="button" value="Cancelar" class="inputButton" onclick="myUnblockUI()">',0);
			else
				blockInfoMsg('Está seguro que desea rechazar a <b>' + uName + '</b>?<br><br><input type="button" value="Aceptar" class="inputButton" onclick="acceptDelInscripted(' + uId + ', ' + value + ')">&nbsp;&nbsp;<input type="button" value="Cancelar" class="inputButton" onclick="myUnblockUI()">',0);
		}

		function acceptDelInscripted(uId, value){
			var AJ = new Ajax();
			try{
				AJ.setUrl("cursoTabIni.php");
				AJ.setVar("cursoId", document.getElementById("idCurso").value);
				AJ.setVar("userId", uId);
				AJ.setVar("acceptDel", value);
				AJ.setVar("acceptInscripted", 1);
				AJ.setMethod("POST");
				AJ.setOnLoading(acceptDelInscriptedLoading);
				AJ.setOnComplete(acceptDelInscriptedComplete);
				AJ.connect();
				AJ.getData();
			}catch(e){
			}
		}

		function acceptDelInscriptedLoading(){
			blockLoadingMsg('Guardando...', 1);
		}


		function acceptDelInscriptedComplete(httpRequest,AJ){
			var resp = httpRequest.responseText;

			if ((resp == "1") || (resp == 1)){
				blockCustomMsg('<img src="../common/images/ok.gif" style="vertical-align: middle">&nbsp;&nbsp;&nbsp;' + 'La operación se realizó correctamente.<br><br><input type="button" value="Aceptar" class="inputButton" onclick="reloadTab()">');
			}
			else{
				blockDefaultErrorMsg(resp);
			}
		}


		//--------- DELETE INSCRIPTED --------------
		function deleteInscript(uName, value){
			blockInfoMsg('Está seguro que desea eliminar a <b>' + uName + '</b>?<br><br><input type="button" value="Aceptar" class="inputButton" onclick="deleteInscriptOk(' + value + ')">&nbsp;&nbsp;<input type="button" value="Cancelar" class="inputButton" onclick="myUnblockUI()">',0);
		}

		function deleteInscriptOk(value){
			var AJ = new Ajax();
			try{
				AJ.setUrl("cursoTabIni.php");
				AJ.setVar("cursoId", document.getElementById("idCurso").value);
				AJ.setVar("userId", value);
				AJ.setVar("deleteInscripted", 1);
				AJ.setMethod("POST");
				AJ.setOnLoading(acceptDelInscriptedLoading);
				AJ.setOnComplete(acceptDelInscriptedComplete);
				AJ.connect();
				AJ.getData();
			}catch(e){
			}
		}


		//--------- CAMBIAR ESTADO INSCRIPTO --------------
		function changeState(id, value){
			var AJ = new Ajax();
			try{
				AJ.setUrl("cursoTabIni.php");
				AJ.setVar("cursoId", document.getElementById("idCurso").value);
				AJ.setVar("userId", id);
				AJ.setVar("userState", value);
				AJ.setVar("changeState", 1);
				AJ.setMethod("POST");
				AJ.connect();
				AJ.getData();
			}catch(e){
			}
		}


		//--------- FILTRO EXAMENES CORRECCION --------------
		function loadTableCorrect(){
			var AJ = new Ajax();
			try{
				AJ.setUrl("tableExamCorrect.php");
				AJ.setVar("cursoId", document.getElementById("idCurso").value);
				AJ.setVar("idExam", document.getElementById("selExamCorrect").value);
				AJ.setMethod("POST");
				AJ.setOnLoading(loadTableCorrectLoading);
				AJ.setOnComplete(loadTableCorrectComplete);
				AJ.connect();
				AJ.getData();
			}catch(e){
			}
		}

		function loadTableCorrectLoading(){
			document.getElementById("spanExamCorrect").innerHTML = "<div style='text-align: center; margin-top: 20px'><img src='../common/images/ajax-loader.gif' style='vertical-align: middle'> Cargando...</div>";
		}

		function loadTableCorrectComplete(httpRequest,AJ){
			var resp = httpRequest.responseText;

			document.getElementById("spanExamCorrect").innerHTML = resp;

			try{
				$("#tableExamsCorrect").tablesorter({widthFixed: true, sortList: [[1,0], [2,0]]});
				$("#tableExamsCorrect").tablesorterPager({container: $("#pagerExamsCorrect")});
			}catch (e){}
		}


	
		function correctExam(value){
			var AJ = new Ajax();
			try{
				AJ.setUrl("viewExamCorrect.php");
				AJ.setVar("idExamUser", value);
				AJ.setMethod("POST");
				AJ.setOnLoading(loadingTab);
				AJ.setOnComplete(completeTab);
				AJ.connect();
				AJ.getData();
			}catch(e){
			}
		}


		//--------- ENVIAR MAIL A PROFESOR --------------
		function sendEmailProfessor(id, value){
			var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
			if (reg.test(document.getElementById("sendEmailProfessor").value) == false){
				blockErrorMsg('El email ingresado en inválido.', 1);
				return;
			}
			else if (document.getElementById("sendNameProfessor").value == ''){
				blockErrorMsg('Datos incompletos. Por favor, ingrese el nombre para enviar la solicitud.', 1);
				return;
			}

			var AJ = new Ajax();

			try{
				AJ.setUrl("cursoTabIni.php");
				AJ.setVar("cursoId", document.getElementById("idCurso").value);
				AJ.setVar("emailProf", document.getElementById("sendEmailProfessor").value);
				AJ.setVar("nameProf", document.getElementById("sendNameProfessor").value);
				AJ.setVar("sendMailProfessor", 1);
				AJ.setMethod("POST");
				AJ.setOnLoading(sendEmailProfessorLoading);
				AJ.setOnComplete(sendEmailProfessorComplete);
				AJ.connect();
				AJ.getData();
			}catch(e){
			}
		}

		function sendEmailProfessorLoading(){
			blockLoadingMsg('Enviando...', 1);
		}


		function sendEmailProfessorComplete(httpRequest,AJ){
			var resp = httpRequest.responseText;

			if ((resp == "1") || (resp == 1)){
				blockCustomMsg('<img src="../common/images/ok.gif" style="vertical-align: middle">&nbsp;&nbsp;&nbsp;' + 'Email enviado correctamente.<br><br><input type="button" value="Aceptar" class="inputButton" onclick="reloadTab()">');

				document.getElementById("sendEmailProfessor").value = '';
				document.getElementById("sendNameProfessor").value = '';
			}
			else if ((resp == "2") || (resp == 2)){
				blockErrorMsg('El email ingresado corresponde a un usuario que está inscripto en el curso. Elimine el inscripto y envie la solicitud nuevamente.', 1);

				document.getElementById("sendEmailProfessor").value = '';
				document.getElementById("sendNameProfessor").value = '';
			}
			else{
				blockDefaultErrorMsg(resp);
			}
		}



		//--------- VER REPORTE USUARIO --------------
		function viewUserReport(value){
			var AJ = new Ajax();
			try{
				AJ.setUrl("viewUserReport.php");
				AJ.setVar("userId", value);
				AJ.setVar("cursoId", document.getElementById("idCurso").value);
				AJ.setMethod("POST");
				AJ.setOnLoading(blockLoadingMsg("Cargando...", 1));
				AJ.setOnComplete(viewUserReportFinish);
				AJ.connect();
				AJ.getData();
			}catch(e){
			}
		}

		function viewUserReportFinish(httpRequest,AJ){
			var resp = httpRequest.responseText;

			blockCustomMsg(resp, 20, 780, (screen.width / 2) - 390);
		}

		//--------- VER / MODIFICAR EXAMEN --------------
		function viewModifyExam(value){
			var AJ = new Ajax();
			try{
				AJ.setUrl("viewModifyExam.php");
				AJ.setVar("examId", value);
				AJ.setMethod("POST");
				AJ.setOnLoading(loadingTab);
				AJ.setOnComplete(completeTab);
				AJ.connect();
				AJ.getData();
			}catch(e){
			}
		}



		function toggleById(value){
			$('#divExams').hide('fast');
			$('#divCorrect').hide('fast');
			$('#divInscriptos').hide('fast');
			$('#divProfesores').hide('fast');
			$('#divLinks').hide('fast');
			$('#divReports').hide('fast');

			$('#' + value).show('fast');
		}

		//--------- VER / MODIFICAR EXAMEN --------------
		function generateListadoGral(){
			var AJ = new Ajax();
			try{
				AJ.setUrl("exportExamInscript.php");
				AJ.setMethod("POST");
				AJ.setVar("id", $("#idCurso").val());
				AJ.setOnLoading(generateListadoGralLoading);
				AJ.setOnComplete(generateListadoGralComplete);
				AJ.connect();
				AJ.getData();
			}catch(e){
			}
		}

		function generateListadoGralLoading(){
			blockLoadingMsg("Generando listado. Este proceso puede tardar varios minutos. Por favor aguarde...", 1);
		}

		function generateListadoGralComplete(httpRequest,AJ){
			var resp = httpRequest.responseText;

			if ((resp != "0") && (resp != 0)){
				myUnblockUI();

				window.open("../common/viewFile.php?name=" + resp,'Lista_de_autores','toolbar=yes, resizable=yes');
			}
			else
				blockDefaultErrorMsg();
		}

