/* [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 theSitetree=[ 
	['PAGE','301',jdecode('Home'),jdecode(''),'/301.html','true',[],''],
	['PAGE','7222',jdecode('Wiadomo%C5%9Bci'),jdecode(''),'/7222.html','true',[],''],
	['PAGE','7243',jdecode('dla+Pacjenta'),jdecode(''),'/7243.html','true',[],''],
	['PAGE','7264',jdecode('dla+Aptekarza'),jdecode(''),'/7264.html','true',[],''],
	['PAGE','7285',jdecode('dla+Doktora'),jdecode(''),'/7285.html','true',[],''],
	['PAGE','7306',jdecode('Kontakt'),jdecode(''),'/7306.html','true',[],''],
	['PAGE','7327',jdecode('Ulotka%2C+Druki%2C+Archiwum'),jdecode(''),'/7327.html','true',[],''],
	['PAGE','7348',jdecode('Linki'),jdecode(''),'/7348.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Aeskulap';
theSitetree.paletteFamily='012253';
theSitetree.keyvisualId='2493';
theSitetree.keyvisualName='apotheke.jpg';
theSitetree.fontsetId='27043';
theSitetree.graphicsetId='483';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				name: 			'Aeskulap',
				paletteFamily: 	'012253',
				keyvisualId: 	'2493',
				keyvisualName: 	'apotheke.jpg',
				fontsetId: 		'27043',
				graphicsetId: 	'483',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20090710-111422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7327',
internalId:  '',
customField: '20090710-110315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7348',
internalId:  '',
customField: '20090522-173354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7222',
internalId:  '',
customField: '20090710-112621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7243',
internalId:  '',
customField: '20090702-152605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7264',
internalId:  '',
customField: '20090710-110932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7285',
internalId:  '',
customField: '20090702-152054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7306',
internalId:  '',
customField: '20090701-195640'
};
var canonHostname = 'wsc0.home.net.pl';
var accountId     = 'AHPL10IN3BCF';
var companyName   = 'Pelethrocin+500mg+tabletki+powlekane';
var htmlTitle	  = 'Pelethrocin+-+zarejestrowany+w+2002+jako+odpowiednik+Detralex%27u';
var metaKeywords  = 'diosmina%2C+zmikronizowana+diosmina%2C+frakcja+bioflawonoidowa%2C+diosmine%2C+diosminum%2C+hesperydyna%2C+hesperidinum%2C+bioflawonoidy%2C+niewydolno%C5%9B%C4%87+%C5%BCylna%2C+CVI%2C+%C5%BCylaki%2C+obrz%C4%99ki%2C+nocne+kurcze%2C+uczucie+ci%C4%99%C5%BCko%C5%9Bci+n%C3%B3g%2C+b%C3%B3l%2C+ci%C4%99%C5%BCkie+nogi%2C+hemoroidy%2C+%C5%BCylaki+odbytu%2C+tani%2C+odpowiednik%2C+generyk%2C+b%C3%B3l+n%C3%B3g%2C+zm%C4%99czone+nogi%2C+nogi+jak+z+waty%2C+siedz%C4%85ca+praca%2C+stoj%C4%85ca+praca%2C+po%C5%84czochy+przeciw%C5%BCylakowe%2C+przeciwobrz%C4%99kowe%2C+kr%C4%85%C5%BCenie+%C5%BCylne%2C+%C5%BCylak%2C+zaburzenia+kr%C4%85%C5%BCenia%2C+%C5%BCylnego%2C+zimne+nogi%2C+kurcze+n%C3%B3g%2C+obrz%C4%99k+limfatyczny%2C+%C5%BCylaki+odbytu%2C+hemoroidy%2C+guzki+krwawnicze%2C+krwawienie+z+odbytu%2C+krew+w+stolcu%2C+krew+na+stolcu%2C+krew+w+kupie%2C+';
var metaContents  = 'Strona+po%C5%9Bwiecona+lekowi+Pelethrocin+zawieraj%C4%85cemu+zmikronizowan%C4%85+diosmin%C4%99.+Stosowanemu+w+leczeniu+objaw%C3%B3w+zwi%C4%85zanych+z+niewydolno%C5%9Bci%C4%85+%C5%BCyln%C4%85+ko%C5%84czyn+dolnych+takich+jak+uczucie+ci%C4%99%C5%BCko%C5%9Bci+n%C3%B3g%2C+b%C3%B3l%2C+nocne+kurcze%2C+obrz%C4%99ki+pochodzenia+%C5%BCylnego%2C+%C5%BCylaki%2C+oraz+zaostrzeniu+dolegliwo%C5%9Bci+zwi%C4%85zanych+z+%C5%BCylakami+odbytu%2C+hemoroidami.';
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();
};

