/* [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','19001',jdecode('FANABERIA'),jdecode(''),'/19001/index.html','true',[ 
		['PAGE','19022',jdecode('Pokoje'),jdecode(''),'/19001/19022.html','true',[],'',''],
		['PAGE','19043',jdecode('Otoczenie'),jdecode(''),'/19001/19043.html','true',[],'','']
	],'',''],
	['PAGE','2794',jdecode('Galeria+zdj%C4%99%C4%87'),jdecode(''),'/2794/index.html','true',[ 
		['PAGE','58112',jdecode('W+%22Fanaberii%22'),jdecode(''),'/2794/58112.html','true',[],'',''],
		['PAGE','65112',jdecode('Nasze+psy'),jdecode(''),'/2794/65112.html','true',[],'',''],
		['PAGE','65133',jdecode('W+Beskidach'),jdecode(''),'/2794/65133.html','true',[],'','']
	],'',''],
	['PAGE','16222',jdecode('Cenniki'),jdecode(''),'/16222/index.html','true',[ 
		['PAGE','47533',jdecode('Wy%C5%BCywienie'),jdecode(''),'/16222/47533.html','true',[],'','']
	],'',''],
	['PAGE','71812',jdecode('Dogoterapia'),jdecode(''),'/71812/index.html','true',[ 
		['PAGE','71833',jdecode('Czym+jest+dogoterapia'),jdecode(''),'/71812/71833.html','true',[],'',''],
		['PAGE','71854',jdecode('Zalety+dogoterapii'),jdecode(''),'/71812/71854.html','true',[],'','']
	],'',''],
	['PAGE','16264',jdecode('Nasz+region'),jdecode(''),'/16264/index.html','true',[ 
		['PAGE','19064',jdecode('W+Brennej'),jdecode(''),'/16264/19064.html','true',[],'',''],
		['PAGE','19085',jdecode('Polecamy+w+okolicy'),jdecode(''),'/16264/19085.html','true',[],'',''],
		['PAGE','54212',jdecode('Trasy+narciarskie'),jdecode(''),'/16264/54212.html','true',[],'','']
	],'',''],
	['PAGE','16285',jdecode('Rezerwacja'),jdecode(''),'/16285.html','true',[],'',''],
	['PAGE','16306',jdecode('Dojazd'),jdecode(''),'/16306.html','true',[],'',''],
	['PAGE','58133',jdecode('Ksi%C4%99ga+go%C5%9Bci'),jdecode(''),'/58133.html','true',[],'',''],
	['PAGE','29912',jdecode('Kontakt'),jdecode(''),'/29912.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Seasons_summer';
theSitetree.paletteFamily='FFE185';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='31576';
theSitetree.graphicsetId='13192';
theSitetree.contentColor='2E2E2E';
theSitetree.contentBGColor='FFE185';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Seasons_summer',
				paletteFamily: 	'FFE185',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'31576',
				graphicsetId: 	'13192',
				contentColor: 	'2E2E2E',
				contentBGColor: 'FFE185',
				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['7008']=webappMappings['7008-1545']={
webappId:    '7008',
documentId:  '29912',
internalId:  '1545',
customField: 'language:pl;country:PL;'
};
webappMappings['7060']=webappMappings['7060-d2432bc1e171f0a7dde9e132fdcfba8f']={
webappId:    '7060',
documentId:  '2794',
internalId:  'd2432bc1e171f0a7dde9e132fdcfba8f',
customField: 'language:pl;country:PL;'
};
webappMappings['7060']=webappMappings['7060-c4e1f2652c50beb87971e0484a4d4425']={
webappId:    '7060',
documentId:  '58112',
internalId:  'c4e1f2652c50beb87971e0484a4d4425',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29912',
internalId:  '',
customField: '20080414-011652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2794',
internalId:  '',
customField: '20080411-235412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19001',
internalId:  '',
customField: '20100402-235353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16222',
internalId:  '',
customField: '20091023-194503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16306',
internalId:  '',
customField: '20090323-135154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16285',
internalId:  '',
customField: '20081008-132905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19022',
internalId:  '',
customField: '20090609-230458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19043',
internalId:  '',
customField: '20100621-212940'
};
webappMappings['7060']=webappMappings['7060-af1d68b91ab6d42a312ea607d97d3aa3']={
webappId:    '7060',
documentId:  '65112',
internalId:  'af1d68b91ab6d42a312ea607d97d3aa3',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16264',
internalId:  '',
customField: '20080412-115940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19064',
internalId:  '',
customField: '20080505-110127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19085',
internalId:  '',
customField: '20100819-212007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47533',
internalId:  '',
customField: '20091230-230019'
};
webappMappings['7002']=webappMappings['7002-1737']={
webappId:    '7002',
documentId:  '58133',
internalId:  '1737',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54212',
internalId:  '',
customField: '20091124-235426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58112',
internalId:  '',
customField: '20091023-191914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58133',
internalId:  '',
customField: '20090606-215659'
};
webappMappings['7060']=webappMappings['7060-40ac9ceaffad862d88aabb6045eeb4a0']={
webappId:    '7060',
documentId:  '65133',
internalId:  '40ac9ceaffad862d88aabb6045eeb4a0',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65112',
internalId:  '',
customField: '20091023-191933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65133',
internalId:  '',
customField: '20091023-192139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71812',
internalId:  '',
customField: '20100819-213521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71833',
internalId:  '',
customField: '20100819-210510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71854',
internalId:  '',
customField: '20100819-210510'
};
var canonHostname = 'cm4all.az.pl';
var accountId     = 'AAZ010IN2CBE';
var companyName   = 'FANABERIA';
var htmlTitle	  = 'Fanaberia';
var metaKeywords  = 'noclegi+brenna%2C+brenna+noclegi%2C+brenna%2C+fanaberia+brenna%2C+brenna+fanaberia%2C+brenna+pokoje%2C+pokoje+brenna%2C+beskidy%2C+noclegi+beskidy%2C+beskidy+noclegi%2C+kwatery+brenna%2C+brenna+kwatery%2C+fanaberia+-+pokoje+go%C5%9Bcinne';
var metaContents  = 'Tanie+noclegi+w+Brennej';
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();
};
