/* [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','39001',jdecode('Strona+g%C5%82%C3%B3wna'),jdecode(''),'/39001.html','true',[],'',''],
	['PAGE','301',jdecode('Promocje+'),jdecode(''),'/301/index.html','true',[ 
		['PAGE','183401',jdecode('Bioptron+Compact+III'),jdecode(''),'/301/183401.html','true',[],'',''],
		['PAGE','183422',jdecode('Bioptron+Pro+1'),jdecode(''),'/301/183422.html','true',[],'',''],
		['PAGE','183443',jdecode('Bioptron+2'),jdecode(''),'/301/183443.html','true',[],'','']
	],'',''],
	['PAGE','239201',jdecode('Choroby+-+info'),jdecode(''),'/239201/index.html','true',[ 
		['PAGE','243801',jdecode('%C5%82uszczyca'),jdecode(''),'/239201/243801.html','true',[],'',''],
		['PAGE','239222',jdecode('noworodki'),jdecode(''),'/239201/239222.html','true',[],'',''],
		['PAGE','240401',jdecode('SAD+i+depresja+'),jdecode(''),'/239201/240401.html','true',[],'',''],
		['PAGE','241301',jdecode('tr%C4%85dzik'),jdecode(''),'/239201/241301.html','true',[],'',''],
		['PAGE','245201',jdecode('zesp%C3%B3%C5%82+cie%C5%9Bni+n.'),jdecode(''),'/239201/245201.html','true',[],'','']
	],'',''],
	['PAGE','183464',jdecode('Therapy+Air+iOn'),jdecode(''),'/183464.html','true',[],'',''],
	['PAGE','231001',jdecode('Aqueena'),jdecode(''),'/231001.html','true',[],'',''],
	['PAGE','32301',jdecode('Zam%C3%B3wienie'),jdecode(''),'/32301.html','true',[],'',''],
	['PAGE','5001',jdecode('Terapia+%C5%9Bwiat%C5%82em'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','31722',jdecode('Zastosowanie'),jdecode(''),'/31722.html','true',[],'',''],
	['PAGE','34001',jdecode('Koloroterapia'),jdecode(''),'/34001.html','true',[],'',''],
	['PAGE','194801',jdecode('Certyfikaty'),jdecode(''),'/194801.html','true',[],'',''],
	['PAGE','31701',jdecode('Parametry'),jdecode(''),'/31701.html','true',[],'',''],
	['PAGE','32343',jdecode('Porady'),jdecode(''),'/32343.html','true',[],'',''],
	['PAGE','155001',jdecode('Praca'),jdecode(''),'/155001.html','true',[],'',''],
	['PAGE','32364',jdecode('Kontakt'),jdecode(''),'/32364.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Ocean';
theSitetree.paletteFamily='1E77BA';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='35627';
theSitetree.graphicsetId='14054';
theSitetree.contentColor='00386f';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Ocean',
				paletteFamily: 	'1E77BA',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'35627',
				graphicsetId: 	'14054',
				contentColor: 	'00386f',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100512-151055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20091211-173522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31701',
internalId:  '',
customField: '20091211-174043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31722',
internalId:  '',
customField: '20091211-173822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32364',
internalId:  '',
customField: '20100601-112041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32343',
internalId:  '',
customField: '20091225-130839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '155001',
internalId:  '',
customField: '20091215-172533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32301',
internalId:  '',
customField: '20091225-130422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34001',
internalId:  '',
customField: '20091211-173856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39001',
internalId:  '',
customField: '20100824-160847'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '39001',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-40']={
webappId:    '7008',
documentId:  '301',
internalId:  '40',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '194801',
internalId:  '',
customField: '20091211-173950'
};
webappMappings['7008']=webappMappings['7008-42']={
webappId:    '7008',
documentId:  '32301',
internalId:  '42',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-3900']={
webappId:    '7008',
documentId:  '183464',
internalId:  '3900',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-3899']={
webappId:    '7008',
documentId:  '183443',
internalId:  '3899',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-3898']={
webappId:    '7008',
documentId:  '183422',
internalId:  '3898',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-3897']={
webappId:    '7008',
documentId:  '183401',
internalId:  '3897',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-4804']={
webappId:    '7008',
documentId:  '231001',
internalId:  '4804',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '183401',
internalId:  '',
customField: '20100519-131851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '183422',
internalId:  '',
customField: '20100519-132003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '183443',
internalId:  '',
customField: '20100519-132114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '183464',
internalId:  '',
customField: '20091216-200842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '231001',
internalId:  '',
customField: '20100519-132248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '239201',
internalId:  '',
customField: '20100301-154353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '239222',
internalId:  '',
customField: '20091223-140410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '240401',
internalId:  '',
customField: '20091223-140231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '241301',
internalId:  '',
customField: '20100105-135628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '243801',
internalId:  '',
customField: '20091228-144915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '245201',
internalId:  '',
customField: '20100121-142348'
};
var canonHostname = 'wsc2.home.net.pl';
var accountId     = 'AHPL10INL92P';
var companyName   = 'OFICJALNE+PROMOCJE+BIOPTRON+OD+ZEPTER.+OBS%C5%81UGA+-+CA%C5%81Y+KRAJ%3A+601-06-05-97';
var htmlTitle	  = 'Medycyna+Naturalna+Bioptron';
var metaKeywords  = 'Bioptron%2C+Medycyna%2C+light+therapy%2C+leczenie%2C+naturalna+medycyna%2C+compact%2C+Niels+Ryberg+Finsen%2C+lampa+Zepter%2C+koloroterapia%2C+pro+1%2C+%C5%9Bwiat%C5%82oterapia%2C+zabieg+%C5%9Bwiat%C5%82em%2C+zepter%2C+moc+natury%2C+Medycyna+Naturalna%2C+uzdrawiaj%C4%85ca+moc+natury%2C+gda%C5%84sk+wielki+m%C5%82yn%2C+terapia+%C5%9Bwietlna%2C+profilaktyka%2C+bioptron-medical.pl%2C+terapia+%C5%9Bwiat%C5%82em+bioptron%2C+compact+III%2C+zam%C3%B3wienie%2C+choroby+info%2C+na%C5%9Bwietlania%2C+medycyna%2C+medycyna+naturalna+bioptron%2C+gda%C5%84sk';
var metaContents  = 'Najnowocze%C5%9Bniejsza+Medycyna+Naturalna%2C+terapia+%C5%9Bwiat%C5%82em+leczy+przyczyny%2C+a+nie+skutki+wielu+chor%C3%B3b.+Medycyna+naturalna+od+Zepter.+Oficjalna+Promocja%3A+Bioptron+Compact+III%2C+Bioptron+Pro+1%2C+Bioptron2.+Medycyna+Naturalna%3A+moc+natury.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A';
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();
};

