var defaultFontSize = 76;
var currentFontSize = defaultFontSize;
var tnt = 6;

//Color de fondo para el estado activo
var bgColor1 = ["#003873", "#003873", "images/home.jpg"];
var bgColor2 = ["#0179CB", "#0179CB", "images/stage_02.jpg"];
var bgColor3 = ["#FF4F07", "#FF4F07", "images/stage_03.jpg"];
var bgColor4 = ["#009933", "#009933", "images/stage_04.jpg"];
var bgColor5 = ["#A62E2F", "#A62E2F", "images/stage_05.jpg"];
var bgColor6 = ["#7E4100", "#7E4100", "images/stage_06.jpg"];

//Arreglo multidimensional con los links de cada seccion
var navCont = [new Array(
					new Array("Links",
						new Array("Our mission", "http://www.fundaciontelevisa.org/english/pages/mission.html"),
						new Array("Annual Report 2008", "http://www.fundaciontelevisa.org/english/pages/annual.html")
					),
					new Array("",
						new Array("Fundaci&oacute;n in TV", "http://www.fundaciontelevisa.org/english/pages/fundacionintv.html"),
						new Array("Soap operas with a cause", "http://www.fundaciontelevisa.org/english/pages/soapoperas.html")
						
						),
					new Array("",
						new Array("Campaigns", "http://www.fundaciontelevisa.org/pages/campaigns.html"),
						new Array("Goals for Mexico", "http://www.fundaciontelevisa.org/english/pages/nutricion/goals.html")
					)
				),
				new Array(
					new Array("Education",
						new Array("<b>Area objectives</b>", "http://www.fundaciontelevisa.org/english/pages/areaobjectives.html"),
						new Array("Values", "http://www.fundaciontelevisa.org/english/pages/values.html"),
						new Array("Knowledge competition", "http://www.fundaciontelevisa.org/english/pages/educacion/competition.html")
						),
					
					new Array("Technology for the education",
						new Array("Goals for Mexico", "http://www.fundaciontelevisa.org/english/pages/educacion/goalsclassrooms.html"),
						new Array("Redondeo", "http://www.fundaciontelevisa.org/english/pages/educacion/roundsum.html"),
						new Array("Touchdowns with a cause", "http://www.fundaciontelevisa.org/english/pages/educacion/touchdowns.html")
					),
					
					new Array("Training",
						new Array("Becalos", "http://www.fundaciontelevisa.org/english/pages/educacion/becalos.html"),
						new Array("Teacher's training", "http://www.fundaciontelevisa.org/english/pages/educacion/teachers.html")
					),
					new Array("Reading encouragement",
						new Array("Goals for Mexico", "http://www.fundaciontelevisa.org/english/pages/educacion/goalslibraries.html"),
						new Array("Run for the education", "http://www.fundaciontelevisa.org/english/pages/educacion/run.html"),
						new Array("Reading to dream", "http://www.fundaciontelevisa.org/english/pages/educacion/reading.html")
					)
				),
				new Array(
					new Array("Health and Nutrition",
						new Array("Health", "http://www.fundaciontelevisa.org/english/pages/salud/health.html"),
						new Array("Nutrition", "http://www.fundaciontelevisa.org/english/pages/nutricion/nutrition.html"),
						new Array("If you dream is possible", "http://www.fundaciontelevisa.org/english/pages/salud/dream.html")
					
					),
					
					
					new Array("Organs Donation and Transplants",
						new Array("Cornea transplants", "http://www.fundaciontelevisa.org/english/pages/salud/goalscornea.html"),
						new Array("Kidney transplants", "http://www.fundaciontelevisa.org/english/pages/salud/goalskidney.html")
						
					),
					
					new Array("Aural Weakness battle",
						new Array("10 km race of Televisa Deportes", "http://www.fundaciontelevisa.org/english/pages/salud/race.html"),
						new Array("Touchdowns with a cause", "http://www.fundaciontelevisa.org/english/pages/salud/touchdownshearing.html"),
						new Array("Universal Children's Day - McDonalds", "http://www.fundaciontelevisa.org/english/pages/salud/childrensday.html")
						
						

					)
					
				
				),
				new Array(
					new Array("Housing",
						new Array("Housing", "http://www.fundaciontelevisa.org/english/pages/vivienda/housing.html"),
						new Array("Building Alliances", "http://www.fundaciontelevisa.org/english/pages/vivienda/alliances.html")
					),
					new Array("Environment",
						new Array("Televisa Verde", "http://www.fundaciontelevisa.org/english/pages/vivienda/televisaverde.html")
					)
				),
				new Array(
					new Array("Links",
						new Array("Visual Arts", "http://www.fundaciontelevisa.org/english/pages/vivienda/visualarts.html")
					)
				),
				new Array(
					new Array("Links",
						new Array("Cultural Promotion", "http://www.fundaciontelevisa.org/english/pages/vivienda/culturalspreading.html")
						
					)
				)
				];
function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function showNav(idItem) {
	var tdWidth = Math.round(100 / navCont[idItem - 1].length);
	var out = '';
	out = '<table width="100%" border="0" cellpadding="0" cellspacing="10" class="nav_item' + idItem + '"><tr>';
	for(var i = 0; i < navCont[idItem - 1].length; i++){
		if( navCont[idItem - 1].length > 1){
			if(navCont[idItem - 1][i][0] != ""){
				out += '<td class="titulo_navcell">' + navCont[idItem - 1][i][0] + '</td>';
			} else {
				out += '<td class="titulo_navcell">&nbsp;</td>';
			}
		} else {
			out += '<td colspan="' + navCont[idItem - 1][i].length + '" class="titulo_navcell">' + navCont[idItem - 1][i][0] + '</td>';
		}
	}
	out += '</tr><tr>';
	for(var i = 0; i < navCont[idItem - 1].length; i++){
		if( navCont[idItem - 1].length > 1){
			out += '<td><ul>';
			for(var j = 1; j < navCont[idItem - 1][i].length; j++){
				out += '<li><a href="' + navCont[idItem - 1][i][j][1] +'">' + navCont[idItem - 1][i][j][0] + '</a></li>';
			}
			out += '</ul></td>';
		} else {
			for(var j = 1; j < navCont[idItem - 1][i].length; j++){
				out += '<td><ul><li><a href="' + navCont[idItem - 1][i][j][1] +'">' + navCont[idItem - 1][i][j][0] + '</a></ul></li></td>';
			}
		}
	}
	out += '</tr></table>';
	
	//VAR PARA ESTILOS
	if (document.getElementById || document.all) {		
		var el = (document.getElementById) ? document.getElementById("subNavInline"): document.all["subNavInline"];
		if (el && typeof el.innerHTML != "undefined") el.innerHTML = out;
		
		for(var i = 0; i < tnt; i++){
			var navItem =  (document.getElementById) ? document.getElementById("main_nav" + (i + 1)): document.all["main_nav" + (i + 1)];	
			navItem.style.backgroundColor= eval("bgColor" + (i + 1))[0];
			navItem.style.borderBottom = "solid #FFFFFF 1px";
		}
		
		navItem =  (document.getElementById) ? document.getElementById("main_nav" + idItem): document.all["main_nav" + idItem];
		navItem.style.backgroundColor= eval("bgColor" + idItem)[1];
		navItem.style.borderBottom = "none";
		
		stageImg = (document.getElementById) ? document.getElementById("stage"): document.all["stage"];
		if(stageImg != undefined || stageImg != null) stageImg.style.backgroundImage = "url(" + eval("bgColor" + idItem)[2] + ")";
   }
}
function writeFecha(){
	monthNames = new Array(
	"enero",
	"febrero",
	"marzo",
	"abril",
	"mayo",
	"junio",
	"julio",
	"agosto",
	"sept.",
	"octubre",
	"noviembre",
	"diciembre"
	);
	theDate = new Date();
	document.write(theDate.getDate() + " de " + monthNames[theDate.getMonth()] + " de " + theDate.getFullYear());
}