/* [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','2201',jdecode('TRIKKE.PL'),jdecode(''), jdecode('%2F2201.html'), 'true',[],'',''],
	['PAGE','2401',jdecode('Info'),jdecode(''), jdecode('%2F2401.html'), 'true',[],'',''],
	['PAGE','3101',jdecode('TRIKKE+dla+Ciebie'),jdecode(''), jdecode('%2F3101%2Findex.html'), 'true',[ 
		['PAGE','2801',jdecode('Trikke+8'),jdecode(''), jdecode('%2F3101%2F2801.html'), 'true',[],'',''],
		['PAGE','2843',jdecode('Trikke+78'),jdecode(''), jdecode('%2F3101%2F2843.html'), 'true',[],'',''],
		['PAGE','2864',jdecode('Elektryczna+hybryda'),jdecode(''), jdecode('%2F3101%2F2864.html'), 'true',[],'',''],
		['PAGE','2885',jdecode('SKKI+Trikke'),jdecode(''), jdecode('%2F3101%2F2885.html'), 'true',[],'',''],
		['PAGE','3401',jdecode('akcesoria'),jdecode(''), jdecode('%2F3101%2F3401.html'), 'true',[],'','']
	],'',''],
	['PAGE','2822',jdecode('Galeria'),jdecode(''), jdecode('%2F2822.html'), 'true',[],'',''],
	['PAGE','2464',jdecode('Kontakt'),jdecode(''), jdecode('%2F2464.html'), 'true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Lounge';
theSitetree.paletteFamily='4DB1CB';
theSitetree.keyvisualId='11710';
theSitetree.keyvisualName='kv_11710.jpg';
theSitetree.fontsetId='35045';
theSitetree.graphicsetId='14004';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var prodDef={
  wl_name: 'azpl',
  product: 'WSCSYSSSSLY0XKDP'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Lounge',
				paletteFamily: 	'4DB1CB',
				keyvisualId: 	'11710',
				keyvisualName: 	'kv_11710.jpg',
				fontsetId: 		'35045',
				graphicsetId: 	'14004',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'B9B19D',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20110824-154541'
};
webappMappings['7008']=webappMappings['7008-7683']={
webappId:    '7008',
documentId:  '2464',
internalId:  '7683',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2464',
internalId:  '',
customField: '20110824-153518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2885',
internalId:  '',
customField: '20110105-231939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20110824-153354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20110105-231213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20110824-153433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20101209-181120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2822',
internalId:  '',
customField: '20110824-153456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2843',
internalId:  '',
customField: '20110516-112440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2864',
internalId:  '',
customField: '20110106-011304'
};
webappMappings['7060']=webappMappings['7060-dbf511722b00e1238728e5d7a9e1aad0']={
webappId:    '7060',
documentId:  '2822',
internalId:  'dbf511722b00e1238728e5d7a9e1aad0',
customField: 'language:pl;country:PL;'
};
var webAppHostname = 'cgi-kreatorstron.az.pl:80';
var canonHostname = 'cm4all.az.pl';
var accountId     = 'AAZ340INVQH5';
var companyName   = 'TRIKKE.PL+++++';
var htmlTitle	  = 'TRIKKE.PL+++global+invasion++++***sport***fitness***rekreacja***zabawa***';
var metaKeywords  = 'trikke%2C+sport%2C+fitnes%2C+rekreacja%2C+zabawa%2C+przygoda%2C+szale%C5%84stwo%2C+wyg%C5%82upy%2C+triki%2C+trike%2C+tricycle%2C+three+wheel%2C+3+wheel%2C+scooter%2C+segway%2C+bowflex%2C+fitness%2C+exercise%2C+aerobic%2C+treadmill%2C+ski%2C+skki%2C+trikke+8%2C+T8%2C+T12%2C+trikke12%2C+trikke+12%2C+pilates%2C+RV%2C+skating%2C+skiing%2C+skate%2C+bmx%2C+bike%2C+kick+bike%2C+bicycle%2C+workout%2C+health+club%2C+gym%2C+walking%2C+running%2C+jogging%2Cfitness+movie%2C+fitness+equipment%2C+trzyko%C5%82owiec%2C+hulajnoga';
var metaContents  = 'TRIKKE+prze%C5%82omowy+wynalazek%21+%C4%86wiczy+zwinno%C5%9B%C4%87%2C+si%C5%82%C4%99%2C+kondycj%C4%99+i+r%C3%B3wnowag%C4%99%21++Z+ostatniej+chwili...+Trikke+lepszy+ni%C5%BC+roboty+V+generacji+Wielkiego+Elektronika.';
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();
};

