/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','66801',jdecode('Personaliza%C3%A7%C3%A3o'),jdecode(''),'/66801.html','true',[],'',''],
	['PAGE','76012',jdecode('Customiza%C3%A7%C3%A3o'),jdecode(''),'/76012.html','true',[],'',''],
	['PAGE','62401',jdecode('Capacetes'),jdecode(''),'/62401.html','true',[],'',''],
	['PAGE','76054',jdecode('Carros'),jdecode(''),'/76054.html','true',[],'',''],
	['PAGE','98412',jdecode('Fonte%2Fcascata'),jdecode(''),'/98412.html','true',[],'',''],
	['PAGE','99012',jdecode('Gabinetes%2Foutros'),jdecode(''),'/99012.html','true',[],'',''],
	['PAGE','100112',jdecode('Miniaturas'),jdecode(''),'/100112.html','true',[],'',''],
	['PAGE','100133',jdecode('Im%C3%B3veis'),jdecode(''),'/100133.html','true',[],'',''],
	['PAGE','104612',jdecode('Imagens'),jdecode(''),'/104612.html','true',[],'',''],
	['PAGE','104633',jdecode('Instrumentos'),jdecode(''),'/104633.html','true',[],'',''],
	['PAGE','620',jdecode('Contato'),jdecode(''),'/620.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Bigcity_Space';
theSitetree.paletteFamily='418980';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='21075';
theSitetree.graphicsetId='13167';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='418980';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Bigcity_Space',
				paletteFamily: 	'418980',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'21075',
				graphicsetId: 	'13167',
				contentColor: 	'FFFFFF',
				contentBGColor: '418980',
				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['7060']=webappMappings['7060-99963c6198eb638beef9b7d298a8dde4']={
webappId:    '7060',
documentId:  '62401',
internalId:  '99963c6198eb638beef9b7d298a8dde4',
customField: 'language:pt;country:BR;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104612',
internalId:  '',
customField: '20091206-090214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104633',
internalId:  '',
customField: '20091206-090217'
};
webappMappings['7060']=webappMappings['7060-d5b02e5d00f0e6fabb8f153b2dc7007c']={
webappId:    '7060',
documentId:  '99012',
internalId:  'd5b02e5d00f0e6fabb8f153b2dc7007c',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-0bff3f1573e69b5fcd8f56c0a3a75af8']={
webappId:    '7060',
documentId:  '104633',
internalId:  '0bff3f1573e69b5fcd8f56c0a3a75af8',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-abbe9484e6654bfceb5bd12e3c9b2cd2']={
webappId:    '7060',
documentId:  '66801',
internalId:  'abbe9484e6654bfceb5bd12e3c9b2cd2',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-d82085bfb749c5c978670bb37816a759']={
webappId:    '7060',
documentId:  '104612',
internalId:  'd82085bfb749c5c978670bb37816a759',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20091021-145649'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '401',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76012',
internalId:  '',
customField: '20090321-203434'
};
webappMappings['7060']=webappMappings['7060-4235fc49d8b97dba6fd121adb41f9615']={
webappId:    '7060',
documentId:  '100112',
internalId:  '4235fc49d8b97dba6fd121adb41f9615',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '620',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '62401',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-00334fb3ab59b4597be858d188d2908e']={
webappId:    '7060',
documentId:  '76054',
internalId:  '00334fb3ab59b4597be858d188d2908e',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99012',
internalId:  '',
customField: '20091021-144212'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '66801',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-2ed6295c36ee17618cbd03199eeae847']={
webappId:    '7060',
documentId:  '100133',
internalId:  '2ed6295c36ee17618cbd03199eeae847',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76054',
internalId:  '',
customField: '20090321-203532'
};
webappMappings['7060']=webappMappings['7060-06b84d4546bcdd9826abae74c44e05fe']={
webappId:    '7060',
documentId:  '76012',
internalId:  '06b84d4546bcdd9826abae74c44e05fe',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20100122-084609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62401',
internalId:  '',
customField: '20081123-101621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98412',
internalId:  '',
customField: '20091021-135104'
};
webappMappings['7060']=webappMappings['7060-0665b450449d1d8faed8f6658f2b98aa']={
webappId:    '7060',
documentId:  '98412',
internalId:  '0665b450449d1d8faed8f6658f2b98aa',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66801',
internalId:  '',
customField: '20081130-085702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100112',
internalId:  '',
customField: '20091101-064226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100133',
internalId:  '',
customField: '20091101-064230'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZGIC';
var companyName   = 'VIPER+PROJETOS';
var htmlTitle	  = 'VIPER+PROJETOS+Customiza%C3%A7%C3%A3o+e+Personaliza%C3%A7%C3%A3o';
var metaKeywords  = 'aerografia%2C+maquete%2C+casemod%2C+garage%2C+fonte%2C+abajur%2C+lustre%2C+capacete%2C+ba%C3%BA%2C+kit+moto%2C+decora%C3%A7%C3%A3o%2C+projetos%2C+tuning%2C+grafite%2C+personaliza%C3%A7%C3%A3o%2C+desenho%2C+arte.';
var metaContents  = 'aerografia%2C+maquete%2C+casemod%2C+garage%2C+fonte%2C+abajur%2C+lustre%2C+capacete%2C+ba%C3%BA%2C+kit+moto%2C+decora%C3%A7%C3%A3o%2C+projetos%2C+tuning%2C+grafite%2C+personaliza%C3%A7%C3%A3o%2C+desenho%2C+arte.';
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();
};
