<!--
////////////////////////////////////////////////////////////////////////////
// Sitio: catedragarcia.com.ar
// Fecha: Buenos Aires, marzo de 2008
// Autor: Ariel Yoguel
// Descripción: declaración de variables,
// matriz comisiones y docentes, fecha y hora,
// borde superior y fechas.
////////////////////////////////////////////////////////////////////////////

// Domain forwarding
var home_href = /gianella/i.test(window.location.href);
if  (home_href) window.location.replace("http://www.catedragarcia.com.ar");

// Declarations
var Comision = "";
var Sede = "";
var Sede_desc = "";
var Materia = "";
var Materia_desc = "";
var Catedra = "";
var Aula = "";
var Horario = "";
var Profesores = "";
var teacherName = [];
var teacherAddress = [];
var teacherFolder = [];
var teacherFound = []; 
var teacher_error = false;
var Value = "";
var n = 0;
var Home = "/index.html";
var print_type = -1;
var in_news_section = false;
var in_coms_section = false;
var in_downloads_section = false;
var no_data = "---";
var coms_test = false;
var rems_test = false;
var this_com_test = false;

// Document data
var document_url = document.URL;
var document_title = document.title;

// Home is a very special case
var at_home = /gianella/i.test(document_title) || /garcía/i.test(document_title);
if (at_home) document_title = "Home";

// Listado de comisiones
// cuatrimestre, número de comisión, horario, aula, docentes (docente1|docente2|...)
var Coms = [
	//["2007C1", "064006", "lu/ju 15-17", "06", "Ariel Yoguel|Mercedes Eyherabide"],
	//["2007C1", "064008", "lu/ju 17-19", "06", "Ariel Yoguel"],
	//["2007C1", "067310", "lu/ju 19-21", "11", "Ariel Yoguel"],
	//["2007C1", "067311", "lu/ju 21-23", "11", "Ariel Yoguel"],
	//["2007C2", "064024", "mi 19-21/sa 11-13", "05", "Juan Pablo Pardias|Pedro Balestrini"],
	//["2007C2", "067304", "lu/ju 09-11", "09", "Juan Pablo Pardias"],
	//["2007C2", "067306", "lu/ju 11-13", "09", "Juan Pablo Pardias"],
	//["2007C2", "067309", "lu/ju 19-21", "11", "Ariel Yoguel"],
	//["2007C2", "067310", "lu/ju 21-23", "11", "Ariel Yoguel"],
	//["2008C1", "064007", "lu/ju 17-19", "01", "Ariel Yoguel"],
	//["2008C1", "067310", "lu/ju 19-21", "11", "Ariel Yoguel"],
	//["2008C1", "067311", "lu/ju 21-23", "11", "Ariel Yoguel"],
	//["2008C2", "064006", "lu/ju 17-19", "06", "Silvia Hoffman|Ariel Yoguel"],
	//["2008C2", "067309", "lu/ju 19-21", "11", "Ariel Yoguel"],
	//["2008C2", "067310", "lu/ju 21-23", "11", "Ariel Yoguel"],
	//["2009C1", "064002", "lu/ju 07-09", "37", "Mercedes Eyherabide"],
	//["2009C1", "064003", "lu/ju 09-11", "06", "Fernanda Bonet"],
	//["2009C1", "064008", "lu/ju 17-19", "13", "Ariel Yoguel"],
	//["2009C1", "064018", "ma/vi 15-17", "26", "Miriam Pereyra|Mario Bordín"],
	//["2009C1", "064019", "ma/vi 17-19", "26", "Miriam Pereyra|Mario Bordín"],
	//["2009C1", "067302", "lu/ju 07-09", "09", "Miriam Pereyra"],
	//["2009C1", "067310", "lu/ju 19-21", "11", "Ariel Yoguel"],
	//["2009C1", "067311", "lu/ju 21-23", "11", "Ariel Yoguel"],
	//["2009C2", "064006", "lu/ju 17-19", "06", "Silvia Hoffman|Ariel Yoguel"],
	//["2009C2", "064008", "ma/vi 07-09", "02", "Fernanda Bonet"],
	//["2009C2", "067309", "lu/ju 19-21", "11", "Ariel Yoguel"],
	//["2009C2", "067310", "lu/ju 21-23", "11", "Ariel Yoguel"],
	//["2010C1", "064007", "lu/ju 17-19", "06", "Ariel Yoguel"],
	//["2010C1", "067310", "lu/ju 19-21", "11", "Ariel Yoguel"],
	//["2010C1", "067311", "lu/ju 21-23", "11", "Ariel Yoguel"],
[]
]

// Listado de calificaciones remanentes/libres
// año + R1 (febrero) / R2 (julio) / R3 (diciembre)
var Rems = [
	//"2010R2",
[]
]

Coms.sort();

// Teachers folders
// cada docente tiene una carpeta de upload
// El upload lo hace cgi-bin/_upload/upload.pl
var ProfDir = [
	["Agustina Borella",		"",		""],
	["Ariel Di Marco",			"",		""],
	["Ariel Yoguel",			"ay",	"http://sites.google.com/a/catedragarcia.com.ar/ariel-yoguel"],
	["Eduardo Bianchini",		"",		""],
	["Fernanda Bonet",			"",		""],
	["Guillermo Echavarría",	"",		""],
	["Inés Warckmeister",		"",		""],
	["Juan Pablo Pardias",		"",		"http://sites.google.com/a/catedragarcia.com.ar/juanpardias"],
	["Leandro Larison",			"",		""],
	["Mario Bordín",			"",		""],
	["Miriam Costas",			"",		""],
	["Mercedes Eyherabide",		"",		""],
	["Marina Presta",			"",		""],
	["Miriam Pereyra",			"",		""],
	["Nora Schwartz",			"",		""],
	["Pedro Balestrini Tadey",	"",		""],
	["Silvia Hoffman",			"",		""],
	["Viviana Bárcena",			"",		""],
[]
]

// Listado de sedes
var Sedes = [
	["04", "&quot;Avellaneda&quot;"],
	["06", "&quot;San Isidro&quot;"],
	["08", "&quot;Puán&quot;"],
	["10", "&quot;Paternal&quot;"],
[]
]

// Listado de materias
var Materias = [
	["40", "IPC", "Pablo García"],
	["73", "MCS", "Pablo García (ex Gianella)"],
[]
]

// Header file list
// Format: on/off, href, description (document title), link title, target=_self/_blank
var Files = [
	[1,"#home#",
	 "Home",
	 "Página de inicio de este sitio",
	 0],
	[1,"/news/news.html",
	 "Novedades",
	 "Detalle de las últimas novedades y modificaciones",
	 0],
	[1,"/faqs/faqs.html",
	 "Preguntas frecuentes",
	 "Catálogo de preguntas frecuentes sobre asuntos administrativos",
	 0],
	[1,"/forms/inscripcion.shtml",
	 "Formulario de inscripción",
	 "Inscripción on-line de alumnos",
	 0],
	[1,"/downloads/downloads.html",
	 "Downloads",
	 "Programas, guías de lectura, ejercicios, soluciones a ejercicios y otros documentos",
	 0],
	[1,"/cron/cron.html",
	 "Cronograma",
	 "Cronograma y calendario académico anual del CBC",
	 0],
	[1,"/cron/horarios.html",
	 "Horarios",
	 "Horarios de todos los docentes de la cátedra",
	 0],
	[1,"/coms/coms.html",
	 "Listado de comisiones",
	 "Listado parcial de comisiones de la cátedra Pablo García",
	 0],
	[1,"/notas/notas.html",
	 "Calificaciones",
	 "Consulta de calificaciones publicadas en este sitio",
	 0],
	[1,"/material/material_mcs.html",
	 "Material de estudio",
	 "Puntos de venta del material de lectura, consulta en biblioteca, etc.",
	 0],
	[1,"/links/links.html",
	 "Links",
	 "Links comentados",
	 0],
	[1,"/profs/profs.html",
	 "Cuerpo docente",
	 "Todos los docentes que integran la cátedra Pablo García",
	 0],
	[1,"/cgi-bin/_tree/tree.cgi",
	 "Mapa del sitio",
	 "Listado de todos los archivos de este sitio",
	 0],
	[1,"/legal/legal.html",
	 "Declaración legal",
	 "Descargo legal",
	 0],
	[1,"http://www.academica.rec.uba.ar/cbc",
	 "Consultar actas",
	 "Servicio de información de situación académica del CBC",
	 1],
	[1,"http://www2.cbc.uba.ar/registra/registra.html",
	 "Consultar asignación de materias",
	 "Consulta de asignación de materias del CBC",
	 1],
	[1,"http://www.cbc.uba.ar",
	 "Consultar condición de examen",
	 "Consulta de alumnos habilitados para rendir examen final remanente en el CBC",
	 1],
	[0,"/faqs/faq52.htm",
	 "Mensaje de error de Netfirms",
	 "Aclaración sobre las limitaciones de funcionamiento del servidor",
	 0],
	[1,"/_members/index.html",
	 "Acceso para profesores",
	 "Acceso exlusivo para profesores de la cátedra Pablo García",
	 0],
	[1,"http://mail.catedragarcia.com.ar",
	 "E-mail para profesores",
	 "Acceso a Gmail para el dominio catedragarcia.com.ar",
	 1],
[]
]

// Dates

// Long month description
var Calendar = [
	"enero",
	"febrero",
	"marzo",
	"abril",
	"mayo",
	"junio",
	"julio",
	"agosto",
	"septiembre",
	"octubre",
	"noviembre",
	"diciembre",
]

// Short month description
var Cal = [
	"ENE",
	"FEB",
	"MAR",
	"ABR",
	"MAY",
	"JUN",
	"JUL",
	"AGO",
	"SEP",
	"OCT",
	"NOV",
	"DIC",
]

// Days of the week
var Days_of_the_week = [
	"Domingo",
	"Lunes",
	"Martes",
	"Miércoles",
	"Jueves",
	"Viernes",
	"Sábado"
]

var Stamp = new Date();
var yearStamp = y2k(Stamp.getFullYear());
var dateStamp = Stamp.getDate();
var month = Stamp.getMonth();
var monthStamp = Calendar[month];
var hoursStamp = Stamp.getHours();
var minsStamp = Stamp.getMinutes();
//if(dateStamp < 10) dateStamp = "0" + dateStamp;
if(hoursStamp < 10) hoursStamp = "0" + hoursStamp;
if(minsStamp < 10) minsStamp = "0" + minsStamp;
var cuatrimestre = (month > 6) ? "Segundo cuatrimestre" : "Primer cuatrimestre";
var dateDesc = Stamp.getDay()

// y2k Fix Function
function y2k(yearStamp) {
	if (yearStamp < 2000) yearStamp = yearStamp + 1900;
	return yearStamp;
}

// Last update

var LM = Date.parse(document.lastModified)
var LastModified = new Date(LM);
if (LastModified != 0) {
	var yearLastModified = LastModified.getFullYear();
	var dateLastModified = LastModified.getDate();
	var monthLastModified = LastModified.getMonth() + 1;
	var hoursLastModified = LastModified.getHours();
	var minsLastModified = LastModified.getMinutes();
	if(dateLastModified < 10) dateLastModified = "0" + dateLastModified;
	if(monthLastModified < 10) monthLastModified = "0" + monthLastModified;
	if(hoursLastModified < 10) hoursLastModified = "0" + hoursLastModified;
	if(minsLastModified < 10) minsLastModified = "0" + minsLastModified;
	LastModified = dateLastModified + '.' + monthLastModified + '.' + yearLastModified + '&nbsp;' + hoursLastModified + ':' + minsLastModified;
}

else {
	LastModified = 'no disponible';
}

// HEADER

if (!at_home) {
	document.writeln("\
	<div id='top'>\
	<div id='page_title'><h1>Cátedra Pablo García</h1></div>\
	<div id='page_legend'>Sitio web para uso exclusivo de docentes y alumnos de la cátedra Pablo García de Metodología de las Ciencias Sociales (MCS-73) e Introducción al Pensamiento Científico (IPC-40), Ciclo Básico Común, Universidad de Buenos Aires.</div>\
	");
}

/* Not in use
+ cuatrimestre + ", año " + yearStamp + ".</p>"\
La cátedra Pablo García tiene todas sus comisiones en la sede &quot;San Isidro&quot; (Centro Universitario Regional Norte).
*/

// LINKBAR

// Linkbar begins
document.writeln("<div id='Linkbar'>");
//document.writeln("<h2><img src='/images/warning.gif' width='28' height='28'>&nbsp;Sitio&nbsp;en&nbsp;construcción</h2>");

// Counts present buttons
var button_count = 0;
for (var i = 0; i < Files.length; i++) {
	if (Files[i][0]) button_count++;
}

// Prints links and turns them off if necessary
var button_number = 0;
var found_an_item = false;
for (var i = 0; i < Files.length; i++) {
	
	var link_switch = Files[i][0];
	var link_href = Files[i][1];
	var link_text = Files[i][2];
	var link_title = Files[i][3];
	var link_target = Files[i][4];
	
	if (link_switch) {
		// Button is present
		button_number++;
		// Test both href and document title
		var document_url_indexOf = document_url.indexOf(link_href);
		if ((link_text == document_title || document_url_indexOf != -1) &&  !found_an_item) {
			// Link is turned off
			document.write("<span class='nowrap'>");
			// Icon cases
			if (link_text == "Acceso para profesores") document.write("<img src='/images/lock16x16.gif' class='lock' title='Área privada' width='16' height='16'>");
			document.write(link_text);
			document.write("</span>");
			
			// Remembers when an item was found
			found_an_item = true;
			// Remembers when in news section
			in_news_section = (link_text == "Novedades") ? true : false;
			// Remembers when in Listado de comisiones
			in_coms_section = (link_text == "Listado de comisiones") ? true : false;
			// Remembers when in Downloads
			in_downloads_section = (link_text == "Downloads") ? true : false;
		} // End if link_text
		
		else {
			// Link is turned on (there are special cases)
			var link_target_txt = "_self";
			if (link_target) link_target_txt = "_blank";
			document.write("<span class='nowrap'>");
			switch (link_text) {
				case "Home" :
					document.write("<a href='" + Home + "' title='" + link_title + "'>" + link_text + "</a>");
					break;
				case "Acceso para profesores" :
					document.write("<img src='/images/lock16x16.gif' class='lock' title='Área privada' width='16' height='16'>");
					document.write("<a href='" + link_href + "' title='" + link_title + "'>" + link_text + "</a>");
					break;
				case "E-mail para profesores" :
					document.write("<img src='/images/gmail16x16.png' class='lock' title='Gmail' width='16' height='16'>");
					document.write("<a href='" + link_href + "' title='" + link_title + "' target='" + link_target_txt + "'>" + link_text + "</a>");
					break;
				default :
					document.write("<a href='" + link_href + "' title='" + link_title + "' target='" + link_target_txt + "'>" + link_text + "</a>");
					document.write("</span>");
			} // End switch
			document.write("</span>");
		} // End else
		document.write( (button_number == button_count) ? " " : "&nbsp;| " );
	} // End link_switch
} // End for i

// Unused links
//document.write("<a href='/cgi-bin/_upload/upload.pl'>Upload</a>&nbsp;");
//document.write("<a href='/cgi-bin/_axs/ax-admin.pl'>Stats</a>");
//document.write("<a href='/_forum/main.html'>Forum</a> ");
//document.write("<a href='javascript:history.go(-1)'>Atrás</a> ");
//document.write("<a href='javascript:history.go(+1)'>Siguiente</a> ");



// SEARCH FORM

// Google CSE Search Box Begins
document.writeln("\
<div id='SearchForm'>\
<form action='http://www.google.com/cse' id='cse-search-box' target='_blank'>\
  <input type='hidden' name='cx' value='003212467305468685732:n8dcftqq1s8'>\
  <input type='text' name='q' size='25'>\
  <input type='submit' name='sa' value='Buscar'>\
<\/form>\
<script type='text/javascript' src='http://www.google.com/coop/cse/brand?form=cse-search-box&lang=es'><\/script>\
<\/div>\
");
// Google CSE Search Box Ends

/*
<!-- Google CSE Search Box Begins  -->
document.writeln("\
<div id='SearchForm' title="Busca información en este sitio">\
<form action='http://www.google.com/cse' id='cse-search-box'>\
  <input type='hidden' name='cx' value='003212467305468685732:n8dcftqq1s8'>\
  <input type='text' name='q' size='25'>\
  <input type='submit' name='sa' value='Buscar'>\
  <img src='http://www.google.com/images/poweredby_transparent/poweredby_FFFFFF.gif' alt='Google'>\
</form>\
</div>\
");
<!-- Google CSE Search Box Ends -->
*/

/*
document.writeln("<div id='SearchForm'>");
document.writeln("<form action='http://www.catedragarcia.com.ar/cgi-bin/_risearch/search.pl' method='get'>");
document.write("<input type='Text' name='query' SIZE='15' title='Ingrese una palabra clave respetando los acentos ortográficos'>");
document.write("<input type='Hidden' name='stpos' value='0'>");
document.write("<input type='Hidden' name='stype' value='and'>&nbsp;");
document.write("<input type='Submit' value='Buscar'>&nbsp;");
document.write("<a href='/search/info.html' title='Recomendaciones para una búsqueda exitosa'>Ayuda</a>");
document.writeln("</form></div>");
*/

// PULLDOWN MENU

/*
document.writeln("<div id='NavigationForm'>");
document.writeln("<form name='selector' id='navigation'>");
PrintPulldown(2);
document.writeln("</form></div>");
*/

// Linkbar ends
document.writeln("</div>");

// Top ends (when necessary)
if (!at_home) {
	document.writeln("</div>");
}

// Functions
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////
// Prints pull-down menu depending on type
//////////////////////////////////////////

function PrintPulldown(n) {
	print_type = n;

	// Coms/Rems test
	if (Coms != undefined && Coms != "") {
		coms_test = true;
	} // if
	if (Rems != undefined && Rems != "") {
		rems_test = true;
	} // if

	// print_type = 1 Pull-down para formulario de inscripción
	// print_type = 2 Pull-down con links a páginas de comisión
	// print_type = 3 Pull-down para búsqueda de calificaciones
	switch (print_type) {
		case 1 : // Pull-down para formulario de inscripción
			if (!coms_test) {
				// There are no coms
				document.writeln("\n<select name='COMISION' size=1>");
				document.writeln("<option selected value='nohaycoms'>No hay comisiones ingresadas</option>");
				document.write("</select>");
				document.writeln("&nbsp;<a href='/faqs/faq55.htm#preg'>Ayuda</a>");
			} // if
			else {
				// There are coms
				
				// Pull-down header
				document.writeln("\n<select name='COMISION' size=1>");
				document.writeln("<option selected value='header'>Seleccionar comisión</option>");				
				// Pull-down lines
				PrintPulldownComOptions();
				// Pull-down footer
				document.write('</select>');
				document.write("&nbsp;<a href='/faqs/faq54.htm#preg'>Ayuda</a>");
			} // else
			break;
		case 2 : // Pull-down con links a páginas de comisión
			if (!coms_test) {
				// There are no coms
				document.writeln("\n<select name='com' size=1>");
				document.writeln("<option selected value='nohaycoms'>No hay comisiones ingresadas</option>");
				document.write("</select>");
				document.writeln("&nbsp;<a href='/faqs/faq55.htm#preg'>Ayuda</a>");
			} // if
			else {
				// There are coms
				
				// Pull-down header
				document.writeln("\n<select id='top' name='com' onChange='location.href = options[selectedIndex].value' size=1>");
				document.writeln("<option selected value='/" + Home + "'>Seleccionar comisión</option>");
				// Pull-down lines
				PrintPulldownComOptions();
				// Pull-down footer
				document.write('</select>');
				document.write("&nbsp;<a href='/faqs/faq54.htm#preg'>Ayuda</a>");
			} // else
			break;
		case 3 : // Pull-down para búsqueda de calificaciones
			if (!coms_test && !rems_test) {
				// There are no coms nor rems
				document.writeln("\n<select name='comision' size=1>");
				document.writeln("<option selected value='nohaycoms'>No hay comisiones ingresadas</option>");
				document.write("</select>");
				document.writeln("&nbsp;<a href='/faqs/faq55.htm#preg'>Ayuda</a>");
			} // if
			else {
				// There are coms or rems or both
				
				if (!coms_test) {
					var str = "Seleccionar turno de examen";
				} // if
				else if (!rems_test) {
					var str = "Seleccionar comisión";
				} // if
				else {
					var str = "Seleccionar comisión o turno de examen";
				} // else
				
				// Pull-down header
				document.writeln("\n<select name='comision' size=1>");
				document.writeln("<option selected value='header'>" + str + "</option>");
				// Pull-down lines
				PrintPulldownComOptions();
				PrintPulldownRemOptions();
				// Pull-down footer
				document.write('</select>');
				document.write("&nbsp;<a href='/faqs/faq54.htm#preg'>Ayuda</a>");
			} // else
			break;
		default : // Error
			document.write("<div class='error'>[Código de pull-down inválido en PrintPulldown()]</div>");
	} // End switch
} // End PrintPulldown

////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////
// Subfunction of PrintPulldown
//	Prints options in <select>
////////////////////////////////////

function PrintPulldownComOptions() {
	for (var i = 0; i < Coms.length; i++) {
		DataRetrieving(i);
		PrintComOption();
	} // for
} // function

////////////////////////////////////
// Subfunction of PrintPulldown
// Asigns values to Cuatrimestre,
// Comision, Sede, Materia, Cátedra,
// Horario, Aula, Profesores
////////////////////////////////////

function DataRetrieving(list_order) {
	if (Coms[list_order] == undefined || Coms[list_order] == "" || Coms[list_order][1] == undefined || Coms[list_order][1] == "") {
		// Line is empty (Horario, Aula and Profesores are not mandatory)
		this_com_test = false;
		/* Do nothing */
	} // if
	else {
		// Line is present
		this_com_test = true;
		// Error test
		if (Coms[list_order][0].indexOf("C") != 4) {
			document.write("<option value='error'>[Error en Coms[" + list_order + "][0]: " + Coms[list_order][0] + "]</option>");
			this_com_test = false;
		} // if error
		else {
			// Com

			// Asigns values
			// Coms[list_order][0]: año y cuatrimestre
			// Coms[list_order][1]: número de comisión
			// Coms[list_order][2]: horario
			// Coms[list_order][3]: aula
			// Coms[list_order][4]: docentes
			
			var cuatrimestre_code = (cuatrimestre == "Primer cuatrimestre") ? yearStamp + "C1" : yearStamp + "C2";
			Cuatrimestre = Coms[list_order][0] ? Coms[list_order][0] : cuatrimestre_code;
			Comision = Coms[list_order][1] ? Coms[list_order][1] : "#comisión#";
			Sede = Comision ? Comision.substr(0,2) : "#sede#";
			Materia = Comision ? Comision.substr(2,2) : "#materia#";
			Horario = Coms[list_order][2] ? Coms[list_order][2] : no_data;
			Aula = Coms[list_order][3] ? Coms[list_order][3] : no_data;
			Profesores = Coms[list_order][4] ? Coms[list_order][4] : no_data;
	
			// Asigns value to <option value=?>
			switch (print_type) {
				case 1 : // Pull-down para formulario de inscripción
					Value = Comision;
					break;
				case 2 : // Pull-down con links a páginas de comisión
					Value = "/coms/" + Comision.toLowerCase() + ".shtml";
					break;
				case 3 : // Pull-down para búsqueda de calificaciones
					Value = Cuatrimestre + Comision;
					break;
				default :
					Value = "";
			} // End switch
			
			// Sede description
			for (var i = 0; i < Sedes.length; i++) {
				if (Sedes[i][0] == Sede) {
					Sede_desc = Sedes[i][1];
					break;
				} // if
				else {
					Sede_desc = "#sede#";
				} // else
			} // for
			
			// Materia and Catedra description
			for (var i = 0; i < Materias.length; i++) {
				if (Materias[i][0] == Materia) {
					Materia_desc = Materias[i][1];
					Catedra = Materias[i][2];
					break;
				} // if
				else {
					Materia_desc = "#materia#";
					Catedra = "#cátedra#";
				} // else
			} // for
	
			// Profesores
			if (Profesores == no_data) {
				// There are no profs
				/* Do nothing */
			} // if
			else {
				// There are profs
				
				// Profs test
				teacher_error = false;
				teacherName = Profesores.split("|");
				// i runs over teachers of this com
				for (var i = 0; i < teacherName.length; i++) {
					teacherFound[i] = false;
					// j runs over list of all teachers
					for (var j = 0; j < ProfDir.length; j++) {
						if (teacherName[i] == ProfDir[j][0]) {
							teacherFolder[i] = ProfDir[j][1];
							teacherAddress[i] = ProfDir[j][2];
							teacherFound[i] = true;
							break;
						} // if
					} // for j
					// Teacher not in ProfDir
					if (!teacherFound[i]) {
						teacher_error == true;
					} // if
				} // for i
			} // else there are profs
		} // else no error
	} // else line is present
} // function

///////////////////////////////////
// Subfunction of PrintPulldown
// Prints one line of pull-down
///////////////////////////////////

function PrintComOption() {
	if (!this_com_test) {
		// There is no com
		/* Prints nothing */	
	} // if
	else {
		// There is a com
		
		// Deletes all HTML from Horario, Aula and Profesores
		var myRe = /<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>/gi;
		Horario = Horario.replace(myRe, "");
		Aula = Aula.replace(myRe, "");
		Profesores = Profesores.replace(myRe, "");
		
		// Prints line
		document.write("<option value='" + Value + "'>");
		document.write(Comision + " ");
		document.write(Sede_desc + " ");
		document.write(Materia_desc + " ");
		document.write(Horario + " ");
		document.write("Aula " + Aula);
		document.writeln("</option>");
	} // else
} // function

///////////////////////////////////
// Subfunction of PrintPulldown
// Prints list of remanentes
///////////////////////////////////

function PrintPulldownRemOptions() {
	// Prints pull-down lines
	for (var i = 0; i < Rems.length; i++) {
		if (Rems[i] == "" || Rems[i] == undefined) {
			/* Do nothing */
		} // if
		else {
			var turno = Number(Rems[i].substr(5,1));
			var año = Number(Rems[i].substr(0,4));
			// Error test
			if (Rems[i].indexOf("R") != 4 || (turno != 1 && turno != 2 && turno != 3)) {
				document.write("<option value='error'>[Error en Rems[" + i + "]: " + Rems[i] + "]</option>");
			} // if error
			else {
				// Turno description
				var turnoDesc = "";
				switch (turno) {
					case 1 :
						turnoDesc = "marzo";
						break;
					case 2 :
						turnoDesc = "julio";
						break;
					case 3 :
						turnoDesc = "diciembre";
						break;
					default :
						turnoDesc = "#turno#";
				} // switch
				document.write("<option value='" + Rems[i] + "'>Remanente/libre " + turnoDesc + " de " + año + "</option>");
			} // else
		} // else
	} // for
} // function

// -->