/* [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','4701',jdecode('Strona+g%C5%82%C3%B3wna'),jdecode(''),'/4701/index.html','true',[ 
		['PAGE','31901',jdecode('Zmiany+TPSA'),jdecode(''),'/4701/31901.html','true',[],'','']
	],'',''],
	['PAGE','23201',jdecode('Promocje'),jdecode(''),'/23201.html','true',[],'',''],
	['PAGE','9501',jdecode('Oferta'),jdecode(''),'/9501/index.html','true',[ 
		['PAGE','26701',jdecode('Artyku%C5%82y+reklamowe'),jdecode(''),'/9501/26701.html','true',[],'',''],
		['PAGE','26722',jdecode('Piecz%C4%85tki+i+wizyt%C3%B3wki'),jdecode(''),'/9501/26722.html','true',[],'',''],
		['PAGE','28201',jdecode('Serwery+i+poczta+e-mail'),jdecode(''),'/9501/28201.html','true',[],'','']
	],'',''],
	['PAGE','9543',jdecode('O+nas'),jdecode(''),'/9543/index.html','true',[ 
		['PAGE','16722',jdecode('Sponsoring'),jdecode(''),'/9543/16722.html','true',[],'','']
	],'',''],
	['PAGE','9606',jdecode('Kontakt'),jdecode(''),'/9606/index.html','true',[ 
		['PAGE','17501',jdecode('Zadaj+pytanie'),jdecode(''),'/9606/17501.html','true',[],'','']
	],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Business';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='2487';
theSitetree.keyvisualName='seminar.jpg';
theSitetree.fontsetId='27028';
theSitetree.graphicsetId='463';
theSitetree.contentColor='575757';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Business',
				paletteFamily: 	'003366',
				keyvisualId: 	'2487',
				keyvisualName: 	'seminar.jpg',
				fontsetId: 		'27028',
				graphicsetId: 	'463',
				contentColor: 	'575757',
				contentBGColor: 'FFFFFF',
				a_color: 		'003366',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20100915-124124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16722',
internalId:  '',
customField: '20091121-095755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9543',
internalId:  '',
customField: '20091204-101458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9606',
internalId:  '',
customField: '20091204-101417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9501',
internalId:  '',
customField: '20091106-151702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26701',
internalId:  '',
customField: '20091118-113654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28201',
internalId:  '',
customField: '20091120-155544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26722',
internalId:  '',
customField: '20091106-131104'
};
webappMappings['7008']=webappMappings['7008-4788']={
webappId:    '7008',
documentId:  '17501',
internalId:  '4788',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20091105-115859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20100915-123158'
};
webappMappings['1501']=webappMappings['1501-7765850']={
webappId:    '1501',
documentId:  '4701',
internalId:  '7765850',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31901',
internalId:  '',
customField: '20091127-095853'
};
var canonHostname = 'wsc0.home.net.pl';
var accountId     = 'AHPL10INZSFB';
var companyName   = 'mo%C5%BCemy+wszystko+...%2C+wszystko+dla+biura';
var htmlTitle	  = 'SEVEN+wszystko+dla+biura+++++++++++++++++++++++.....od+spinacza+do+komputera+....';
var metaKeywords  = 'seven%2C+biuroserwis%2C+K%C4%99pno%2C+Jaros%C5%82aw+Skiba%2C+materia%C5%82y+biurowe';
var metaContents  = 'Firma+SEVEN+wszystko+dla+biura+powsta%C5%82a+w+1991+roku.+Wieloletnie+do%C5%9Bwiadczenie+pozwala+nam+w+profesjonalny+spos%C3%B3b+realizowa%C4%87+r%C3%B3%C5%BCnorodne+zam%C3%B3wienia+naszych+Klient%C3%B3w.++';
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();
};

