/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','119401',jdecode('OFERTA+NOWE'),jdecode(''),'/119401/index.html','true',[ 
		['PAGE','173301',jdecode('CZARNO-BIA%C5%81E'),jdecode(''),'/119401/173301.html','true',[],'',''],
		['PAGE','178101',jdecode('KOLOR'),jdecode(''),'/119401/178101.html','true',[],'',''],
		['PAGE','174401',jdecode('Drukarki+'),jdecode(''),'/119401/174401.html','true',[],'',''],
		['PAGE','174422',jdecode('Skanery'),jdecode(''),'/119401/174422.html','true',[],'',''],
		['PAGE','174443',jdecode('Duplikatory'),jdecode(''),'/119401/174443.html','true',[],'',''],
		['PAGE','174464',jdecode('Faksy'),jdecode(''),'/119401/174464.html','true',[],'',''],
		['PAGE','174485',jdecode('Wielkoformatowe'),jdecode(''),'/119401/174485.html','true',[],'',''],
		['PAGE','126201',jdecode('niszczarki'),jdecode(''),'/119401/126201.html','true',[],'',''],
		['PAGE','174506',jdecode('ROZWI%C4%84ZANIA'),jdecode(''),'/119401/174506.html','true',[],'','']
	],'',''],
	['PAGE','119422',jdecode('OFERTA+POLEASINGOWE'),jdecode(''),'/119422.html','true',[],'',''],
	['PAGE','213212',jdecode('Archiwizacja+ELO'),jdecode(''),'/213212/index.html','true',[ 
		['PAGE','224923',jdecode('Kim+jest+producent'),jdecode(''),'/213212/224923.html','true',[],'',''],
		['PAGE','226259',jdecode('ELOoffice+'),jdecode(''),'/213212/226259.html','true',[],'',''],
		['PAGE','226280',jdecode('ELOprofessional'),jdecode(''),'/213212/226280.html','true',[],'',''],
		['PAGE','226301',jdecode('ELOenterprice'),jdecode(''),'/213212/226301.html','true',[],'',''],
		['PAGE','226322',jdecode('Wersja+DEMO'),jdecode(''),'/213212/226322.html','true',[],'','']
	],'',''],
	['PAGE','133101',jdecode('Zam%C3%B3w+ofert%C4%99'),jdecode(''),'/133101.html','true',[],'',''],
	['PAGE','773',jdecode('SERWIS'),jdecode(''),'/773.html','true',[],'',''],
	['PAGE','857',jdecode('KONTAKT'),jdecode(''),'/857.html','true',[],'',''],
	['PAGE','149101',jdecode('Leasing'),jdecode(''),'/149101.html','true',[],'',''],
	['PAGE','131201',jdecode('Oferty+pracy'),jdecode(''),'/131201.html','true',[],'',''],
	['PAGE','195001',jdecode('sterowniki'),jdecode(''),'/195001.html','true',[],'',''],
	['PAGE','235651',jdecode('Tonery+-+sklep+internetowy'),jdecode(''),'/235651.html','false',[],'',''],
	['PAGE','238351',jdecode('O+firmie'),jdecode(''),'/238351.html','true',[],'',''],
	['PAGE','240751',jdecode('SKLEP+INTERNETOWY'),jdecode(''),'/240751.html','true',[],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='978';
theSitetree.keyvisualName='adresskartei.jpg';
theSitetree.fontsetId='28616';
theSitetree.graphicsetId='197';
theSitetree.contentColor='006633';
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: 	'978',
				keyvisualName: 	'adresskartei.jpg',
				fontsetId: 		'28616',
				graphicsetId: 	'197',
				contentColor: 	'006633',
				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['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '701',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '240751',
internalId:  '',
customField: '20091101-170934'
};
webappMappings['7008']=webappMappings['7008-870']={
webappId:    '7008',
documentId:  '119401',
internalId:  '870',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-871']={
webappId:    '7008',
documentId:  '133101',
internalId:  '871',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-872']={
webappId:    '7008',
documentId:  '773',
internalId:  '872',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20091101-124515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119401',
internalId:  '',
customField: '20090220-152252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173301',
internalId:  '',
customField: '20090127-175136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '178101',
internalId:  '',
customField: '20090127-175223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174401',
internalId:  '',
customField: '20070318-141439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174422',
internalId:  '',
customField: '20090127-175517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174443',
internalId:  '',
customField: '20090127-175437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174464',
internalId:  '',
customField: '20090127-175550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174485',
internalId:  '',
customField: '20090127-175619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126201',
internalId:  '',
customField: '20090127-175652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174506',
internalId:  '',
customField: '20090127-175725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119422',
internalId:  '',
customField: '20091101-124714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133101',
internalId:  '',
customField: '20090302-103153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20090127-175927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20090127-175954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149101',
internalId:  '',
customField: '20090127-180016'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131201',
internalId:  '',
customField: '20090120-110653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '235651',
internalId:  '',
customField: '20090316-094054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195001',
internalId:  '',
customField: '20090127-180129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '238351',
internalId:  '',
customField: '20091101-130534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '213212',
internalId:  '',
customField: '20090127-175830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '224923',
internalId:  '',
customField: '20090205-092534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '226259',
internalId:  '',
customField: '20090205-102540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '226280',
internalId:  '',
customField: '20090205-102819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '226301',
internalId:  '',
customField: '20090205-102903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '226322',
internalId:  '',
customField: '20090205-104236'
};
webappMappings['7008']=webappMappings['7008-2308']={
webappId:    '7008',
documentId:  '226322',
internalId:  '2308',
customField: 'language:pl;country:PL;'
};
var canonHostname = 'wsc2.home.net.pl';
var accountId     = 'AHPL10IN20SK';
var companyName   = 'Systemy+Biurowe+Integracja';
var htmlTitle	  = 'AUTORYZOWANY+DEALER+NASHUATEC+kserokopiarki+szczecin';
var metaKeywords  = 'kserokopiarki+szczecin+%2C+drukarki+szczecin++%2C+nashuatec+%2C+ricoh+%2C+gestetner+%2C+lanier+%2C+toshiba+%2C+urz%C4%85dzenia+wielofunkcyjne+%2C+drukarki+wielofunkcyjne+%2C+kopiarki+%2C+serwis+';
var metaContents  = 'Autoryzowany+dealer+nashuatec%2C+serwis+sprzeda%C5%BC%2C+kserokopiarki+Szczecin%2C+drukarki+wielofunkcyjne%2C+sieciowe';
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();
};

