/* [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','501',jdecode('O+Nas'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','594',jdecode('Us%C5%82ugi'),jdecode(''),'/594.html','true',[],'',''],
	['PAGE','552',jdecode('Godziny+otwarcia'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','573',jdecode('Jak+do+nas+trafi%C4%87'),jdecode(''),'/573.html','true',[],'',''],
	['PAGE','678',jdecode('Koszty'),jdecode(''),'/678.html','true',[],'',''],
	['PAGE','699',jdecode('Kontakt'),jdecode(''),'/699.html','true',[],'',''],
	['PAGE','6706',jdecode('Ksi%C4%99ga+Go%C5%9Bci'),jdecode(''),'/6706.html','true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='01343D';
theSitetree.keyvisualId='2182';
theSitetree.keyvisualName='zahnmedizin.jpg';
theSitetree.fontsetId='26962';
theSitetree.graphicsetId='409';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='01343D';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Medium',
				paletteFamily: 	'01343D',
				keyvisualId: 	'2182',
				keyvisualName: 	'zahnmedizin.jpg',
				fontsetId: 		'26962',
				graphicsetId: 	'409',
				contentColor: 	'FFFFFF',
				contentBGColor: '01343D',
				a_color: 		'01343D',
				b_color: 		'8EBFC6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20080312-141718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20080226-212052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20080228-213158'
};
webappMappings['1002']=webappMappings['1002-6706ahpl10invrkt']={
webappId:    '1002',
documentId:  '6706',
internalId:  '6706ahpl10invrkt',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20080226-212207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20080312-141856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20080226-212214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6706',
internalId:  '',
customField: '20080226-211659'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'wsc0.home.net.pl';
var accountId     = 'AHPL10INVRKT';
var companyName   = 'DENTINA';
var htmlTitle	  = 'Indywidualna+Praktyka+Stomatologiczna+%C5%81ukasz+Nowicki+DENTINA';
var metaKeywords  = 'dentysta+%2C+stomatolog++%2C+Chorz%C3%B3w+%2C+wybielanie+%2C+leczenie+%2C+protezy+%2C+korony+%2C+mosty+%2C+plomby+%2C+leczenie+kana%C5%82owe+%2C+usuwanie+%2C+z%C4%99b%C3%B3w+%2C+znieczulenia+%2C+znieczulenie+%2C+%C5%81ukasz+%2C+Nowicki+%2C+Katowice+%2C+stomatolog+Chorz%C3%B3w+%2C+stomatolog+Katowice+%2C+plombowanie+%2C+usuwanie+kamienia+%2C+piaskowanie+%2C+gabinet+%2C+%C5%81ukasz+Nowicki%2C++dentina+%2C+bezbolesne+%2C+bia%C5%82e+%2C+z%C4%99by+%2C+cerkon+%2C+procera+%2C+porcelanowe+%2C+inlay+%2C+lakowanie+%2C+kompozyt+%2C+w%C5%82%C3%B3kna+szklane+%2C+podparcia+%2C+szklane+%2C+lic%C3%B3wka+%2C+lic%C3%B3wki+%2C+Dentina';
var metaContents  = 'Indywidualna+praktyka+stomatologiczna+%C5%81ukasz+Nowicki+%2C+gabinet+dentystyczny+w+Chorzowie+Wolno%C5%9Bci+111%2F2+tel.+502+372+094%2C+nowickigabinet%40home.pl';
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();
};

