/* [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','7254',jdecode('SANATORIUM'),jdecode(''),'/7254.html','true',[],'',''],
	['PAGE','1614',jdecode('Sanatorium+SOKOLICA'),jdecode(''),'/1614.html','true',[],'',''],
	['PAGE','28012',jdecode('Sanatorium+PATRIA'),jdecode(''),'/28012.html','true',[],'',''],
	['PAGE','71512',jdecode('ZABIEGI+LECZNICZE'),jdecode(''),'/71512.html','true',[],'',''],
	['PAGE','74412',jdecode('Odchudzanie%2C+Cukrzyca'),jdecode(''),'/74412.html','true',[],'',''],
	['PAGE','29512',jdecode('ZDROWIE+-+Poradnik'),jdecode(''),'/29512.html','true',[],'',''],
	['PAGE','7317',jdecode('CENNIK'),jdecode(''),'/7317.html','true',[],'',''],
	['PAGE','7296',jdecode('TURNUS+LECZNICZY'),jdecode(''),'/7296.html','true',[],'',''],
	['PAGE','7338',jdecode('GALERIA+ZDJ%C4%98%C4%86'),jdecode(''),'/7338.html','true',[],'',''],
	['PAGE','7359',jdecode('KONTAKT'),jdecode(''),'/7359.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Workflow';
theSitetree.paletteFamily='B8BADF';
theSitetree.keyvisualId='7839';
theSitetree.keyvisualName='kv_7839.jpg';
theSitetree.fontsetId='28129';
theSitetree.graphicsetId='12288';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Workflow',
				paletteFamily: 	'B8BADF',
				keyvisualId: 	'7839',
				keyvisualName: 	'kv_7839.jpg',
				fontsetId: 		'28129',
				graphicsetId: 	'12288',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'8487BF',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'8487BF',
				e_color: 		'979696',
				f_color: 		'707070',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1614',
internalId:  '',
customField: '20100414-125155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7317',
internalId:  '',
customField: '20100317-143203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7296',
internalId:  '',
customField: '20100317-144121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74412',
internalId:  '',
customField: '20100318-132810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7254',
internalId:  '',
customField: '20100317-141514'
};
webappMappings['1003']=webappMappings['1003-ahpl10inp40y126bd8738d8']={
webappId:    '1003',
documentId:  '29512',
internalId:  'ahpl10inp40y126bd8738d8',
customField: 'pl:PL'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28012',
internalId:  '',
customField: '20100414-125607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7359',
internalId:  '',
customField: '20100216-142829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7338',
internalId:  '',
customField: '20100121-194232'
};
webappMappings['7008']=webappMappings['7008-6308']={
webappId:    '7008',
documentId:  '7359',
internalId:  '6308',
customField: 'language:pl;country:PL;'
};
webappMappings['7060']=webappMappings['7060-615634362bbc6485c19d4ea86ca1e8f0']={
webappId:    '7060',
documentId:  '7338',
internalId:  '615634362bbc6485c19d4ea86ca1e8f0',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71512',
internalId:  '',
customField: '20100318-111656'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '7254',
internalId:  '1501',
customField: '1501'
};
webappMappings['1501']=webappMappings['1501-18242198']={
webappId:    '1501',
documentId:  '7254',
internalId:  '18242198',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29512',
internalId:  '',
customField: '20100317-135802'
};
var canonHostname = 'wsc2.home.net.pl';
var accountId     = 'AHPL10INP40Y';
var companyName   = 'SANATORIA+SOKOLICA+I+PATRIA';
var htmlTitle	  = '+X-Travel+-+Sanatorium+w+Rabce+Zdr%C3%B3j';
var metaKeywords  = 'sanatorium%2C+sanatoria%2C+zdrowie%2C+pobyt+leczniczy%2C+pobyt+rehabilitacyjno-leczniczy%2C+turnus+sanatoryjny%2C+turnus+leczniczy%2C+rehabilitacja%2C+zabiegi%2C+zabiegi+lecznicze%2C++masa%C5%BC%2C+bez+skierowania+od+lekarza%2C+bez+skierowania+z+nfz%2C+pobyt+leczniczy+prywatny%2C+oty%C5%82o%C5%9B%C4%87%2C+odchudzanie%2C+zawa%C5%82+serca%2C+choroby+uk%C5%82adu+oddechowego%2C+choroby+uk%C5%82adu+kr%C4%85%C5%BCenia%2C+cukrzyca%2C+o%C5%9Brodek%2C+sanatorium+Sokolica%2C+sanatorium+Patria';
var metaContents  = 'Zapraszamy+do+sanatorium+w++Rabce+Zdr%C3%B3j.+Proponujemy+zar%C3%B3wno+pobyty+jak+i+turnusy+sanatoryjne+z+5+zabiegami+dziennie.+Zabiegi%2C+kt%C3%B3re+proponujemy+w+znacznym+stopniu+przyczyni%C4%85+si%C4%99+zar%C3%B3wno+do+poprawy+zdrowia+jak+i+samopoczucia.';
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();
};

