/* [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','801',jdecode('Home'),jdecode(''),'/801.html','true',[],''],
	['PAGE','822',jdecode('Empresa'),jdecode(''),'/822.html','true',[],''],
	['PAGE','80723',jdecode('Galeria'),jdecode(''),'/80723.html','true',[],''],
	['PAGE','82534',jdecode('Impress%C3%A3o+Digital'),jdecode(''),'/82534.html','true',[],''],
	['PAGE','55301',jdecode('Sinaliz.+e+Seguran%C3%A7a'),jdecode(''),'/55301.html','true',[],''],
	['PAGE','36701',jdecode('Decora%C3%A7%C3%A3o'),jdecode(''),'/36701/index.html','true',[ 
		['PAGE','81123',jdecode('Cartelas'),jdecode(''),'/36701/81123.html','true',[],'']
	],''],
	['PAGE','999',jdecode('Clientes'),jdecode(''),'/999.html','true',[],''],
	['PAGE','885',jdecode('Contato'),jdecode(''),'/885.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='6699CC';
theSitetree.keyvisualId='9242';
theSitetree.keyvisualName='kv4.swf';
theSitetree.fontsetId='17363';
theSitetree.graphicsetId='12764';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Transluszent',
				paletteFamily: 	'6699CC',
				keyvisualId: 	'9242',
				keyvisualName: 	'kv4.swf',
				fontsetId: 		'17363',
				graphicsetId: 	'12764',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81123',
internalId:  '',
customField: '20090710-103038'
};
webappMappings['7008']=webappMappings['7008-3215']={
webappId:    '7008',
documentId:  '885',
internalId:  '3215',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20091105-163139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '822',
internalId:  '',
customField: '20091105-164029'
};
webappMappings['7060']=webappMappings['7060-2041d869d8d800b083df9a9e639101e8']={
webappId:    '7060',
documentId:  '81123',
internalId:  '2041d869d8d800b083df9a9e639101e8',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80723',
internalId:  '',
customField: '20090714-115115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55301',
internalId:  '',
customField: '20091105-165519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36701',
internalId:  '',
customField: '20091105-171846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '999',
internalId:  '',
customField: '20091105-174127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '885',
internalId:  '',
customField: '20080425-125419'
};
webappMappings['1501']=webappMappings['1501-8953341']={
webappId:    '1501',
documentId:  '801',
internalId:  '8953341',
customField: '1501'
};
webappMappings['7050']=webappMappings['7050-1089']={
webappId:    '7050',
documentId:  '36701',
internalId:  '1089',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-70a7440050cd988ba3b99c248b63739f']={
webappId:    '7060',
documentId:  '82534',
internalId:  '70a7440050cd988ba3b99c248b63739f',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-4f826b212ede8f70e85ac02bda598e96']={
webappId:    '7060',
documentId:  '80723',
internalId:  '4f826b212ede8f70e85ac02bda598e96',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82534',
internalId:  '',
customField: '20090714-125107'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INF1FY';
var companyName   = 'Fragra+Impress%C3%A3o+e+Recorte+Digital';
var htmlTitle	  = 'Adesivos%2C+Banners%2C+placas%2C+faixas%2C+adesivo+para+decora%C3%A7%C3%A3o+de+ambientes%2C+comunica%C3%A7%C3%A3o+visual';
var metaKeywords  = 'AdesivosAdesivos%2C+Autos%2C+Banner%C2%B4s%2C+Etiquetas%2C+Faixas%2C+Placas%2C+Vitrines%2C+Decora%C3%A7%C3%A3o+';
var metaContents  = 'Adesivos%2C+Autos%2C+Banner%C2%B4s%2C+Etiquetas%2C+Faixas%2C+Placas%2C+Vitrines%2C+Decora%C3%A7%C3%A3o+';
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();
};
