/* [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','2301',jdecode('Strona+G%C5%82%C3%B3wna'),jdecode(''),'/2301.html','true',[],'',''],
	['PAGE','2352',jdecode('Oferta+dla+Ciebie'),jdecode(''),'/2352/index.html','true',[ 
		['PAGE','2394',jdecode('Cenniki'),jdecode(''),'/2352/2394.html','true',[],'',''],
		['PAGE','3001',jdecode('Aktualny+grafik+zaj%C4%99%C4%87'),jdecode(''),'/2352/3001.html','true',[],'','']
	],'',''],
	['PAGE','2415',jdecode('Oferta+dla+Biznesu'),jdecode(''),'/2415/index.html','true',[ 
		['PAGE','2436',jdecode('Zaufali+nam'),jdecode(''),'/2415/2436.html','true',[],'',''],
		['PAGE','2457',jdecode('Zapytanie+o+cen%C4%99'),jdecode(''),'/2415/2457.html','true',[],'','']
	],'',''],
	['PAGE','2373',jdecode('Nasi+Lektorzy'),jdecode(''),'/2373.html','true',[],'',''],
	['PAGE','2478',jdecode('Kontakt'),jdecode(''),'/2478/index.html','true',[ 
		['PAGE','2499',jdecode('Formularz+zapytania%3A'),jdecode(''),'/2478/2499.html','true',[],'','']
	],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Diablo';
theSitetree.paletteFamily='379356';
theSitetree.keyvisualId='8769';
theSitetree.keyvisualName='kv_8769.jpg';
theSitetree.fontsetId='28183';
theSitetree.graphicsetId='12468';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E6E6E6';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Diablo',
				paletteFamily: 	'379356',
				keyvisualId: 	'8769',
				keyvisualName: 	'kv_8769.jpg',
				fontsetId: 		'28183',
				graphicsetId: 	'12468',
				contentColor: 	'000000',
				contentBGColor: 'E6E6E6',
				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['7008']=webappMappings['7008-4951']={
webappId:    '7008',
documentId:  '2457',
internalId:  '4951',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-4952']={
webappId:    '7008',
documentId:  '2499',
internalId:  '4952',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20091026-161128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20091021-111816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2352',
internalId:  '',
customField: '20091021-095348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2394',
internalId:  '',
customField: '20091026-160946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2478',
internalId:  '',
customField: '20091021-114218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2499',
internalId:  '',
customField: '20091021-113142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2415',
internalId:  '',
customField: '20091026-162721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2373',
internalId:  '',
customField: '20091021-092530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2457',
internalId:  '',
customField: '20091021-110551'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2436',
internalId:  '',
customField: '20091021-093709'
};
var canonHostname = 'wsc0.home.net.pl';
var accountId     = 'AHPL10INPDVJ';
var companyName   = 'Szko%C5%82a+J%C4%99zyk%C3%B3w+Obcych+Evergreen';
var htmlTitle	  = 'Kursy+J%C4%99zykowe+dla+Firm+i+Os%C3%B3b+Prywatnych+Wroc%C5%82aw+-+Szko%C5%82a+J%C4%99zyk%C3%B3w+Obcych+Evergreen%2C+Wroc%C5%82aw+Ma%C5%9Blice+Ma%C5%82e';
var metaKeywords  = 'Kursy+j%C4%99zykowe+dla+firm%2C+szkolenia+j%C4%99zykowe%2C+sjo+evergreen%2C+ma%C5%9Blice+ma%C5%82e%2C+biznes+english%2C+business+english%2C+j%C4%99zyk+polski+dla+obcokrajowc%C3%B3w%2C+Ma%C5%9Blice+Ma%C5%82e%2C+Wroc%C5%82aw%2C+dolny+%C5%9Bl%C4%85sk%2C+obs%C5%82uga+j%C4%99zykowa+przedsi%C4%99biorstw%2C+wyjazdowe+kursy+j%C4%99zykowe%2C+szkolenia+pracownik%C3%B3w%2C+szkolenia+pracownicze%2C+fundusze+unijne%2C+';
var metaContents  = 'Szko%C5%82a+J%C4%99zyk%C3%B3w+Obcych+Evergreen+-+Witamy%21+Prowadzimy+Kursy+j%C4%99zykowe+dla+firm+i+os%C3%B3b+prywatnych.+Kursy+j%C4%99zyka+angielskiego%2C+niemieckiego%2C+kursy+j%C4%99zyka+polskiego+dla+obcokrajowc%C3%B3w.+Siedziba+naszej+Szko%C5%82y+znajduje+si%C4%99+we+Wroc%C5%82awiu%2C+na+osiedlu+Ma%C5%9Blice+Ma%C5%82e%2C+ale+obs%C5%82ugujemy+rejon+ca%C5%82ego+miasta+i+okolicznych+miejscowo%C5%9Bci+w+zakresie+szkole%C5%84+j%C4%99zykowych+organizowanych+przez+firmy+w+regionie.';
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();
};

