var botonesIniciados=false;
function buttons() {

	var i = 1;
	var ids;
	while(i < 10){
		try{
			ids='C'+i*10;
			window.document.all(ids).onmouseover= function(){Cambiafondo(this.id);};
			window.document.all(ids).onmouseout= function(){Cambiafondo2(this.id);};
			window.document.all(ids).onclick= function(){Navega(this.id);};
			i++;
		}
		catch(e){i++;}
	}
	//alert("carga");
	/*Iniciar submenues*/
	/*
	ids='sub'+1;
			window.document.all(ids).onmouseover= function(){Cambiafondo(this.id);};
			window.document.all(ids).onmouseout= function(){Cambiafondo2(this.id);};
			window.document.all(ids).onclick= function(){AbreCierra(this.id);};
			*/
	botonesIniciados=true;
}
//--------------------------------------------------------------------------------
function Cambiafondo(id) {
	if(botonesIniciados){
		try{
			window.document.all(id).fade= 'true';
			glow(id,0);
		}
		catch(e){}
	}
}
//--------------------------------------------------------------------------------
function Cambiafondo2(id) {
	if(botonesIniciados){
		try{
			window.document.all(id).fade='false';
			window.document.all(id).style.backgroundColor="";
			window.document.all(id).style.color="";
			window.document.all(id).style.paddingLeft= "";
			window.document.all(id).style.paddingBottom= "";
		
		}
		catch(e){}
	}
}
//--------------------------------------------------------------------------------
function Navega(id){
	if(botonesIniciados){
		var iMatch;
		var k=0;
		try{
		var donde = window.document.all(id).getAttribute("sIr");
			if( donde != 'inicio'){// si no es inicio, entonces te envio a la categoría seleccionada
				window.location= 'seccion.aspx?id=' + donde;
			}else{
				window.location= 'default.aspx';
			}
		}
		catch(e){alert("En Construcción")}
	}
}
//--------------------------------------------------------------------------------
function AbreCierra(id){
	if(botonesIniciados){
		var iMatch;
		var k=0;
		try{
		if(window.document.all(window.document.all(id).getAttribute("sMenu")).style.display != "inline"){
				window.document.all(window.document.all(id).getAttribute("sMenu")).style.display = "inline";
			}else{
				window.document.all(window.document.all(id).getAttribute("sMenu")).style.display = "none";
			}
		}
		catch(e){alert(window.document.all(id).getAttribute("sMenu"));}
	}
}
//------------------------------------------------------------------------------
function loadXML(nombre)
{
	if (document.implementation && document.implementation.createDocument)
	{
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.onload = llenar(nombre);
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.onreadystatechange = function () {
			if (xmlDoc.readyState == 4) llenar(nombre)
		};
 	}
	else
	{
		alert('esta pagina no es soportada por su navegador por favor pongase en contacto con el administrador');
		return;
	}
	
	xmlDoc.async=false;
	xmlDoc.load('home.xml');
	llenar(nombre);

};

function llenar(idCarga)
{
	var x = xmlDoc.getElementsByTagName('ltconsulting');
	window.document.all(idCarga).innerText = x[0].childNodes[0].text;
};

//--------------------------------------------------------------------------------
/* Fading Text */
var rate = "50"; // Cambia la velocidad
var fondo = new Array(10);
var letra = new Array(10);

fondo[0] = "#DBDBDB";
fondo[1] = "#CACACA";
fondo[2] = "#B5B5B5";
fondo[3] = "#A0A0A0";
fondo[4] = "#8B8B8B";
fondo[5] = "#707070";
fondo[6] = "#606060";
fondo[7] = "#4D4D4D";
fondo[8] = "#3C3C3C";
fondo[9] = "#2F2F2F";

letra[0] = "#CFCFCF";
letra[1] = "#6cced0";
letra[2] = "#accbd4";
letra[3] = "#9fcad6";
letra[4] = "#90c8d8";
letra[5] = "#80c6db";
letra[6] = "#6bc4de";
letra[7] = "#59d2e1";
letra[8] = "#4FC1E2";
letra[9] = "#00CCFF";

function glow(id,cnum)
{
	if(cnum < fondo.length-1 && window.document.all(id).fade == 'true')
	{
		//window.document.all(id).style.backgroundColor= fondo[cnum];
		window.document.all(id).style.color= letra[cnum];
		//window.document.all(id).style.paddingLeft= 28 - cnum ;
		cnum++;
		window.setTimeout("glow('"+ id +"',"+ cnum +")",rate);
	}
}