/***********************************
* Librería de Funciones JavaScript *
* NexusIT: www.nexusit.com.py      *
************************************/

// Escribe una fecha
function MakeArray(arrayLength) {
	this.length = arrayLength;
	for (var i = 1; i <= arrayLength; i++)
		this[i] = i-1;
	return this
}

function writeDate(m,sep) {
	dateNow = new Date();
	theDay = new MakeArray(7);
	theDay[0] = "Domingo"; theDay[1] = "Lunes"; theDay[2] = "Martes"; theDay[3] = "Miércoles";
	theDay[4] = "Jueves"; theDay[5] = "Viernes"; theDay[6] = "Sábado";
	theMonth = new MakeArray(12);
	theMonth[0] = "Enero"; theMonth[1] = "Febrero"; theMonth[2] = "Marzo";
	theMonth[3] = "Abril"; theMonth[4] = "Mayo"; theMonth[5] = "Junio";
	theMonth[6] = "Julio"; theMonth[7] = "Agosto"; theMonth[8] = "Setiembre";
	theMonth[9] = "Octubre"; theMonth[10] = "Noviembre"; theMonth[11] = "Diciembre";
	whichDay = theDay[dateNow.getDay()];
	whichDate = dateNow.getDate();
	whichMonth = theMonth[dateNow.getMonth()];
	whichYear = dateNow.getFullYear();
	
	if (navigator.appName == ("Netscape")) {
		if (whichYear < 99)
			whichYear = whichYear + 0;
	}
	
	if (navigator.appName == ("Microsoft Internet Explorer")) {
		whichYear = whichYear + 0;
	}
	
	whichYear = "" + whichYear;
	if (m==0) document.writeln(whichDate + " de " + whichMonth + " de " + whichYear);
	if (m==1) document.writeln((dateNow.getMonth()+1) + sep + whichDate + sep + whichYear.substring(2,4));
	if (m==2) document.writeln(whichDate + sep + (dateNow.getMonth()+1) + sep + whichYear.substring(2,4));
	if (m==3) document.writeln((dateNow.getMonth()+1) + sep + whichDate + sep + whichYear);
	if (m==4) document.writeln(whichDate + sep + (dateNow.getMonth()+1) + sep + whichYear);
	if (m==5) document.writeln(whichDate + sep + whichMonth + sep + whichYear);
	if (m==6) document.writeln(whichDay);
	if (m==7) document.writeln(whichMonth);
	if (m==9) document.writeln(whichDate);
	if (m==8) document.writeln(dateNow.getMonth()+1);
	if (m==10) document.writeln(whichYear);
	//writeDate(0,"/");
}

// Muestra una dirección de e-mail
function MostrarEmail(usuario, dominio) {
	user = usuario;
	domain = dominio;
	document.write('<a href=\"mailto:' + user + '@' + domain + '\" title=\"Enviar e-mail a ' + user + '@' + domain + '\">');
	document.write(user + '@' + domain + '</a>');
}

window.addEvent('domready', function() {

	var ejes = new Fx.Slide('box_ejes');
	var acciones = new Fx.Slide('box_am');
	var actividades = new Fx.Slide('box_actividades');
	
	ejes.hide();
	acciones.hide();
	actividades.hide();
	
	$('link_ejes').addEvent('click', function(e)
	{
		e = new Event(e);
		ejes.toggle();
		e.stop();
	});

	$('link_am').addEvent('click', function(e)
	{
		e = new Event(e);
		acciones.toggle();
		e.stop();
	});
	
	$('link_ac').addEvent('click', function(e)
	{
		e = new Event(e);
		actividades.toggle();
		e.stop();
	});
	
});