/* [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','25601',jdecode('start'),jdecode(''),'/pracownia-start.html','true',[],''],

	['PAGE','7052',jdecode('Logowanie'),jdecode(''),'/7052.html','true',[],''],

	['PAGE','7073',jdecode('Badania+kierowc%C3%B3w'),jdecode(''),'/7073.html','true',[],''],

	['PAGE','7094',jdecode('Testy+online'),jdecode(''),'/7094.html','true',[],''],

	['PAGE','7115',jdecode('O+mnie'),jdecode(''),'/7115/index.html','true',[ 

		['PAGE','32901',jdecode('Info'),jdecode(''),'/7115/32901.html','true',[],''],

		['PAGE','32922',jdecode('Moje+artyku%C5%82y'),jdecode(''),'/7115/32922.html','true',[],'']

	],''],

	['PAGE','7136',jdecode('Produkty'),jdecode(''),'/7136/index.html','true',[ 

		['PAGE','32943',jdecode('O+programach'),jdecode(''),'/7136/32943.html','true',[],''],

		['PAGE','32964',jdecode('Dost%C4%99pne+programy'),jdecode(''),'/7136/32964.html','true',[],''],

		['PAGE','32985',jdecode('Moje+zdj%C4%99cia'),jdecode(''),'/7136/32985.html','true',[],'']

	],''],

	['PAGE','7157',jdecode('Pobierz'),jdecode(''),'/7157/index.html','true',[ 

		['PAGE','33006',jdecode('Wersje+demo'),jdecode(''),'/7157/33006.html','true',[],''],

		['PAGE','33027',jdecode('Pe%C5%82ne+wersje'),jdecode(''),'/7157/33027.html','true',[],''],

		['PAGE','33048',jdecode('Darmowe+wersje'),jdecode(''),'/7157/33048.html','true',[],'']

	],''],

	['PAGE','7178',jdecode('Pomoc'),jdecode(''),'/7178/index.html','true',[ 

		['PAGE','33069',jdecode('FAQ'),jdecode(''),'/7178/33069.html','true',[],''],

		['PAGE','33090',jdecode('Mapa+strony'),jdecode(''),'/7178/33090.html','true',[],''],

		['PAGE','33111',jdecode('Ksi%C4%99ga+go%C5%9Bci'),jdecode(''),'/7178/33111.html','true',[],''],

		['PAGE','33132',jdecode('Forum'),jdecode(''),'/7178/33132.html','true',[],''],

		['PAGE','33153',jdecode('Blog'),jdecode(''),'/7178/33153.html','true',[],'']

	],''],

	['PAGE','7199',jdecode('Kontakt'),jdecode(''),'/7199.html','true',[],'']];

var siteelementCount=22;

theSitetree.topTemplateName='Valiant';

theSitetree.paletteFamily='25882F';

theSitetree.keyvisualId='9814';

theSitetree.keyvisualName='kv_9814.jpg';

theSitetree.fontsetId='28214';

theSitetree.graphicsetId='13033';

theSitetree.contentColor='646464';

theSitetree.contentBGColor='FFFFFF';

var localeDef={

  language: 'pl',

  country: 'PL'

};

var theTemplate={

				name: 			'Valiant',

				paletteFamily: 	'25882F',

				keyvisualId: 	'9814',

				keyvisualName: 	'kv_9814.jpg',

				fontsetId: 		'28214',

				graphicsetId: 	'13033',

				contentColor: 	'646464',

				contentBGColor: 'FFFFFF',

				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:     'false'

			  };

var webappMappings = {};

webappMappings['1501']=webappMappings['1501-9045550']={

webappId:    '1501',

documentId:  '25601',

internalId:  '9045550',

customField: '1501'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '7052',

internalId:  '',

customField: '20090411-205248'

};

webappMappings['1501']=webappMappings['1501-1501']={

webappId:    '1501',

documentId:  '25601',

internalId:  '1501',

customField: '1501'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '7073',

internalId:  '',

customField: '20090411-205248'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '7094',

internalId:  '',

customField: '20090411-205248'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '7115',

internalId:  '',

customField: '20090411-205248'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '7136',

internalId:  '',

customField: '20090411-205248'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '7157',

internalId:  '',

customField: '20090411-205248'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '7178',

internalId:  '',

customField: '20090411-205248'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '7199',

internalId:  '',

customField: '20090411-205248'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '25601',

internalId:  '',

customField: '20090510-211114'

};

webappMappings['1006']=webappMappings['1006-1006']={

webappId:    '1006',

documentId:  '25601',

internalId:  '1006',

customField: '1006'

};

webappMappings['5001']=webappMappings['5001-']={

webappId:    '5001',

documentId:  '25601',

internalId:  '',

customField: 'language:pl;country:PL;'

};

webappMappings['5001']=webappMappings['5001-']={

webappId:    '5001',

documentId:  '7052',

internalId:  '',

customField: 'language:pl;country:PL;'

};

webappMappings['5001']=webappMappings['5001-']={

webappId:    '5001',

documentId:  '7073',

internalId:  '',

customField: 'language:pl;country:PL;'

};

webappMappings['5001']=webappMappings['5001-']={

webappId:    '5001',

documentId:  '7094',

internalId:  '',

customField: 'language:pl;country:PL;'

};

webappMappings['5001']=webappMappings['5001-']={

webappId:    '5001',

documentId:  '7115',

internalId:  '',

customField: 'language:pl;country:PL;'

};

webappMappings['5001']=webappMappings['5001-']={

webappId:    '5001',

documentId:  '7136',

internalId:  '',

customField: 'language:pl;country:PL;'

};

webappMappings['5001']=webappMappings['5001-']={

webappId:    '5001',

documentId:  '7157',

internalId:  '',

customField: 'language:pl;country:PL;'

};

webappMappings['5001']=webappMappings['5001-']={

webappId:    '5001',

documentId:  '7178',

internalId:  '',

customField: 'language:pl;country:PL;'

};

webappMappings['5001']=webappMappings['5001-']={

webappId:    '5001',

documentId:  '7199',

internalId:  '',

customField: 'language:pl;country:PL;'

};

webappMappings['7060']=webappMappings['7060-32cce7ef7355944c36f90827e510fdd4']={

webappId:    '7060',

documentId:  '32985',

internalId:  '32cce7ef7355944c36f90827e510fdd4',

customField: 'language:pl;country:PL;'

};

webappMappings['1002']=webappMappings['1002-33111ahpl10inzp6k']={

webappId:    '1002',

documentId:  '33111',

internalId:  '33111ahpl10inzp6k',

customField: 'icq=false'

};

webappMappings['1003']=webappMappings['1003-ahpl10inzp6k12130dd89c6']={

webappId:    '1003',

documentId:  '33132',

internalId:  'ahpl10inzp6k12130dd89c6',

customField: 'pl:PL'

};

webappMappings['7050']=webappMappings['7050-263']={

webappId:    '7050',

documentId:  '33153',

internalId:  '263',

customField: 'language:pl;country:PL;'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '32901',

internalId:  '',

customField: '20090511-200933'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '32922',

internalId:  '',

customField: '20090511-200933'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '32943',

internalId:  '',

customField: '20090511-200933'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '32964',

internalId:  '',

customField: '20090511-200933'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '32985',

internalId:  '',

customField: '20090511-200933'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '33006',

internalId:  '',

customField: '20090511-200933'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '33027',

internalId:  '',

customField: '20090511-200933'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '33048',

internalId:  '',

customField: '20090511-200933'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '33069',

internalId:  '',

customField: '20090511-200933'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '33090',

internalId:  '',

customField: '20090511-200933'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '33111',

internalId:  '',

customField: '20090511-200933'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '33132',

internalId:  '',

customField: '20090511-200933'

};

webappMappings['5000']=webappMappings['5000-']={

webappId:    '5000',

documentId:  '33153',

internalId:  '',

customField: '20090511-200933'

};

var canonHostname = 'wsc0.home.net.pl';

var accountId     = 'AHPL10INZP6K';

var companyName   = 'BAS67+Pracownia+Psychologiczno-Informatyczna';

var htmlTitle	  = 'Testy+Psychologiczne+-+BAS67+Pracownia+Psychologiczno+-+Informatyczna';

var metaKeywords  = '';

var metaContents  = '';

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();
};

