/* [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','35501',jdecode('STRONA+G%C5%81%C3%93WNA'),jdecode(''),'/35501.html','true',[],''],
	['PAGE','71312',jdecode('OFERTA'),jdecode(''),'/71312.html','true',[],''],
	['PAGE','37401',jdecode('PROMOCJA+%21'),jdecode(''),'/37401.html','true',[],''],
	['PAGE','26101',jdecode('O+NAS'),jdecode(''),'/26101.html','true',[],''],
	['PAGE','83312',jdecode('DLACZEGO+MY'),jdecode(''),'/83312.html','true',[],''],
	['PAGE','24122',jdecode('JAK+DZIA%C5%81AMY'),jdecode(''),'/24122.html','true',[],''],
	['PAGE','24164',jdecode('ANKIETA'),jdecode(''),'/24164.html','true',[],''],
	['PAGE','24185',jdecode('KONTAKT'),jdecode(''),'/24185.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Vienna';
theSitetree.paletteFamily='CBE1FC';
theSitetree.keyvisualId='11894';
theSitetree.keyvisualName='kv_11894.jpg';
theSitetree.fontsetId='36001';
theSitetree.graphicsetId='14091';
theSitetree.contentColor='223144';
theSitetree.contentBGColor='d6e7fe';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				name: 			'Vienna',
				paletteFamily: 	'CBE1FC',
				keyvisualId: 	'11894',
				keyvisualName: 	'kv_11894.jpg',
				fontsetId: 		'36001',
				graphicsetId: 	'14091',
				contentColor: 	'223144',
				contentBGColor: 'd6e7fe',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'D6E7FE',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24185',
internalId:  '',
customField: '20100207-213659'
};
webappMappings['7008']=webappMappings['7008-5198']={
webappId:    '7008',
documentId:  '24164',
internalId:  '5198',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-5199']={
webappId:    '7008',
documentId:  '24185',
internalId:  '5199',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24164',
internalId:  '',
customField: '20100207-213557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24122',
internalId:  '',
customField: '20100317-214854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83312',
internalId:  '',
customField: '20100506-112808'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '35501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26101',
internalId:  '',
customField: '20100319-201618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35501',
internalId:  '',
customField: '20100207-194303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71312',
internalId:  '',
customField: '20100323-172937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37401',
internalId:  '',
customField: '20100323-153107'
};
var canonHostname = 'cm4all.az.pl';
var accountId     = 'AAZ010IN3RTX';
var companyName   = '%C5%9ALUBNA+BRYGADA+-+Wedding+Planner';
var htmlTitle	  = '';
var metaKeywords  = 'organizacja%2C+organizowanie%2C+wesela%2C+wesele%2C+impreza%2C+urodziny%2C+przyj%C4%99cie%2C+komunia%2C+bankiet%2C+organizatorka%2C+planner%2C+wedding+planner%2C+%C5%9Blub%2C+uroczysto%C5%9B%C4%87%2C+koordynator+weselny%2C+koordynator%2C+zaproszenia%2C+dekoracje%2C+kwiaty%2C+lokal%2C+plener%2C+zamek%2C+fotograf%2C+DJ%2C+restauracja%2C+hotel%2C+%C5%9Bluby%2C+imprezy%2C+agencja%2C+agencja+%C5%9Blubna%2C+konsultant%2C+portal+weselny%2C+koordynacja%2C+ten+dzie%C5%84%2C+dzie%C5%84+%C5%9Blubu%2C+florystyka%2C+opieka+nad+dzie%C4%87mi%2C+video%2C+limuzyna%2C+auto%2C+tort%2C+konsultant+%C5%9Blubny%2C+agencje+%C5%9Blubne%2C+ceremonia%2C+zesp%C3%B3%C5%82+muzyczny%2C+wodzirej%2C+kamerzysta%2C+nauka+ta%C5%84ca%2C+pokaz+ta%C5%84ca%2C+poprawiny%2C+oczepiny%2C+imprezy+firmowe%2C+jubileusze%2C+imprezy+integracyjne%2C+przyj%C4%99cia%2C+pa%C5%82acyk%2C+pa%C5%82ac%2C+dworek%2C+rezydencja%2C+foto.';
var metaContents  = '%C5%9ALUBNA+BRYGADA+-+Konsultant+%C5%9Alubny.Kompleksowa+organizacja+i+koordynacja+%C5%9Blubu+oraz+wesela.+Organizowanie+imprez+takich+jak%3A+wesela%2C+komunie%2C+chrzty%2C+bale%2C+jubileusze%2C+urodziny%2C+imprezy+integracyjne%2C+bankiety%2C+spotkania+rodzinne+oraz+inne.Dzia%C5%82amy+na+terenie+Tr%C3%B3jmiasta+oraz+wojew%C3%B3dztwa+pomorskiego.';
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();
};
