/* [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','301',jdecode('Home'),jdecode(''), jdecode('%2F301.html'), 'true',[],'',''],
	['PAGE','352',jdecode('Coberturas+Crital+e+Semi+Transp.'),jdecode(''), jdecode('%2F352.html'), 'true',[],'',''],
	['PAGE','123874',jdecode('Coberturas+Forradas+em+Tecido'),jdecode(''), jdecode('%2F123874.html'), 'true',[],'',''],
	['PAGE','373',jdecode('Cen%C3%A1rios'),jdecode(''), jdecode('%2F373.html'), 'true',[],'',''],
	['PAGE','45601',jdecode('Tendas'),jdecode(''), jdecode('%2F45601.html'), 'true',[],'',''],
	['PAGE','394',jdecode('Palco+%2Fpassarela'),jdecode(''), jdecode('%2F394.html'), 'true',[],'',''],
	['PAGE','436',jdecode('Stands'),jdecode(''), jdecode('%2F436.html'), 'true',[],'',''],
	['PAGE','478',jdecode('M%C3%B3veis'),jdecode(''), jdecode('%2F478.html'), 'true',[],'',''],
	['PAGE','499',jdecode('Mesas+e+cadeiras'),jdecode(''), jdecode('%2F499.html'), 'true',[],'',''],
	['PAGE','520',jdecode('Pista+de+dan%C3%A7a'),jdecode(''), jdecode('%2F520.html'), 'true',[],'',''],
	['PAGE','541',jdecode('Contato'),jdecode(''), jdecode('%2F541.html'), 'true',[],'',''],
	['PAGE','25706',jdecode('Livro+de+visitas%2FF%C3%B3rum'),jdecode(''), jdecode('%2F25706%2Findex.html'), 'true',[ 
		['PAGE','25701',jdecode('Servi%C3%A7o+de+bilhetes'),jdecode(''), jdecode('%2F25706%2F25701.html'), 'false',[],'','']
	],'',''],
	['PAGE','44101',jdecode('Beto'),jdecode(''), jdecode('%2F44101.html'), 'true',[],'',''],
	['PAGE','126985',jdecode('Quem+somos'),jdecode(''), jdecode('%2F126985%2Findex.html'), 'true',[ 
		['PAGE','127006',jdecode('Nossa+equipe'),jdecode(''), jdecode('%2F126985%2F127006.html'), 'true',[],'',''],
		['PAGE','127027',jdecode('Onde+estamos'),jdecode(''), jdecode('%2F126985%2F127027.html'), 'true',[],'','']
	],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Metal';
theSitetree.paletteFamily='A3CAFE';
theSitetree.keyvisualId='798';
theSitetree.keyvisualName='auge.jpg';
theSitetree.fontsetId='142';
theSitetree.graphicsetId='161';
theSitetree.contentColor='A3CAFE';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var prodDef={
  wl_name: 'brazilprod',
  product: 'WSCSYSSSSLY0X9A9'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Metal',
				paletteFamily: 	'A3CAFE',
				keyvisualId: 	'798',
				keyvisualName: 	'auge.jpg',
				fontsetId: 		'142',
				graphicsetId: 	'161',
				contentColor: 	'A3CAFE',
				contentBGColor: '000000',
				a_color: 		'A3CAFE',
				b_color: 		'87A7D2',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-3466031']={
webappId:    '1501',
documentId:  '301',
internalId:  '3466031',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-4011']={
webappId:    '7008',
documentId:  '541',
internalId:  '4011',
customField: 'language:pt;country:BR;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-25706avec10in3app']={
webappId:    '1002',
documentId:  '25706',
internalId:  '25706avec10in3app',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-4106871c20d66d79dd89981cb086cdcf']={
webappId:    '7060',
documentId:  '44101',
internalId:  '4106871c20d66d79dd89981cb086cdcf',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20110920-224335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '352',
internalId:  '',
customField: '20110902-114631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45601',
internalId:  '',
customField: '20110129-071550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '373',
internalId:  '',
customField: '20110129-062326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '394',
internalId:  '',
customField: '20110129-102909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '436',
internalId:  '',
customField: '20100113-130843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '478',
internalId:  '',
customField: '20110524-105657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '499',
internalId:  '',
customField: '20110524-154934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '520',
internalId:  '',
customField: '20110129-104250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '541',
internalId:  '',
customField: '20090909-082217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25706',
internalId:  '',
customField: '20070416-175613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25701',
internalId:  '',
customField: '20070306-134105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44101',
internalId:  '',
customField: '20080205-095034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123874',
internalId:  '',
customField: '20110912-070716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126985',
internalId:  '',
customField: '20110613-134556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127006',
internalId:  '',
customField: '20110613-134556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127027',
internalId:  '',
customField: '20110613-134556'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN3APP';
var companyName   = 'SR.++LUXUS+ARTE+COB+%26+CEN%C3%81RIOS+++++';
var htmlTitle	  = 'www.senhorluxuseventos.com';
var metaKeywords  = 'Coberturas+para+festas%2C+Coberturas%2CToldos%2CTendas%2C+Cen%C3%A1rios%2C+Palcos%2C+Pista+de+dan%C3%A7a%2C+Tablados%2C+Cen%C3%A1rios%2C+Som%2C+Ilumina%C3%A7%C3%A3o%2C+Piso';
var metaContents  = 'Coberturas%2CPassarelas%2CPalcos%2CPista+de+dan%C3%A7a%2CTablados%2CCen%C3%A1rios%2CSom%2CIlumina%C3%A7%C3%A3o%2CM%C3%B3veis%2CMesas%2CCadeiras%2CForra%C3%A7%C3%A3o+de+Sal%C3%A3o%2CFechamento+de+area%2CTendas%2CPiso+sobre+piscina';
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();
};

