/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var theSitetree=[ 
	['PAGE','501',jdecode('INICIO'),jdecode(''),'/501.html','true',[],''],
	['PAGE','552',jdecode('HISTORIA'),jdecode(''),'/552.html','true',[],''],
	['PAGE','594',jdecode('NUESTRO+COMPROMISO'),jdecode(''),'/594.html','true',[],''],
	['PAGE','636',jdecode('SERVICIOS'),jdecode(''),'/636.html','true',[],''],
	['PAGE','657',jdecode('MANTENIMIENTO'),jdecode(''),'/657.html','true',[],''],
	['PAGE','678',jdecode('CONSEJOS+PARA+SU+AUTO'),jdecode(''),'/678.html','true',[],''],
	['PAGE','10401',jdecode('HIGH+PERFORMANCE'),jdecode(''),'/10401.html','true',[],''],
	['PAGE','5001',jdecode('PROMOCIONES'),jdecode(''),'/5001.html','true',[],''],
	['PAGE','615',jdecode('D%C3%93NDE+ENCONTRARNOS'),jdecode(''),'/615.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='FFCC33';
theSitetree.keyvisualId='965';
theSitetree.keyvisualName='autofahrer.jpg';
theSitetree.fontsetId='166';
theSitetree.graphicsetId='199';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'NewYork',
				paletteFamily: 	'FFCC33',
				keyvisualId: 	'965',
				keyvisualName: 	'autofahrer.jpg',
				fontsetId: 		'166',
				graphicsetId: 	'199',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000066',
				b_color: 		'FFCC33',
				c_color: 		'000000',
				d_color: 		'406BC0',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20070615-134741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20060831-170739'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INXF37';
var companyName   = '++++++++++++++GUZ-FRAN';
var htmlTitle	  = 'GUZ-FRAN+Ingenier%C3%ADa+Automotriz';
var metaKeywords  = 'guz-fran%2C+guzfran%2C+autom%C3%B3viles%2C+diagn%C3%B3stico%2C+afinaciones%2C+fuel+injection%2C+carburador%2C+frenos%2C+ABS%2C+sistema+el%C3%A9ctrico%2C+electr%C3%B3nica%2C+sensores%2C+high+performance%2C+cambio+de+aceite%2C+lubricaci%C3%B3n%2C+aguascalientes%2C+certificaci%C3%B3n%2C+cumplimiento+ambiental%2C+David+Guzm%C3%A1n%2C+Ex-a-tec%2C+las+arboledas%2C+lindavista%2C+mantenimiento%2C+taller%2C+servicio%2C+scanner%2C+Art%C3%ADculos+High-Performance%2C+Eibach%2C+Bilstein%2C+Filtros+de+alto+flujo+KN%2C+Cables+Nology%2C+Buj%C3%ADas+Iridium%2C+Cables+Imola%2C+';
var metaContents  = 'Servicios+para+automovil%2C+mantenimiento+de+autom%C3%B3viles%2C+dos+sucursales+en+Aguascalientes%2C+atendidos+por+sus+propietarios+David+Eduardo+Guzm%C3%A1n+Franco+y+el+Ing.+David+Eduardo+Guzm%C3%A1n+Morones.+Reparaciones+de+fallas.+Servicio+de+frenos%2C+cambio+de+aceite%2C+engrasado.+Electr%C3%B3nica+y+sensores.+Diagn%C3%B3stico+computarizado.+Art%C3%ADculos+High-Performance%2C+Eibach%2C+Bilstein%2C+Filtros+de+alto+flujo+KN%2C+Cables+Nology%2C+Buj%C3%ADas+Iridium%2C+Cables+Imola-+';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};
