/*
 * CATIC functions                                      Max Díaz 09/1
 *    (c) Max Díaz 2009
 *    www.maxdiaz.com
 */

var nams = [
	"*CATIC",
	    "",
	"*Quiénes somos",
	    "Equipo CATIC", "Quiénes nos Apoyan", "",
	"*Qué hacemos",
	    "Asesoría", "Apoyo a Integración", "Asistencia Tecnológica", "Capacitación", "Cursos y Talleres", "Congresos y Conferencias", "",
	"*Recursos",
	    "Bibliografía", "Ligas de Interés", "Tecnología", "",
	"*Artículos",
	    "Mitos sobre CAA", "Artículos y Caso-Estudios", "",
	"*Contáctenos",
	    ""
];
var lnks = [
	"index.html",
	    "",
	"",
	    "equipo.html", "apoyos.html", "",
	"servicios.html",
	    "serv_asesoria.html", "serv_apoyo.html", "serv_at.html", "serv_capa.html", "serv_curstall.html", "congresos.html", "",
	"",
	    "rec_biblio.html", "rec_ligas.html", "rec_tecno.html", "",
	"",
	    "art_mitos.html", "articulos.html", "",
	"contacto.html",
	    ""
];

// banner + menu
function top() {
	document.write('<div class="banner"><a href="index.html"><img src="graficos/headlogo.jpg" border=0 ' +
				   'alt="Centro de Apoyo Tecnológico para la Comunicación y el Aprendizaje" title="Regresar a página Inicio"></a></div>');

	document.write('<div class="menuc"><div class="menu"><ul class="cf_menu" params="3,-3,300,slide,300,h">');
	var menu = "";
	for (var i=0; i<nams.length; i++) {
		nam = nams[i];
		if (nam.length == 0) {
			menu += '</ul></li>';
			continue;
		}
		lnk = lnks[i];
		if (nam.charAt(0) == '*') {
			nam = nam.substr(1);
			if (lnk.length > 0)
				menu += '<li><a href="' + lnk + '">' + nam + '</a><ul>';
			else
				menu += '<li><div class="litit">' + nam + '</div><ul>';
		} else {
			menu += '<li><a href="' + lnk + '">' + nam + '</a></li>';
		}
	}
	menu += '</ul></div></div>';
	document.write(menu);
}

// set footer, add link if lnk
function foot(lnk) {
	document.write("<div id='footer'> Derechos Reservados &copy; 2009 CATIC México</div>");
	/*
	if (lnk)
		document.write("<div id='footc'><a class='footcr' target='_blank' href='http://www.legeresoft.com/webdev.html'>&laquo; Diseño Web &raquo;</a></div>");
	*/
	document.write("<div id='footc'>" +
				   (lnk? "<a class='footcr' target='_blank' href='http://www.legeresoft.com/webdev.html'>&laquo; Diseño Web &raquo;</a>" : "&nbsp;") +
				   "</div>");
}

// hide email
function email(cls, name) {
	var hostname = "caticmexico.org";
	document.write("<a class=\"" + cls + "\" href=\"" + "mail" + "to:" + name + "@" + hostname + "\">");
}

// reveal hidden element
function showId(idh, ids) {
	document.getElementById(idh).style.visibility = "hidden";
	document.getElementById(idh).style.display = "none";
	document.getElementById(ids).style.visibility = "visible";
	document.getElementById(ids).style.display = "block";
}

function checkQuery() {
	var err = 0

	if (document.myquer.name.value == "")
		err = 1;
	if (document.myquer.email.value == "")
		err = 1;
	if (err == 1)
		alert ("Por favor ingrese su nombre y email...");
	return(err == 0);
}

