/* [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','401',jdecode('Strona+g%C5%82%C3%B3wna'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','17701',jdecode('Us%C5%82ugi'),jdecode(''),'/17701.html','true',[],'',''],
	['PAGE','13264',jdecode('Kontakt'),jdecode(''),'/13264.html','true',[],'',''],
	['PAGE','30201',jdecode('Galeria+zdj%C4%99%C4%87'),jdecode(''),'/30201.html','true',[],'',''],
	['PAGE','13243',jdecode('Dojazd'),jdecode(''),'/13243.html','true',[],'',''],
	['ITEM','35701',jdecode('Mapa'),jdecode(''),'http://mapy.google.pl/?ie=UTF8&amp;ll=51.035241,17.097301&amp;spn=0.051491,0.109863&amp;z=13&amp;output=embed"></iframe><br /><small><a href="http://<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://mapy.google.pl/?ie=UTF8&amp;ll=51.035241,17.097301&amp;spn=0.041128,0.117416&amp;z=13&amp;output=embed"></iframe><br /><small><a href="http://mapy.google.pl/?ie=UTF8&amp;ll=51.035241,17.097301&amp;spn=0.041128,0.117416&amp;z=13&amp;source=embed" style="color:#0000FF;text-align:left">Wyświetl większą mapę</a></small>','true',[],'','_blank']];
var siteelementCount=6;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='93A6CC';
theSitetree.keyvisualId='2224';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='26975';
theSitetree.graphicsetId='415';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='93A6CC';
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: 			'Enjoy',
				paletteFamily: 	'93A6CC',
				keyvisualId: 	'2224',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'26975',
				graphicsetId: 	'415',
				contentColor: 	'000000',
				contentBGColor: '93A6CC',
				a_color: 		'93A6CC',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				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:  '401',
internalId:  '',
customField: '20101228-132824'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20080402-213007'
};
webappMappings['7060']=webappMappings['7060-020545de88d8f8f2094040d985984376']={
webappId:    '7060',
documentId:  '30201',
internalId:  '020545de88d8f8f2094040d985984376',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13243',
internalId:  '',
customField: '20080403-214341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30201',
internalId:  '',
customField: '20080403-175606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13264',
internalId:  '',
customField: '20100521-111909'
};
var webAppHostname = 'cgi-kreatorstron.az.pl:80';
var canonHostname = 'cm4all.az.pl';
var accountId     = 'AAZ010IN251J';
var companyName   = '%22ARKUS%22s.c.+Anita+Chmiel+i+Wies%C5%82aw+Chmiel';
var htmlTitle	  = 'ARKUS+metaloplastyka';
var metaKeywords  = 'Wyposa%C5%BCenie%2CWyposa%C5%BCenia%2Cwyposa%C5%BCenia%2Cwn%C4%99trz%2Cwn%C4%99trza%2Cwn%C4%99trzy%2Caran%C5%BCacja%2Caran%C5%BCacji%2Caran%C5%BCowane%2Cbalustrady%2Cbalustrada%2Cbalustrad%2Cpor%C4%99cze%2Cpor%C4%99czy%2Cpor%C4%99cz%2Cbariera%2Cbarierki%2Cbarierek%2Cmetaloplastyka%2Cmetaloplastyki%2Cstal%2Cstalowy%2C+nierdzewna%2Cnierdzewka%2Cinox%2Cnierdzewna%2Ckwasoodporna%2Ckwas%C3%B3wka%2Ckwasiak%2Cmosi%C4%85dz%2Cmosi%C4%99zny%2Cmosi%C4%99%C5%BCne%2Caluminium%2Caluminiowe%2Csrebro%2Csrebrne%2Cmeble%2Cmeblowa%C4%87%2Cmeblowy%2Cmeblowanie%2C+metalowe%2Cmetale%2Cindywidualne%2C+nietypowe%2Cdba%C5%82o%C5%9B%C4%87+o+szczeg%C3%B3%C5%82y%2Cperfekcyjne%2Cperfekcja%2Cartystyczne%2Cjedyne%2Cunikatowe%2Cunikatowy%2Cniespotykane%2Cniespotykany%2Cniebanalne%2Cniebanalny%2C%C5%82adny%2C%C5%82adne%2Cpi%C4%99kny%2Cpi%C4%99kne%2Cpi%C4%99kno%2Cpi%C4%99knie%2Cspawanie%2Cspawalnictwo%2Ctig%2Cmig%2Cmag%2Cszlifowanie%2Cszlif%2Cszlifowane%2Csatyna%2Csatynowanie%2Csatynowane%2Cpoler%2Cpolerowane%2Cpolerowanie%2Cst%C3%B3%C5%82%2Csto%C5%82y%2Csto%C5%82%C3%B3w%2C';
var metaContents  = 'P.P.H.ARKUS+Wroc%C5%82aw++Firma+zajmuje+si%C4%99+metaloplastyk%C4%85%2C+ze+stali+nierdzewnej+i+mosi%C4%85dzu';
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();
};

