/* [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','6001',jdecode('Informacje+og%C3%B3lne'),jdecode(''),'/6001.html','true',[],''],
	['PAGE','9219',jdecode('Charakterystyka+techniczna'),jdecode(''),'/9219/index.html','true',[ 
		['PAGE','14601',jdecode('W%C5%82a%C5%9Bciwo%C5%9Bci+polimerobetonu'),jdecode(''),'/9219/14601.html','true',[],''],
		['PAGE','26601',jdecode('Elementy+konstrukcyjne+zbiornik%C3%B3w'),jdecode(''),'/9219/26601.html','true',[],''],
		['PAGE','26622',jdecode('Wyposa%C5%BCenie+dodatkowe+zbiornik%C3%B3w'),jdecode(''),'/9219/26622.html','true',[],'']
	],''],
	['PAGE','15201',jdecode('Realizacja+zam%C3%B3wie%C5%84'),jdecode(''),'/15201.html','true',[],''],
	['PAGE','15243',jdecode('Dokumentacja+formalna'),jdecode(''),'/15243/index.html','true',[ 
		['PAGE','26706',jdecode('Krajowa+deklaracja+zgodno%C5%9Bci'),jdecode(''),'/15243/26706.html','true',[],''],
		['PAGE','39301',jdecode('Informacja+o+wyrobie'),jdecode(''),'/15243/39301.html','true',[],''],
		['PAGE','26101',jdecode('Aprobata+techniczna'),jdecode(''),'/15243/26101.html','true',[],'']
	],''],
	['PAGE','30801',jdecode('Pobierz+pliki'),jdecode(''),'/30801/index.html','true',[ 
		['PAGE','13901',jdecode('Karty+katalogowe+zbiornik%C3%B3w'),jdecode(''),'/30801/13901.html','true',[],''],
		['PAGE','26643',jdecode('Karta+zam%C3%B3wienia+zbiornika'),jdecode(''),'/30801/26643.html','true',[],''],
		['PAGE','26664',jdecode('Instrukcja+transportu%2C+roz%C5%82adunku+i+monta%C5%BCu'),jdecode(''),'/30801/26664.html','true',[],''],
		['PAGE','26685',jdecode('Zestawienie+wag+zbiornik%C3%B3w'),jdecode(''),'/30801/26685.html','true',[],'']
	],''],
	['PAGE','15264',jdecode('Wy%C5%9Blij+zapytanie'),jdecode(''),'/15264.html','true',[],''],
	['PAGE','14001',jdecode('Kontakt'),jdecode(''),'/14001.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Citadel';
theSitetree.paletteFamily='7C693A';
theSitetree.keyvisualId='8134';
theSitetree.keyvisualName='kv_8134.jpg';
theSitetree.fontsetId='28169';
theSitetree.graphicsetId='12399';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='7C693A';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				name: 			'Citadel',
				paletteFamily: 	'7C693A',
				keyvisualId: 	'8134',
				keyvisualName: 	'kv_8134.jpg',
				fontsetId: 		'28169',
				graphicsetId: 	'12399',
				contentColor: 	'FFFFFF',
				contentBGColor: '7C693A',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20090327-150120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9219',
internalId:  '',
customField: '20090327-185104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20090512-072152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20090410-094654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20090324-214405'
};
webappMappings['7008']=webappMappings['7008-2748']={
webappId:    '7008',
documentId:  '15264',
internalId:  '2748',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15264',
internalId:  '',
customField: '20090318-101635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15243',
internalId:  '',
customField: '20090327-185131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20090410-092237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26101',
internalId:  '',
customField: '20090329-152441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26601',
internalId:  '',
customField: '20090327-120955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26622',
internalId:  '',
customField: '20090324-214429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26706',
internalId:  '',
customField: '20090329-153124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26643',
internalId:  '',
customField: '20090329-150536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30801',
internalId:  '',
customField: '20090410-075057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26664',
internalId:  '',
customField: '20090415-081126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26685',
internalId:  '',
customField: '20090329-150908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39301',
internalId:  '',
customField: '20090324-214703'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6001',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'wsc0.home.net.pl';
var accountId     = 'AHPL10INZV73';
var companyName   = 'Prefabrykowane+zbiorniki+SOLIDKAN+z+polimerobetonu+';
var htmlTitle	  = 'Polimerobeton+-+zbiorniki+z+polimerobetonu%2C+SOLIDKAN+I+polimerobetony.pl';
var metaKeywords  = '+polimerobeton%2C+polimerobetony%2C+zbiorniki%2C++SOLIDKAN%2C+przepompownie+polimerobeton';
var metaContents  = 'Prefabrykowane+zbiorniki+SOLIDKAN+z+polimerobetonu+prod.+MEPROZET+Sp.+z+o.o.+w+Brzegu+-+%C5%9Brednice+DN800%2C+1000%2C+1200%2C+1500%2C+2000';
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();
};
