/* [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','10501',jdecode('O+Silesia+ART'),jdecode(''),'/10501.html','true',[],'',''],
	['PAGE','10552',jdecode('Grawerowanie+Laserowe'),jdecode(''),'/10552.html','true',[],'',''],
	['PAGE','10615',jdecode('Drukarnia'),jdecode(''),'/10615.html','true',[],'',''],
	['PAGE','10678',jdecode('Upominki+i+Gad%C5%BCety'),jdecode(''),'/10678.html','true',[],'',''],
	['PAGE','10594',jdecode('Piecz%C4%85tki'),jdecode(''),'/10594.html','true',[],'',''],
	['PAGE','32729',jdecode('Fotografia'),jdecode(''),'/32729.html','true',[],'',''],
	['PAGE','10720',jdecode('Puchary+i+Trofea'),jdecode(''),'/10720.html','true',[],'',''],
	['PAGE','10573',jdecode('Do+pobrania'),jdecode(''),'/10573.html','true',[],'',''],
	['PAGE','10657',jdecode('Kontakt'),jdecode(''),'/10657.html','true',[],'',''],
	['PAGE','138911',jdecode('Nasi+Klienci'),jdecode(''),'/138911.html','false',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Phase';
theSitetree.paletteFamily='4EDBE4';
theSitetree.keyvisualId='12161';
theSitetree.keyvisualName='kv_12161.jpg';
theSitetree.fontsetId='36963';
theSitetree.graphicsetId='14197';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='888888';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Phase',
				paletteFamily: 	'4EDBE4',
				keyvisualId: 	'12161',
				keyvisualName: 	'kv_12161.jpg',
				fontsetId: 		'36963',
				graphicsetId: 	'14197',
				contentColor: 	'FFFFFF',
				contentBGColor: '888888',
				a_color: 		'000000',
				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:  '10594',
internalId:  '',
customField: '20101214-211353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10573',
internalId:  '',
customField: '20101022-190002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10552',
internalId:  '',
customField: '20101214-211211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20101214-211031'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '10573',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-3199']={
webappId:    '7008',
documentId:  '10657',
internalId:  '3199',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10615',
internalId:  '',
customField: '20101214-211247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10678',
internalId:  '',
customField: '20101214-211317'
};
webappMappings['7060']=webappMappings['7060-e2e7577f52e72a3e2bd2ab0cc166cb65']={
webappId:    '7060',
documentId:  '32729',
internalId:  'e2e7577f52e72a3e2bd2ab0cc166cb65',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10720',
internalId:  '',
customField: '20101214-211504'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '10720',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10657',
internalId:  '',
customField: '20101214-211524'
};
webappMappings['1501']=webappMappings['1501-9515130']={
webappId:    '1501',
documentId:  '10501',
internalId:  '9515130',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '10657',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138911',
internalId:  '',
customField: '20101020-003807'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '10615',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '10552',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '10501',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '10594',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '10678',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32729',
internalId:  '',
customField: '20101214-211446'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '32729',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '138911',
internalId:  '',
customField: 'language:pl;country:PL;'
};
var canonHostname = 'wsc0.home.net.pl';
var accountId     = 'AHPL10INZ1O6';
var companyName   = 'Silesia+ART+++++++++++++++++++++++++++++++++++++++++++++++Reklama+Doskona%C5%82a';
var htmlTitle	  = 'Silesia+ART+-+Reklama+Doskona%C5%82a+++Agencja+Reklamowa%3B+Ekskluzywne+Upominki%3B+Grawerowanie+Laserowe';
var metaKeywords  = 'Agencja+Reklamowa+Silesia+ART%2C+projektowanie+graficzne%3A+logotypy%2C+identyfikacja+wizualna%2C+opakowania%2C+folder%2C+strony+www%2C+BTL%2C+ATL%2C+radio%2C+prasa%2C+billboard%2C+banner%2C+og%C5%82oszenie+reklamowe%2C+fotografia+reklamowa%2C+grawerowanie+laserowe%2C+pieczatki%2C+colop%2C+gadzety+reklamowe%2C+piecz%C4%85tki%2C+gad%C5%BCety+reklamowe%2C+upominki%2C+puchary%2C+trofea%2C+chorz%C3%B3w%2C+bytom%2C+katowice%2C+';
var metaContents  = 'Silesia+ART+-+Reklama+dla+Wybranych.++Ekskluzywne+Gad%C5%BCety%3B++Grawerowanie+Laserowe%3B+Piecz%C4%85tki%3B+Stemple%3B++Drukarnia%3B+';
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();
};

