/* [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 POS_TARGET=8;
var theSitetree=[ 
	['PAGE','2201',jdecode('INTRODUCCION'),jdecode(''),'/2201.html','true',[],'',''],
	['PAGE','2222',jdecode('ESCANNER+Y+MAS.'),jdecode(''),'/2222.html','true',[],'',''],
	['PAGE','6601',jdecode('INTERFACES+'),jdecode(''),'/6601.html','true',[],'',''],
	['PAGE','6622',jdecode('PROGR.DE+LLAVES'),jdecode(''),'/6622.html','true',[],'',''],
	['PAGE','118634',jdecode('DISEL+INTERFACES'),jdecode(''),'/118634.html','true',[],'',''],
	['PAGE','36101',jdecode('REMATES+DEL+MES'),jdecode(''),'/36101.html','true',[],'',''],
	['PAGE','31601',jdecode('CONTACTENOS+AQUI%3A'),jdecode(''),'/31601.html','true',[],'',''],
	['PAGE','32901',jdecode('COMPRAS+Y+ENTREGAS'),jdecode(''),'/32901.html','true',[],'',''],
	['PAGE','103323',jdecode('FOTOS+Y+CURSOS+2010+++'),jdecode(''),'/103323.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Champagne';
theSitetree.paletteFamily='426388';
theSitetree.keyvisualId='11062';
theSitetree.keyvisualName='kv_11062.jpg';
theSitetree.fontsetId='31943';
theSitetree.graphicsetId='13786';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='426388';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Champagne',
				paletteFamily: 	'426388',
				keyvisualId: 	'11062',
				keyvisualName: 	'kv_11062.jpg',
				fontsetId: 		'31943',
				graphicsetId: 	'13786',
				contentColor: 	'000000',
				contentBGColor: '426388',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2222',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '2222',
internalId:  '1501',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-1661']={
webappId:    '7008',
documentId:  '32901',
internalId:  '1661',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20100629-135259'
};
webappMappings['1501']=webappMappings['1501-10204251']={
webappId:    '1501',
documentId:  '2222',
internalId:  '10204251',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2222',
internalId:  '',
customField: '20100611-212247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20100629-135347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6622',
internalId:  '',
customField: '20100531-125230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36101',
internalId:  '',
customField: '20100531-140713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20100614-210153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32901',
internalId:  '',
customField: '20100601-152901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118634',
internalId:  '',
customField: '20091031-205840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103323',
internalId:  '',
customField: '20100628-143754'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INFFKJ';
var companyName   = 'SCANNER+Y+HERRAMIENTAS+NAYARIT';
var htmlTitle	  = '';
var metaKeywords  = 'autoexacto.com+%22escanerauto.com%22+escannerauto%2C+escanerauto+SCANNER+PARA+AUTO+AUTOEXACTO.COM++VAG+COM++ELM+327++T300++++ESCANNER+PARA++AUTO++SCANNER+PARA+DIAGNOSTICOS+HERRAMIENTAS+Y+REFACCIONES+PARA+DIAGNOSTICOS+AUTOMOTRICES++AUTOREFACCIONES.++ESCANNER.ESCANERS.+REFACCIONES+PARA+MECANICOS.+HERRAMIENTA+MECANICA.++LAMPARAS+DE+TIEMPO.+PISTOLAS+DE+TIEMPO.+LECTORES+DE+CODIGOS+DE+FALLA.+SCANER+PARA+AUTOS+Y+CAMIONETAS.+REFACCIONES+PARA+AUTOS.+ELECTRONICA+Y+LASER+PARA.TODO+PARA+EL+MECANICO.+PROGRAMADORES+DE+LLAVES.+HERRAMIENTAS+PARA+CERRAJEROS.+CLONADORES+DE+LLAVES.+PROGRAMADORES+DE+LLAVES.+AUTODIAGNOSTICOS.++AUTOS.+TERMOMETROS+LASER.AUTOS+Y+REFFACCIONES.REMATE+DE+ESCANERS+AUTOMOTRICES+OFERTAS+UNICAS+DE+ESCANER+PROMOCION+DE+ESCANER+AHORRA++COMPRA+TU+ESCANER.+MP3++USB+REFFACIONES++REFACCIONES+VW++++AUTOPARTES++VW++PIEZAS+DE+VW++HERRAMIENTAS+SCANER++ESCANNER+++VCM++IDS++TECH2++OPEL+++FORD++GM++CRYSLER';
var metaContents  = 'autoexacto.com+%22escanerauto.com%22+escannerauto%2C+escanerauto++VAG+COM++SCANNER+PARA+AUTO++cursos++COMPUTADORAS+DE+AUTO+SCANNER+PARA+DIAGNOSTICO+REFACCIONES.+HERRAMIENTAS.+PROGRAMADORES+DE+LLAVES.+CLONADORES+DE+LLAVES.+ESCANNER+PARA+AUTOS.+ESCANER+AUTOMOTRIZ%2C+TERMOMETROS+LASER%2C+PISTOLAS+DE+TIEMPO%2CLAMPARAS+DE+TIEMPO%2CREFACCIONES+PARA+AUTO+Y+CAMIONETAS%2CADAPTADORES.USB+MP3+refacciones+vw+AUTOPARTES+DIAGNOSTICOS+AUTOMOTRIZ+MP3++MEMORIAS+USB+++CELULARES.+++COMPUTADORAS++T300++VAG+COM+ELM+327++VCM+++IDS++ESCANNER+++VCM++IDS++TECH2++OPEL+++FORD++GM++CRYSLER++';
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();
};
