/* [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','501',jdecode('A+Empresa'),jdecode(''),'/501.html','true',[],''],
	['PAGE','552',jdecode('Loca%C3%A7%C3%A3o'),jdecode(''),'/552.html','true',[],''],
	['PAGE','4422',jdecode('Recrea%C3%A7%C3%A3o'),jdecode(''),'/4422.html','true',[],''],
	['PAGE','4443',jdecode('Vendas'),jdecode(''),'/4443/index.html','true',[ 
		['PAGE','15101',jdecode('Bal%C3%A3o+Pula+-+Pula'),jdecode(''),'/4443/15101.html','true',[],''],
		['PAGE','15122',jdecode('Bung+Run'),jdecode(''),'/4443/15122.html','true',[],''],
		['PAGE','15143',jdecode('Boliche'),jdecode(''),'/4443/15143.html','true',[],''],
		['PAGE','15164',jdecode('Cama+El%C3%A1stica'),jdecode(''),'/4443/15164.html','true',[],''],
		['PAGE','15185',jdecode('Colch%C3%A3o+para+touro'),jdecode(''),'/4443/15185.html','true',[],''],
		['PAGE','15206',jdecode('Centop%C3%A9ia'),jdecode(''),'/4443/15206.html','true',[],''],
		['PAGE','15227',jdecode('Touro+'),jdecode(''),'/4443/15227.html','true',[],''],
		['PAGE','15248',jdecode('Kid+Play+Infl%C3%A1vel'),jdecode(''),'/4443/15248.html','true',[],''],
		['PAGE','15269',jdecode('Cotonete+%2F+Boxe'),jdecode(''),'/4443/15269.html','true',[],''],
		['PAGE','15290',jdecode('Quadra+de+futebol'),jdecode(''),'/4443/15290.html','true',[],''],
		['PAGE','15311',jdecode('Alpinismo'),jdecode(''),'/4443/15311.html','true',[],''],
		['PAGE','15332',jdecode('piscina+de+bolinha'),jdecode(''),'/4443/15332.html','true',[],''],
		['PAGE','15353',jdecode('Tobog%C3%A3'),jdecode(''),'/4443/15353.html','true',[],''],
		['PAGE','18601',jdecode('Tombo+Legal'),jdecode(''),'/4443/18601.html','true',[],'']
	],''],
	['PAGE','573',jdecode('Contato%2FOr%C3%A7amento'),jdecode(''),'/573.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='FF6600';
theSitetree.keyvisualId='9242';
theSitetree.keyvisualName='kv4.swf';
theSitetree.fontsetId='17360';
theSitetree.graphicsetId='12762';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Transluszent',
				paletteFamily: 	'FF6600',
				keyvisualId: 	'9242',
				keyvisualName: 	'kv4.swf',
				fontsetId: 		'17360',
				graphicsetId: 	'12762',
				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:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090421-155735'
};
webappMappings['7008']=webappMappings['7008-6718']={
webappId:    '7008',
documentId:  '573',
internalId:  '6718',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20080704-071104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4422',
internalId:  '',
customField: '20070813-151741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4443',
internalId:  '',
customField: '20080130-121549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20080130-130326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15122',
internalId:  '',
customField: '20080130-201654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15143',
internalId:  '',
customField: '20080130-131206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15164',
internalId:  '',
customField: '20080130-132005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15185',
internalId:  '',
customField: '20080130-132717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15206',
internalId:  '',
customField: '20080130-133057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15227',
internalId:  '',
customField: '20080130-133654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15248',
internalId:  '',
customField: '20080130-133818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15269',
internalId:  '',
customField: '20080130-134110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15290',
internalId:  '',
customField: '20080131-053931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15311',
internalId:  '',
customField: '20080131-053758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15332',
internalId:  '',
customField: '20080131-052028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15353',
internalId:  '',
customField: '20080131-053653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20080131-052829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20070528-145326'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INV7W2';
var companyName   = 'PIU+PIU+EVENTOS+';
var htmlTitle	  = 'Piu+Piu+Eventos';
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();
};

