/* [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','4501',jdecode('Inicial'),jdecode(''),'/4501.html','true',[],'',''],
	['PAGE','16433',jdecode('Hor%C3%A1rio+de+abertura'),jdecode(''),'/16433.html','true',[],'',''],
	['PAGE','16454',jdecode('Onde+estamos'),jdecode(''),'/16454.html','true',[],'',''],
	['PAGE','16475',jdecode('Card%C3%A1pio+da+Cozinha'),jdecode(''),'/16475.html','true',[],'',''],
	['PAGE','16496',jdecode('Carta+de+vinhos'),jdecode(''),'/16496.html','true',[],'',''],
	['PAGE','18612',jdecode('Almo%C3%A7o+executivo+de+2%C2%AA+%C3%A0+S%C3%A1b.'),jdecode(''),'/18612.html','true',[],'',''],
	['PAGE','17612',jdecode('Card%C3%A1pio+do+Forno'),jdecode(''),'/17612.html','true',[],'',''],
	['PAGE','20012',jdecode('Delivery'),jdecode(''),'/20012.html','true',[],'',''],
	['PAGE','16517',jdecode('Servi%C3%A7o+para+festas'),jdecode(''),'/16517.html','true',[],'',''],
	['PAGE','16538',jdecode('Reservas+%2F+contatos'),jdecode(''),'/16538.html','true',[],'',''],
	['PAGE','16580',jdecode('Quem+somos'),jdecode(''),'/16580/index.html','true',[ 
		['PAGE','16601',jdecode('Nossa+equipe'),jdecode(''),'/16580/16601.html','true',[],'','']
	],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Restaurant';
theSitetree.paletteFamily='62212A';
theSitetree.keyvisualId='11902';
theSitetree.keyvisualName='kv_11902.jpg';
theSitetree.fontsetId='33193';
theSitetree.graphicsetId='14094';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Restaurant',
				paletteFamily: 	'62212A',
				keyvisualId: 	'11902',
				keyvisualName: 	'kv_11902.jpg',
				fontsetId: 		'33193',
				graphicsetId: 	'14094',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4501',
internalId:  '',
customField: '20100906-205006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16433',
internalId:  '',
customField: '20100906-205337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16454',
internalId:  '',
customField: '20100906-164737'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1019289']={
webappId:    '1501',
documentId:  '4501',
internalId:  '1019289',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18612',
internalId:  '',
customField: '20100906-194138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16475',
internalId:  '',
customField: '20100906-213634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16496',
internalId:  '',
customField: '20100906-174016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16517',
internalId:  '',
customField: '20100906-183535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16538',
internalId:  '',
customField: '20100906-183924'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4501',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16580',
internalId:  '',
customField: '20100906-185753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20100906-192653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20012',
internalId:  '',
customField: '20100906-193427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17612',
internalId:  '',
customField: '20100906-200104'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16433',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16454',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16475',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16496',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '18612',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '17612',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '20012',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16517',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16538',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16580',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16601',
internalId:  '',
customField: 'language:pt;country:BR;'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7CIRC';
var companyName   = '++++++++Fortunata+Restaurante';
var htmlTitle	  = 'Fortunata';
var metaKeywords  = 'Fortunata%3B+Restaurante%3BRestaurante+em+Brasilia%3B+Pizzaria%3BPizzarai+em+brasilia%2C+Pizza+delivery%2Cpizzaria+';
var metaContents  = 'Fortunata%3BRestaurante%3BRestaurante+em+Brasilia%3B+Pizzaria+em+Brasilia%3BPizza+delivery%3B+tele+entrega.+Pizzaria';
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();
};
