/* [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','201',jdecode('Home'),jdecode(''),'/201.html','true',[],'',''],
	['PAGE','252',jdecode('Estrutura'),jdecode(''),'/252.html','true',[],'',''],
	['PAGE','294',jdecode('%C3%81lbum+de+fotos'),jdecode(''),'/294.html','true',[],'',''],
	['PAGE','336',jdecode('Casa+de+Ch%C3%A1'),jdecode(''),'/336.html','true',[],'',''],
	['PAGE','33801',jdecode('Card%C3%A1pio'),jdecode(''),'/33801.html','true',[],'',''],
	['PAGE','462',jdecode('Dicas+Le+Petit+Roy'),jdecode(''),'/462.html','true',[],'',''],
	['PAGE','567',jdecode('Or%C3%A7amento'),jdecode(''),'/567.html','true',[],'',''],
	['PAGE','315',jdecode('Contato'),jdecode(''),'/315.html','true',[],'',''],
	['PAGE','14301',jdecode('Depoimentos+e+Solicita%C3%A7%C3%B5es'),jdecode(''),'/14301.html','false',[],'',''],
	['PAGE','14306',jdecode('Livro+de+visitas%2FF%C3%B3rum'),jdecode(''),'/14306.html','true',[],'',''],
	['PAGE','47001',jdecode('Imprensa'),jdecode(''),'/47001.html','true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Cut';
theSitetree.paletteFamily='7F2892';
theSitetree.keyvisualId='2774';
theSitetree.keyvisualName='musik.jpg';
theSitetree.fontsetId='10423';
theSitetree.graphicsetId='10729';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FE663E';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Cut',
				paletteFamily: 	'7F2892',
				keyvisualId: 	'2774',
				keyvisualName: 	'musik.jpg',
				fontsetId: 		'10423',
				graphicsetId: 	'10729',
				contentColor: 	'000000',
				contentBGColor: 'FE663E',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-7499293']={
webappId:    '1501',
documentId:  '201',
internalId:  '7499293',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-14306avec10inz5by']={
webappId:    '1002',
documentId:  '14306',
internalId:  '14306avec10inz5by',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-1986']={
webappId:    '7008',
documentId:  '315',
internalId:  '1986',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-1987']={
webappId:    '7008',
documentId:  '567',
internalId:  '1987',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201',
internalId:  '',
customField: '20100816-133252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '315',
internalId:  '',
customField: '20091217-205724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '252',
internalId:  '',
customField: '20090711-112515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '294',
internalId:  '',
customField: '20090711-114923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '336',
internalId:  '',
customField: '20090702-135819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33801',
internalId:  '',
customField: '20100816-133220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '462',
internalId:  '',
customField: '20091217-205135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47001',
internalId:  '',
customField: '20091217-210421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '567',
internalId:  '',
customField: '20091217-205352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14301',
internalId:  '',
customField: '20081120-151556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14306',
internalId:  '',
customField: '20090330-155314'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZ5BY';
var companyName   = 'Buffet+Le+Petit+Roy';
var htmlTitle	  = 'Buffet+Le+Petit+Roy';
var metaKeywords  = 'buffet+infantil%2C+festas+infantis%2C+anivers%C3%A1rio%2C+crian%C3%A7as%2C+batizado%2C+ch%C3%A1+de+beb%C3%AA%2C+ch%C3%A1+de+cozinha%2C+Casa+de+ch%C3%A1%2C+lazer%2C+eventos%2C+formatura+escolar';
var metaContents  = 'Buffet+infantil+e+Casa+de+Ch%C3%A1%2C+recebe+pr%C3%AAmio+Top+Of+Business+2009+pela+sua+excel%C3%AAncia+Qualidade+e+Presta%C3%A7%C3%A3o+de+Servi%C3%A7os+no+ramo+de+gastronomia.+Fazemos+festas+infantis%2C+almo%C3%A7o+de+batizado%2C+festas+de+adultos%2C+15+anos%2C+eventos+empresariais%2C+Ch%C3%A1+de+beb%C3%AA%2C+Anives%C3%A1rio+de+Casamento%2C+Bodas%2C+Ch%C3%A1+de+Cozinha%2C+formatura+escolar%2C+festas+em+geral.+Casa+de+ch%C3%A1.+Nosso+site+www.lepetitroy.com.br';
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();
};
