/* [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','401',jdecode('P%C3%A1gina+Principal'),jdecode(''),'/401.html','true',[],''],
	['PAGE','19212',jdecode('Quem+somos'),jdecode(''),'/19212/index.html','true',[ 
		['PAGE','19233',jdecode('Nossa+equipe'),jdecode(''),'/19212/19233.html','true',[],''],
		['PAGE','19254',jdecode('Onde+estamos'),jdecode(''),'/19212/19254.html','true',[],'']
	],''],
	['PAGE','19275',jdecode('Servi%C3%A7os'),jdecode(''),'/19275.html','true',[],''],
	['PAGE','19296',jdecode('Tenda+Tensionada'),jdecode(''),'/19296.html','true',[],''],
	['PAGE','452',jdecode('Tendas'),jdecode(''),'/452.html','true',[],''],
	['PAGE','473',jdecode('Coberturas'),jdecode(''),'/473.html','true',[],''],
	['PAGE','8501',jdecode('Piso%2C+Pista+de+Dan%C3%A7a'),jdecode(''),'/8501.html','true',[],''],
	['PAGE','19317',jdecode('Passarela'),jdecode(''),'/19317.html','true',[],''],
	['PAGE','10201',jdecode('Palcos'),jdecode(''),'/10201.html','true',[],''],
	['PAGE','19338',jdecode('Arquibancada'),jdecode(''),'/19338.html','true',[],''],
	['PAGE','19512',jdecode('Fotos+Eventos'),jdecode(''),'/19512.html','true',[],''],
	['PAGE','494',jdecode('Contato'),jdecode(''),'/494.html','true',[],''],
	['PAGE','29006',jdecode('Parceiros'),jdecode(''),'/29006.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='3E6E72';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='354';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3E6E72';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'3E6E72',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'354',
				contentColor: 	'FFFFFF',
				contentBGColor: '3E6E72',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'3E6E72',
				b_color: 		'101C1D',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-3913']={
webappId:    '7008',
documentId:  '494',
internalId:  '3913',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090922-222858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20090810-175240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20090928-125556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20090928-101647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20090922-221134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20090922-210511'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-7df337c1e544c11868f0d5f1cce42ce1']={
webappId:    '7060',
documentId:  '19512',
internalId:  '7df337c1e544c11868f0d5f1cce42ce1',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19512',
internalId:  '',
customField: '20090922-222347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19338',
internalId:  '',
customField: '20090922-220337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19317',
internalId:  '',
customField: '20090922-221957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19275',
internalId:  '',
customField: '20090922-205807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19212',
internalId:  '',
customField: '20090922-205807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19233',
internalId:  '',
customField: '20090922-205807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19254',
internalId:  '',
customField: '20090922-205807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19296',
internalId:  '',
customField: '20090922-205807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29006',
internalId:  '',
customField: '20090928-135309'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPNMW';
var companyName   = 'Serafim+Tendas+%26+Coberturas';
var htmlTitle	  = 'Serafim+Tendas+e+Coberturas+-+Venda+e+Loca%C3%A7%C3%A3o+de+Tendas+para+Eventos';
var metaKeywords  = 'Tendas+de+ferro%2C+coberturas+em+estruturas+de+madeira%2C+grades%2C+palcos%2C+pisos%2C+fechamentos+laterais%2C+pista+de+dan%C3%A7a%2C+rebaoxamento+de+teto+etc.';
var metaContents  = 'Trabalhamos+na+loca%C3%A7%C3%A3o+e+venda+de%3A++Tendas+de+ferro%2C+coberturas+em+estruturas+de+madeira%2C+grades%2C+palcos%2C+pisos%2C+fechamentos+laterais%2C+pista+de+dan%C3%A7a%2C+rebaoxamento+de+teto+etc.';
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();
};
