/* [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','1801',jdecode('Inicial'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','56912',jdecode('N%C3%83O+FUJA'),jdecode(''),'/56912.html','true',[],'',''],
	['PAGE','1852',jdecode('ENVIE+O+SEU+ALERTA+'),jdecode(''),'/1852.html','false',[],'',''],
	['PAGE','1873',jdecode('MENSAGENS'),jdecode(''),'/1873.html','false',[],'',''],
	['PAGE','15301',jdecode('Contato'),jdecode(''),'/15301.html','true',[],'',''],
	['PAGE','21812',jdecode('HOME'),jdecode(''),'/21812.html','true',[],'',''],
	['PAGE','29212',jdecode('SEGURO%2FROUBO'),jdecode(''),'/29212.html','false',[],'',''],
	['PAGE','33912',jdecode('Imprensa'),jdecode(''),'/33912.html','true',[],'',''],
	['PAGE','46112',jdecode('Rastread.+MOTO'),jdecode(''),'/46112.html','true',[],'',''],
	['PAGE','46612',jdecode(''),jdecode(''),'/46612.html','true',[],'',''],
	['PAGE','46633',jdecode(''),jdecode(''),'/46633.html','true',[],'',''],
	['PAGE','45212',jdecode(''),jdecode(''),'/45212.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Vehicle';
theSitetree.paletteFamily='0B0B0B';
theSitetree.keyvisualId='11864';
theSitetree.keyvisualName='kv_11864.jpg';
theSitetree.fontsetId='33168';
theSitetree.graphicsetId='14084';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0B0B0B';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vehicle',
				paletteFamily: 	'0B0B0B',
				keyvisualId: 	'11864',
				keyvisualName: 	'kv_11864.jpg',
				fontsetId: 		'33168',
				graphicsetId: 	'14084',
				contentColor: 	'FFFFFF',
				contentBGColor: '0B0B0B',
				a_color: 		'0B0B0B',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20100824-193942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20090626-072157'
};
webappMappings['7008']=webappMappings['7008-8789']={
webappId:    '7008',
documentId:  '1852',
internalId:  '8789',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20090629-090429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15301',
internalId:  '',
customField: '20100721-233439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21812',
internalId:  '',
customField: '20100721-233532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33912',
internalId:  '',
customField: '20091022-133901'
};
webappMappings['7008']=webappMappings['7008-10237']={
webappId:    '7008',
documentId:  '15301',
internalId:  '10237',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29212',
internalId:  '',
customField: '20091006-145546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45212',
internalId:  '',
customField: '20091212-122015'
};
webappMappings['7008']=webappMappings['7008-15927']={
webappId:    '7008',
documentId:  '1801',
internalId:  '15927',
customField: 'language:pt;country:BR;'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '1801',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46112',
internalId:  '',
customField: '20100824-194209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46633',
internalId:  '',
customField: '20091212-125058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46612',
internalId:  '',
customField: '20091212-125133'
};
webappMappings['1501']=webappMappings['1501-15547279']={
webappId:    '1501',
documentId:  '1801',
internalId:  '15547279',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56912',
internalId:  '',
customField: '20100721-233204'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INH8WE';
var companyName   = 'ANTIROUBO+-previnir+%C3%A9+melhor+que+remediar';
var htmlTitle	  = 'RASTREADOR+%3BRASTREADOR';
var metaKeywords  = 'RASTREADOR+E+BLOQUEDOR+P%2F+MOTO%2C+CARRO%2C+CAMINHAO%2C+FROTAS%2C+AUTOMOVEIS+CAMINHOES%2C+FUSCA%2C+KOMBI%2C+FIORIONO%2C+AUDI%2C+BMW%2C+PEOUGEOT%2C+VANS%2C+CAMINHONETES%2C+PERUAS%2C+TAXIS%2C+RASTREADOR%2C+LOCALIZADOR%2C+TELETRIM%2CGRABER%2C+SASCAR%2C+AUTOTRACK%2C+HYUNDAI%2C+KIA%2CIMPORTADOS%0D%0A%0D%0A';
var metaContents  = 'RASTREADOR+E+BLOQUEDOR+P%2F+MOTO%2C+CARRO%2C+CAMINHAO%2C+FROTAS%2C+AUTOMOVEIS%0D%0A%0D%0Aalarme+residencial+e+patrimonial%2C+ITURAN%2C+o+unico+%2Csem+necessidade+de+utilizar+o+sistema+de+telefonia+e+mais%2C+com+um+simples+toque+no+bot%C3%A3o+de+panico%2C+que+cabe+na+palma+de+sua+mao%2C+voce+aciopnar%C3%A1+toda+a+extrutura+de+pronta+resposta+Ituran+para+seu+apoio.+Em+casa+%2C+no+comercio+no+condom%C3%ADnio+clube+etc%2C+voce+ter%C3%A1+um+apoio+de+seguran%C3%A7a+por+meio+de+um+alarme+monitorado+24+horas+por+dia.+';
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();
};
