/* [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','3001',jdecode('Inicial'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','3073',jdecode('Quem+somos'),jdecode(''),'/3073.html','true',[],'',''],
	['PAGE','10723',jdecode('BOX+ELEGANCE'),jdecode(''),'/10723.html','true',[],'',''],
	['PAGE','9623',jdecode('BOX+DE+ABRIR'),jdecode(''),'/9623.html','true',[],'',''],
	['PAGE','8523',jdecode('Jateados'),jdecode(''),'/8523.html','true',[],'',''],
	['PAGE','8544',jdecode('servi%C3%A7os+residenciais'),jdecode(''),'/8544.html','true',[],'',''],
	['PAGE','8565',jdecode('Comerciais'),jdecode(''),'/8565.html','true',[],'',''],
	['PAGE','5423',jdecode('Servi%C3%A7os+em+geral'),jdecode(''),'/5423.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='666633';
theSitetree.keyvisualId='9241';
theSitetree.keyvisualName='kv3.swf';
theSitetree.fontsetId='17363';
theSitetree.graphicsetId='12761';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Transluszent',
				paletteFamily: 	'666633',
				keyvisualId: 	'9241',
				keyvisualName: 	'kv3.swf',
				fontsetId: 		'17363',
				graphicsetId: 	'12761',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20100314-202205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3073',
internalId:  '',
customField: '20100201-175413'
};
webappMappings['7060']=webappMappings['7060-2f2266a85e02c655238ee536067e865b']={
webappId:    '7060',
documentId:  '3073',
internalId:  '2f2266a85e02c655238ee536067e865b',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-d68e3e2cf03b0f7175b759cea78fbeb0']={
webappId:    '7060',
documentId:  '5423',
internalId:  'd68e3e2cf03b0f7175b759cea78fbeb0',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5423',
internalId:  '',
customField: '20100202-192534'
};
webappMappings['7060']=webappMappings['7060-f7e4f22cc9a09d79e192fd6bc1c4a601']={
webappId:    '7060',
documentId:  '8523',
internalId:  'f7e4f22cc9a09d79e192fd6bc1c4a601',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-14349e90579e4b57ca41d78dcc9ecc58']={
webappId:    '7060',
documentId:  '8544',
internalId:  '14349e90579e4b57ca41d78dcc9ecc58',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-524214d04a9523810698acdfcfd7fd67']={
webappId:    '7060',
documentId:  '8565',
internalId:  '524214d04a9523810698acdfcfd7fd67',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8523',
internalId:  '',
customField: '20100205-171806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8544',
internalId:  '',
customField: '20100205-171807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8565',
internalId:  '',
customField: '20100205-171811'
};
webappMappings['7060']=webappMappings['7060-ea0d97abf4e6fe8882942fcef8f8aae3']={
webappId:    '7060',
documentId:  '9623',
internalId:  'ea0d97abf4e6fe8882942fcef8f8aae3',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9623',
internalId:  '',
customField: '20100308-180815'
};
webappMappings['7060']=webappMappings['7060-c95fb7e2198cc80fe333ec06be01602a']={
webappId:    '7060',
documentId:  '10723',
internalId:  'c95fb7e2198cc80fe333ec06be01602a',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10723',
internalId:  '',
customField: '20100314-202508'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7CDOH';
var companyName   = 'F.N.+vidros+2552-8748+LIGUE+J%C3%81';
var htmlTitle	  = '';
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();
};

