/* [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','4754',jdecode('Inicio'),jdecode(''),'/4754.html','true',[],''],
	['PAGE','4811',jdecode('Qui%C3%A9nes+somos'),jdecode(''),'/4811.html','true',[],''],
	['PAGE','4946',jdecode('Promociones'),jdecode(''),'/4946/index.html','true',[ 
		['PAGE','4892',jdecode('Llantas'),jdecode(''),'/4946/4892.html','true',[],''],
		['PAGE','4919',jdecode('Frenos'),jdecode(''),'/4946/4919.html','true',[],''],
		['PAGE','4865',jdecode('Amortiguadores'),jdecode(''),'/4946/4865.html','true',[],'']
	],''],
	['PAGE','4838',jdecode('Productos'),jdecode(''),'/4838/index.html','true',[ 
		['PAGE','83401',jdecode('Michelin'),jdecode(''),'/4838/83401.html','true',[],''],
		['PAGE','83428',jdecode('Goodyear'),jdecode(''),'/4838/83428.html','true',[],''],
		['PAGE','83455',jdecode('Dunlop'),jdecode(''),'/4838/83455.html','true',[],''],
		['PAGE','83482',jdecode('Maxxis'),jdecode(''),'/4838/83482.html','true',[],'']
	],''],
	['PAGE','83509',jdecode('Nexen'),jdecode(''),'/83509.html','true',[],''],
	['PAGE','90701',jdecode('Pirelli'),jdecode(''),'/90701.html','true',[],''],
	['PAGE','90728',jdecode('Yokohama'),jdecode(''),'/90728.html','true',[],''],
	['PAGE','90755',jdecode('Continental'),jdecode(''),'/90755.html','true',[],''],
	['PAGE','90782',jdecode('Bfgoodrich'),jdecode(''),'/90782.html','true',[],''],
	['PAGE','4973',jdecode('Servicios'),jdecode(''),'/4973.html','true',[],''],
	['PAGE','88001',jdecode('lodi+tips'),jdecode(''),'/88001.html','true',[],''],
	['PAGE','5000',jdecode('Ubicaci%C3%B3n'),jdecode(''),'/5000.html','true',[],''],
	['PAGE','5027',jdecode('Contacto'),jdecode(''),'/5027/index.html','true',[ 
		['PAGE','85984',jdecode('Contacto+%28follow+up+page%29'),jdecode(''),'/5027/85984.html','false',[],'']
	],''],
	['PAGE','88501',jdecode('Pedidos'),jdecode(''),'/88501.html','true',[],'']];
var siteelementCount=22;
theSitetree.topTemplateName='Pixelportal';
theSitetree.paletteFamily='333366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10375';
theSitetree.graphicsetId='10537';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				name: 			'Pixelportal',
				paletteFamily: 	'333366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10375',
				graphicsetId: 	'10537',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1001']=webappMappings['1001-avec10inxe67d75ee7a176cf5df8']={
webappId:    '1001',
documentId:  '5027',
internalId:  'avec10inxe67d75ee7a176cf5df8',
customField: ''
};
webappMappings['1001']=webappMappings['1001-avec10inxe67d75ee7a176cf5df8']={
webappId:    '1001',
documentId:  '85984',
internalId:  'avec10inxe67d75ee7a176cf5df8',
customField: 'followUp'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4754',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4754',
internalId:  '',
customField: '20051129-101018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4946',
internalId:  '',
customField: '20070511-173512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4892',
internalId:  '',
customField: '20090402-174359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4919',
internalId:  '',
customField: '20090402-174515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4865',
internalId:  '',
customField: '20090402-174710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4811',
internalId:  '',
customField: '20051209-121037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4838',
internalId:  '',
customField: '20051128-105646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83401',
internalId:  '',
customField: '20051125-141010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83428',
internalId:  '',
customField: '20051125-141532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83455',
internalId:  '',
customField: '20051125-141715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83482',
internalId:  '',
customField: '20051125-142003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83509',
internalId:  '',
customField: '20051125-142126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90701',
internalId:  '',
customField: '20060106-164236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90728',
internalId:  '',
customField: '20060106-165623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90755',
internalId:  '',
customField: '20060106-173058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90782',
internalId:  '',
customField: '20060106-172103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4973',
internalId:  '',
customField: '20051130-155100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88001',
internalId:  '',
customField: '20051130-152323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5000',
internalId:  '',
customField: '20051129-100333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5027',
internalId:  '',
customField: '20051128-105844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85984',
internalId:  '',
customField: '20051125-163008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88501',
internalId:  '',
customField: '20070511-152626'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INXE67';
var companyName   = '3+Generaciones%2C+desde+1950';
var htmlTitle	  = 'Lo+dice+Lodi%3A+LODI+LLANTAS';
var metaKeywords  = '';
var metaContents  = '';
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();
};
