/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],''],
	['PAGE','43401',jdecode('Balony+Lataj%C4%85ce+%28hel%29'),jdecode(''),'/43401.html','true',[],''],
	['PAGE','43601',jdecode('Sterowce+%28hel%29'),jdecode(''),'/43601.html','true',[],''],
	['PAGE','43901',jdecode('Figury+%28hel%29'),jdecode(''),'/43901.html','true',[],''],
	['PAGE','44201',jdecode('Balony+Stacjonarne'),jdecode(''),'/44201.html','true',[],''],
	['PAGE','44222',jdecode('Fotografia+Lotnicza'),jdecode(''),'/44222.html','true',[],''],
	['PAGE','43922',jdecode('Drukarnia'),jdecode(''),'/43922.html','true',[],''],
	['PAGE','43422',jdecode('Reklamy'),jdecode(''),'/43422.html','true',[],''],
	['PAGE','43443',jdecode('Poligrafia'),jdecode(''),'/43443.html','true',[],''],
	['PAGE','4822',jdecode('Kontakt'),jdecode(''),'/4822.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Stripes';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='1573';
theSitetree.keyvisualName='haengematte.jpg';
theSitetree.fontsetId='26858';
theSitetree.graphicsetId='312';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='FCFCFB';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				name: 			'Stripes',
				paletteFamily: 	'660000',
				keyvisualId: 	'1573',
				keyvisualName: 	'haengematte.jpg',
				fontsetId: 		'26858',
				graphicsetId: 	'312',
				contentColor: 	'A00000',
				contentBGColor: 'FCFCFB',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'660000',
				b_color: 		'DEDECA',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20090201-164230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4822',
internalId:  '',
customField: '20090131-214307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43901',
internalId:  '',
customField: '20090131-210051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43401',
internalId:  '',
customField: '20090516-165746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43601',
internalId:  '',
customField: '20090516-170031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44201',
internalId:  '',
customField: '20090131-212605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44222',
internalId:  '',
customField: '20090131-213231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43922',
internalId:  '',
customField: '20090131-213439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43422',
internalId:  '',
customField: '20090131-213727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43443',
internalId:  '',
customField: '20090131-214144'
};
var canonHostname = 'wsc2.home.net.pl';
var accountId     = 'AHPL10INVMJY';
var companyName   = 'Wi%C4%99cej+Ni%C5%BC+Reklama...';
var htmlTitle	  = 'Balony+reklamowe+na+hel%2C+sterowce%2C+sterowiec+na+hel%2C+balon+reklamowy%2C+balon+na+hel...';
var metaKeywords  = 'druk+wielkoformatowy+krak%C3%B3w%2C+drukarnia+wielkoformatowa%2C+krak%C3%B3w%2C+skawina%2C+baner%2C+siatka%2C+fototapeta%2C+fototapety%2C+folia%2C+plakat%2C+bilbord%2C+bilboard%2C+reklama%2C+reklamy%2C++';
var metaContents  = 'Drukarnia+Wielkoformatowa+Krak%C3%B3w+-+Skawina.+Tani+druk+wielkoformatowy.+Wielkoformatowy+druk+solventowy+tanio.+Krak%C3%B3w+-+Skawina.+Drukarnia+Krak%C3%B3w.+Drukowanie+-+Skawina.+Druk+Wielkoformatowy+krak%C3%B3w.+Plakat%2C+bilboard%2C+baner%2C+fototapeta%2C+reklama%2C+reklamy.+Druk+Wielkoformatowy.+Drukarnia%2C+Drukarnia+Krak%C3%B3w.+Drukarnia+Skawina';
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();
};

