/* [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','9412',jdecode('wej%C5%9Bcie'),jdecode(''),'/9412.html','true',[],'',''],
	['PAGE','9496',jdecode('pracownia+projektowa'),jdecode(''),'/9496.html','true',[],'',''],
	['PAGE','9612',jdecode('oferta+i+etapy+wsp%C3%B3%C5%82pracy'),jdecode(''),'/9612.html','true',[],'',''],
	['PAGE','285133',jdecode('wn%C4%99trza+mieszkalne'),jdecode(''),'/285133/index.html','true',[ 
		['PAGE','5312',jdecode('strefa+dzienna'),jdecode(''),'/285133/5312.html','true',[],'',''],
		['PAGE','171421',jdecode('sypialnie'),jdecode(''),'/285133/171421.html','true',[],'',''],
		['PAGE','141045',jdecode('pokoje+dla+dzieci'),jdecode(''),'/285133/141045.html','true',[],'',''],
		['PAGE','287633',jdecode('wn%C4%99trza+dla+nastolatek'),jdecode(''),'/285133/287633.html','true',[],'',''],
		['PAGE','25134',jdecode('projekty+%C5%82azienek'),jdecode(''),'/285133/25134.html','true',[],'',''],
		['PAGE','50234',jdecode('koncepty+%C5%82azienkowe'),jdecode(''),'/285133/50234.html','true',[],'',''],
		['PAGE','151356',jdecode('salon+k%C4%85pielowy+x2'),jdecode(''),'/285133/151356.html','true',[],'','']
	],'',''],
	['PAGE','27934',jdecode('wn.+komercyjne+i+inne'),jdecode(''),'/27934.html','true',[],'',''],
	['PAGE','150756',jdecode('publikacje'),jdecode(''),'/150756/index.html','true',[ 
		['PAGE','146345',jdecode('prezentacja+pracowni'),jdecode(''),'/150756/146345.html','true',[],'',''],
		['PAGE','123208',jdecode('wizualizacje+w+prasie'),jdecode(''),'/150756/123208.html','true',[],'',''],
		['PAGE','283333',jdecode('presti%C5%BCowe+trendy'),jdecode(''),'/150756/283333.html','true',[],'',''],
		['PAGE','145845',jdecode('diament+meblarstwa'),jdecode(''),'/150756/145845.html','true',[],'',''],
		['PAGE','27734',jdecode('design+na+miar%C4%99'),jdecode(''),'/150756/27734.html','true',[],'',''],
		['PAGE','123187',jdecode('media+w+%C5%82azience'),jdecode(''),'/150756/123187.html','true',[],'',''],
		['PAGE','175711',jdecode('ma%C5%82a+przemiana'),jdecode(''),'/150756/175711.html','true',[],'',''],
		['PAGE','123145',jdecode('okleiny+tekstylne'),jdecode(''),'/150756/123145.html','true',[],'',''],
		['PAGE','123166',jdecode('w+pokojach+dzieci'),jdecode(''),'/150756/123166.html','true',[],'','']
	],'',''],
	['PAGE','9475',jdecode('kontakt+i+lokalizacja'),jdecode(''),'/9475/index.html','true',[ 
		['PAGE','34934',jdecode('doje%C5%BCd%C5%BCamy'),jdecode(''),'/9475/34934.html','true',[],'','']
	],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='1003';
theSitetree.keyvisualName='color.jpg';
theSitetree.fontsetId='28616';
theSitetree.graphicsetId='197';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'NewYork',
				paletteFamily: 	'660000',
				keyvisualId: 	'1003',
				keyvisualName: 	'color.jpg',
				fontsetId: 		'28616',
				graphicsetId: 	'197',
				contentColor: 	'A00000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'660000',
				c_color: 		'000000',
				d_color: 		'990000',
				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:  '5312',
internalId:  '',
customField: '20100906-145102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9475',
internalId:  '',
customField: '20101219-010417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9412',
internalId:  '',
customField: '20100228-143910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27734',
internalId:  '',
customField: '20090827-002720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27934',
internalId:  '',
customField: '20100831-020210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9496',
internalId:  '',
customField: '20100308-221546'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9412',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9612',
internalId:  '',
customField: '20091127-223001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50234',
internalId:  '',
customField: '20101219-011508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25134',
internalId:  '',
customField: '20100511-164248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34934',
internalId:  '',
customField: '20091111-164738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123145',
internalId:  '',
customField: '20090922-122527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123166',
internalId:  '',
customField: '20100110-200926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123187',
internalId:  '',
customField: '20090922-122727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123208',
internalId:  '',
customField: '20100419-132437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141045',
internalId:  '',
customField: '20101103-005534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '145845',
internalId:  '',
customField: '20100318-001045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146345',
internalId:  '',
customField: '20100113-194513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '150756',
internalId:  '',
customField: '20100308-150127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151356',
internalId:  '',
customField: '20100201-222750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '287633',
internalId:  '',
customField: '20101213-194344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '171421',
internalId:  '',
customField: '20100311-010319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '175711',
internalId:  '',
customField: '20091006-234814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '283333',
internalId:  '',
customField: '20100307-024422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '285133',
internalId:  '',
customField: '20100924-112627'
};
var canonHostname = 'wsc2.home.net.pl';
var accountId     = 'AHPL10INZ89W';
var companyName   = 'projektowanie+i+wyposa%C5%BCanie+wn%C4%99trz';
var htmlTitle	  = 'ARTVIZ+-+Pracownia+Projektowa';
var metaKeywords  = 'artviz%2C+pracownia%2C+pracownia+projektowa%2C+jolkazur%2C+pracownia+projektowa+artviz%2C+artviz+jolanta+%C5%BCur%2C+jolanta+%C5%BCur%2C+wn%C4%99trza%2C+dobre+wn%C4%99trza%2C+projekty%2C+projekty+wn%C4%99trz%2C+projekty+wn%C4%99trz+%C5%9Awinouj%C5%9Bcie+Szczecin%2C+wizualizacje%2C+architekt%2C+architekt+wn%C4%99trz%2C+architektura%2C+architektura+wn%C4%99trz%2C+projektowanie+wn%C4%99trz%2C+design%2C+studio%2C+interior%2C+aran%C5%BCacja%2C+aran%C5%BCowanie%2C+wyposa%C5%BCanie+wn%C4%99trz%2C+Szczecin%2C+%C5%9Awinouj%C5%9Bcie%2C+Mi%C4%99dzyzdroje%2C+Wolin%2C+Kamie%C5%84+Pomorski%2C+Goleni%C3%B3w%2C+Trzebiat%C3%B3w%2C+Ko%C5%82obrzeg%2C+Nowogard%2C+Gorz%C3%B3w%2C+lubuskie%2C++pomorskie%2C+zachodniopomorskie%2C+morze%2C+nad+morzem%2C+dom%2C+domy%2C+mieszkanie%2C+mieszkania%2C+apartament%2C+apartamenty%2C+lofty%2C+lokale%2C+biura%2C+sklepy%2C+wystawy%2C+meble%2C+o%C5%9Bwietlenie%2C+kuchnie%2C+%C5%82azienki%2C+schody%2C+%C5%9Bciany%2C+sufity%2C+pod%C5%82ogi%2C+zabudowa%2C+zabudowy%2C+wyka%C5%84czanie%2C+remont%2C+modernizacja%2C+budowa%2C+developer%2C+deweloper%2C+design+na+miar%C4%99%2C';
var metaContents  = 'Pracownia+Projektowa+ARTVIZ+to+pracownia+autorska%2C+prowadzona+przez+dyplomowanego+architekta+wn%C4%99trz.+Pracownia+zajmuje+si%C4%99+projektowaniem+i+wyposa%C5%BCaniem+indywidualnych+i+developerskich+wn%C4%99trz+mieszkalnych%2C+a+tak%C5%BCe+wn%C4%99trz+biurowych%2C+hotelowych%2C+u%C5%BCyteczno%C5%9Bci+publicznej+i+innych.';
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();
};

