/* [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','601',jdecode('Nasza+oferta'),jdecode(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','652',jdecode('Wynajem+sprz%C4%99tu'),jdecode(''), jdecode('%2F652%2Findex.html'), 'true',[ 
		['PAGE','673',jdecode('Oferta+-+wynajem'),jdecode(''), jdecode('%2F652%2F673.html'), 'true',[],'','']
	],'',''],
	['PAGE','694',jdecode('Rezerwacja+sprz%C4%99tu'),jdecode(''), jdecode('%2F694.html'), 'true',[],'',''],
	['PAGE','715',jdecode('Us%C5%82ugi+serwisowe'),jdecode(''), jdecode('%2F715%2Findex.html'), 'true',[ 
		['PAGE','757',jdecode('Oferta+-+serwis'),jdecode(''), jdecode('%2F715%2F757.html'), 'true',[],'','']
	],'',''],
	['PAGE','736',jdecode('Osoby+fizyczne'),jdecode(''), jdecode('%2F736.html'), 'false',[],'',''],
	['PAGE','778',jdecode('Baterie'),jdecode(''), jdecode('%2F778.html'), 'true',[],'',''],
	['PAGE','799',jdecode('Aukcje'),jdecode(''), jdecode('%2F799.html'), 'true',[],'',''],
	['PAGE','820',jdecode('Kontakt'),jdecode(''), jdecode('%2F820.html'), 'true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Display';
theSitetree.paletteFamily='19120C';
theSitetree.keyvisualId='11372';
theSitetree.keyvisualName='kv_11372.jpg';
theSitetree.fontsetId='32814';
theSitetree.graphicsetId='13800';
theSitetree.contentColor='1B1B1B';
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: 			'Display',
				paletteFamily: 	'19120C',
				keyvisualId: 	'11372',
				keyvisualName: 	'kv_11372.jpg',
				fontsetId: 		'32814',
				graphicsetId: 	'13800',
				contentColor: 	'1B1B1B',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20110224-231912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20100806-000946'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1060624']={
webappId:    '1501',
documentId:  '601',
internalId:  '1060624',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20100806-001636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '694',
internalId:  '',
customField: '20090928-002855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20090928-000516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20080215-225347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20090928-000713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '778',
internalId:  '',
customField: '20110224-231153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '799',
internalId:  '',
customField: '20090924-231549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '820',
internalId:  '',
customField: '20090924-135702'
};
webappMappings['7008']=webappMappings['7008-2807']={
webappId:    '7008',
documentId:  '694',
internalId:  '2807',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '601',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-2806']={
webappId:    '7008',
documentId:  '820',
internalId:  '2806',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '652',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '673',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '694',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '715',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '736',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '757',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '778',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '799',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '820',
internalId:  '',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-3394']={
webappId:    '7008',
documentId:  '778',
internalId:  '3394',
customField: 'language:pl;country:PL;'
};
var webAppHostname = 'cgi-kreatorstron.az.pl:80';
var canonHostname = 'cm4all.az.pl';
var accountId     = 'AAZ010IN2009';
var companyName   = 'Outsourcing+informatyczny';
var htmlTitle	  = 'Wypo%C5%BCyczalnia+sprz%C4%99tu+IT%2C+wynajem+laptop%C3%B3w%2C+wypo%C5%BCyczanie+komputer%C3%B3w.+Obs%C5%82uga+informatyczna+firm.+Sklep.';
var metaKeywords  = 'wynajem+komputer%C3%B3w%2C+wynajem+komputerow%2C+wynajem+notebook%C3%B3w%2C+wynajem+notebookow%2C+wypo%C5%BCyczanie+laptopa%2C+wynajem%2C+wynajem+projektor%C3%B3w%2C+wynajem+sprz%C4%99tu%2C+wynajem+IT%2C+wynajem+sprz%C4%99tu+IT%2C+serwis+sprz%C4%99tu%2C+serwis+komputerowy%2C+wypo%C5%BCyczenie%2C+wypo%C5%BCyczenie+komputera%2C+wypo%C5%BCyczenie+laptopa%2C+wypo%C5%BCyczenie+notebooka%2C+wypo%C5%BCyczenie+projektora%2C+wypo%C5%BCyczalnia%2C+wypo%C5%BCyczalnia+komputer%C3%B3w%2C+wypo%C5%BCyczalnia+laptop%C3%B3w%2C+wypo%C5%BCyczalnia+notebook%C3%B3w%2C+wypo%C5%BCyczalnia+projektor%C3%B3w%2C+IT%2C+notebooki%2C+laptopy%2C+projektory%2C+komputery%2C+modernizacja%2C+modernizacja+sprz%C4%99tu%2C+modernizacja+komputera';
var metaContents  = 'Oferta+wynajmu+sprz%C4%99tu+informatycznego%2C+serwisu+oraz+innych+us%C5%82ug+firmy+MAAD.+Wynajem+komputer%C3%B3w%2C+wypo%C5%BCyczalnia+laptop%C3%B3w%2C+stacji+roboczych%2C+serwer%C3%B3w%2C+paneli+LCD+i+innych.+Nowoczesny+sprz%C4%99t+i+najni%C5%BCsze+na+rynku+ceny.+Prowadzimy+wynajem+d%C5%82ugookresowy+i+kr%C3%B3tkoterminowy.+Dow%C3%B3z%2C+odbi%C3%B3r+i+instalacja+u+Klienta.';
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();
};

