/* [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','1814',jdecode('HOME'),jdecode(''), jdecode('%2F1814.html'), 'true',[],'',''],
	['PAGE','185312',jdecode('AKTUALNO%C5%9ACI'),jdecode(''), jdecode('%2F185312.html'), 'true',[],'',''],
	['PAGE','21001',jdecode('O+SZKOLE'),jdecode(''), jdecode('%2F21001.html'), 'true',[],'',''],
	['PAGE','2048',jdecode('ZAPISY'),jdecode(''), jdecode('%2F2048.html'), 'true',[],'',''],
	['PAGE','146912',jdecode('METODY+NAUCZANIA'),jdecode(''), jdecode('%2F146912%2Findex.html'), 'true',[ 
		['PAGE','146933',jdecode('Direct+English'),jdecode(''), jdecode('%2F146912%2F146933.html'), 'true',[],'',''],
		['PAGE','158512',jdecode('Direktes+Deutsch'),jdecode(''), jdecode('%2F146912%2F158512.html'), 'true',[],'',''],
		['PAGE','146954',jdecode('Kursy+metod%C4%85+tradycyjn%C4%85'),jdecode(''), jdecode('%2F146912%2F146954.html'), 'true',[],'','']
	],'',''],
	['PAGE','146612',jdecode('NASZA+OFERTA'),jdecode(''), jdecode('%2F146612%2Findex.html'), 'true',[ 
		['PAGE','146633',jdecode('Zaj%C4%99cia+indywidualne'),jdecode(''), jdecode('%2F146612%2F146633.html'), 'true',[],'',''],
		['PAGE','146654',jdecode('Mini-grupy+prywatne'),jdecode(''), jdecode('%2F146612%2F146654.html'), 'true',[],'',''],
		['PAGE','146675',jdecode('Grupy+standardowe'),jdecode(''), jdecode('%2F146612%2F146675.html'), 'true',[],'','']
	],'',''],
	['PAGE','169954',jdecode('MATURA'),jdecode(''), jdecode('%2F169954.html'), 'true',[],'',''],
	['PAGE','171312',jdecode('POZIOMY+ZAAWANSOWANIA'),jdecode(''), jdecode('%2F171312.html'), 'true',[],'',''],
	['PAGE','147212',jdecode('CENNIK'),jdecode(''), jdecode('%2F147212%2Findex.html'), 'true',[ 
		['PAGE','147233',jdecode('Lekcje+indywidualne'),jdecode(''), jdecode('%2F147212%2F147233.html'), 'true',[],'',''],
		['PAGE','147254',jdecode('Mini-grupy+2-4+os%C3%B3b'),jdecode(''), jdecode('%2F147212%2F147254.html'), 'true',[],'',''],
		['PAGE','147275',jdecode('Grupy+standardowe+5-7+os%C3%B3b'),jdecode(''), jdecode('%2F147212%2F147275.html'), 'true',[],'','']
	],'',''],
	['PAGE','188812',jdecode('DNI+WOLNE+I+FERIE'),jdecode(''), jdecode('%2F188812.html'), 'true',[],'',''],
	['PAGE','160612',jdecode('PRACA'),jdecode(''), jdecode('%2F160612.html'), 'true',[],'',''],
	['PAGE','21106',jdecode('KONTAKT'),jdecode(''), jdecode('%2F21106.html'), 'true',[],'',''],
	['PAGE','193812',jdecode('MEDIA'),jdecode(''), jdecode('%2F193812.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Human';
theSitetree.paletteFamily='601A15';
theSitetree.keyvisualId='11095';
theSitetree.keyvisualName='kv_11095.jpg';
theSitetree.fontsetId='32780';
theSitetree.graphicsetId='13819';
theSitetree.contentColor='3C3D3C';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var prodDef={
  wl_name: 'azpl',
  product: 'WSCSYSSSSLY0XKDV'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Human',
				paletteFamily: 	'601A15',
				keyvisualId: 	'11095',
				keyvisualName: 	'kv_11095.jpg',
				fontsetId: 		'32780',
				graphicsetId: 	'13819',
				contentColor: 	'3C3D3C',
				contentBGColor: 'FFFFFF',
				a_color: 		'601A15',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '193812',
internalId:  '',
customField: '20111118-213511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '169954',
internalId:  '',
customField: '20110221-224234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1814',
internalId:  '',
customField: '20120107-193353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147275',
internalId:  '',
customField: '20110830-164612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146612',
internalId:  '',
customField: '20110830-165229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147212',
internalId:  '',
customField: '20110830-181539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147233',
internalId:  '',
customField: '20110830-162440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147254',
internalId:  '',
customField: '20110830-181952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2048',
internalId:  '',
customField: '20111021-112046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158512',
internalId:  '',
customField: '20110815-130311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146954',
internalId:  '',
customField: '20110114-182735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146633',
internalId:  '',
customField: '20101109-120727'
};
webappMappings['7008']=webappMappings['7008-4937']={
webappId:    '7008',
documentId:  '21106',
internalId:  '4937',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146933',
internalId:  '',
customField: '20110815-130224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20101023-230719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21106',
internalId:  '',
customField: '20111021-112627'
};
webappMappings['7008']=webappMappings['7008-4976']={
webappId:    '7008',
documentId:  '2048',
internalId:  '4976',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146654',
internalId:  '',
customField: '20101018-152634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146675',
internalId:  '',
customField: '20110830-165143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '188812',
internalId:  '',
customField: '20110829-174632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '185312',
internalId:  '',
customField: '20110629-171443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '160612',
internalId:  '',
customField: '20111021-112435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146912',
internalId:  '',
customField: '20110815-130408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '171312',
internalId:  '',
customField: '20110310-225650'
};
var webAppHostname = 'cgi-kreatorstron.az.pl:80';
var canonHostname = 'cm4all.az.pl';
var accountId     = 'AAZ010IN3QNP';
var companyName   = 'Centrum+J%C4%99zyk%C3%B3w+Obcych+PERFECT+w+Raciborzu';
var htmlTitle	  = 'PERFECT+SCHOOL+-+szko%C5%82a+j%C4%99zykowa+w+Raciborzu';
var metaKeywords  = '';
var metaContents  = 'Szko%C5%82a+J%C4%99zykowa+w+Raciborzu.+J%C4%99zyk+angielski+metod%C4%85+DIRECT+ENGLISH.+Metoda+Callana.+Matura.+FCE%2FCAE%2FCPE.+Kursy+biznesowe.+Kursy+dla+dzieci.+Zaj%C4%99cia+w+ma%C5%82ych+grupach+4-6+os%C3%B3b.+Zaj%C4%99cia+indywidualne.+UL.+SOLNA+21.+Tel.+032+740+3333%2C+606+355+514.';
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();
};

