/* [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 theSitetree=[ 
	['PAGE','501',jdecode('Home'),jdecode(''),'/501.html','true',[],''],
	['PAGE','10701',jdecode('Wodoci%C4%85gi+i+gazoci%C4%85gi'),jdecode(''),'/10701.html','true',[],''],
	['PAGE','10722',jdecode('Ruroci%C4%85gi+przemys%C5%82owe'),jdecode(''),'/10722.html','true',[],''],
	['PAGE','10743',jdecode('Maszyny+do+zgrzewania'),jdecode(''),'/10743.html','true',[],''],
	['PAGE','10764',jdecode('Wypo%C5%BCyczalnia+maszyn'),jdecode(''),'/10764.html','true',[],''],
	['PAGE','34101',jdecode('Maszyny+u%C5%BCywane'),jdecode(''),'/34101.html','true',[],''],
	['PAGE','15001',jdecode('Kontakt'),jdecode(''),'/15001.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='F5F5F5';
theSitetree.keyvisualId='2152';
theSitetree.keyvisualName='architektur.jpg';
theSitetree.fontsetId='26958';
theSitetree.graphicsetId='407';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F5F5F5';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				name: 			'Medium',
				paletteFamily: 	'F5F5F5',
				keyvisualId: 	'2152',
				keyvisualName: 	'architektur.jpg',
				fontsetId: 		'26958',
				graphicsetId: 	'407',
				contentColor: 	'000000',
				contentBGColor: 'F5F5F5',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'F5F5F5',
				b_color: 		'8EBFC6',
				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:  '501',
internalId:  '',
customField: '20090205-092407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20090226-144837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10743',
internalId:  '',
customField: '20090205-092618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20090205-092717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10722',
internalId:  '',
customField: '20090205-092527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10764',
internalId:  '',
customField: '20090525-153414'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34101',
internalId:  '',
customField: '20090622-170846'
};
var canonHostname = 'cm4all.az.pl';
var accountId     = 'AAZ010IN2ZYS';
var companyName   = 'Nowoczesne+systemy+ruroci%C4%85g%C3%B3w+z+tworzyw+sztucznych';
var htmlTitle	  = 'ATAA+PROJECT+-+Systemy+ruroci%C4%85g%C3%B3w+z+tworzyw+sztucznych';
var metaKeywords  = 'ATAA+Project%2C+Georg+Fischer%2C++%2BGF%2B%2C++GF%2C+Systemy+ruroci%C4%85g%C3%B3w+z+tworzyw+sztucznych%2C+Ruroci%C4%85gi+przemys%C5%82owe%2C+Instalacje+przemys%C5%82owe%2C+Galwanizernie%2C+Linie+galwaniczne%2C+Instalacje+dla+zak%C5%82ad%C3%B3w+chemicznych%2C+Media+Agresywne%2C+%C5%81ugi%2C+Kwasy%2C+SUW%2C+Stacje+uzdatniania+Wody%2C+Wodoci%C4%85gi%2C+Gazoci%C4%85gi%2C+Kszta%C5%82tki+PE%2C++Zgrzewarki+doczo%C5%82owe%2C+Zgrzewanie+doczo%C5%82owe%2C+Zgrzewarki+elektrooporowe%2C+Zgrzewanie+elektrooporowe%2C++Serwis+maszyn+GF%2C+Naprawa+maszyn%2C+MSA%2C+KL%2C+TM%2C+WR100%2C+Maszyny+u%C5%BCywane%2C+Wypo%C5%BCyczalnia+maszyn+elektrooporowych%2C+wypo%C5%BCyczalnia+maszyn+doczo%C5%82owych%2C+Magazyn+kszta%C5%82tek+PE%2C+Przy%C5%82%C4%85cze+gazowe%2C++Przy%C5%82%C4%85cze+wodoci%C4%85gowe%2C+Obejmy%2C+Obejmy+do+nawiercania%2C+Odej%C5%9Bcia+siod%C5%82owe%2C+Sieci+gazowe%2C++Sieci+wodoci%C4%85gowe%2C++Instalacje+przemys%C5%82owe%2C+Kszta%C5%82tki+elektrooporowe%2C+Kszta%C5%82tki+doczo%C5%82owe%2C+PE%2C+PP-H%2C+PVC-U%2C+PVC-C%2C+ABS%2C+PVDF%2C+Rury%2C+Zawory+kulowe%2C+Zawory+klapowe%2C+Przepustnice%2C+Zawory+membranowe%2C+Zawory+zwrotne%2C+Zawory+regulacyjne%2C+Zawory+odpowietrzaj%C4%85ce%2C+Zawory+napowietrzaj%C4%85ce%2C+Zawory+tr%C3%B3jdrogowe%2C+Si%C5%82ownik+pneumatyczny%2C+Si%C5%82ownik+elektryczny%2C+Zawory+automatyczne%2C+Rotametry.';
var metaContents  = 'ATAA+Project%2C+Georg+Fischer%2C++%2BGF%2B%2C++GF%2C+Systemy+ruroci%C4%85g%C3%B3w+z+tworzyw+sztucznych%2C+Ruroci%C4%85gi+przemys%C5%82owe%2C+Instalacje+przemys%C5%82owe%2C+Galwanizernie%2C+Linie+galwaniczne%2C+Instalacje+dla+zak%C5%82ad%C3%B3w+chemicznych%2C+Media+Agresywne%2C+%C5%81ugi%2C+Kwasy%2C+SUW%2C+Stacje+uzdatniania+Wody%2C+Wodoci%C4%85gi%2C+Gazoci%C4%85gi%2C+Kszta%C5%82tki+PE%2C++Zgrzewarki+doczo%C5%82owe%2C+Zgrzewanie+doczo%C5%82owe%2C+Zgrzewarki+elektrooporowe%2C+Zgrzewanie+elektrooporowe%2C++Serwis+maszyn+GF%2C+Naprawa+maszyn%2C+MSA%2C+KL%2C+TM%2C+WR100%2C+Maszyny+u%C5%BCywane%2C+Wypo%C5%BCyczalnia+maszyn+elektrooporowych%2C+wypo%C5%BCyczalnia+maszyn+doczo%C5%82owych%2C+Magazyn+kszta%C5%82tek+PE%2C+Przy%C5%82%C4%85cze+gazowe%2C++Przy%C5%82%C4%85cze+wodoci%C4%85gowe%2C+Obejmy%2C+Obejmy+do+nawiercania%2C+Odej%C5%9Bcia+siod%C5%82owe%2C+Sieci+gazowe%2C++Sieci+wodoci%C4%85gowe%2C++Instalacje+przemys%C5%82owe%2C+Kszta%C5%82tki+elektrooporowe%2C+Kszta%C5%82tki+doczo%C5%82owe%2C+PE%2C+PP-H%2C+PVC-U%2C+PVC-C%2C+ABS%2C+PVDF%2C+Rury%2C+Zawory+kulowe%2C+Zawory+klapowe%2C+Przepustnice%2C+Zawory+membranowe%2C+Zawory+zwrotne%2C+Zawory+regulacyjne%2C+Zawory+odpowietrzaj%C4%85ce%2C+Zawory+napowietrzaj%C4%85ce%2C+Zawory+tr%C3%B3jdrogowe%2C+Si%C5%82ownik+pneumatyczny%2C+Si%C5%82ownik+elektryczny%2C+Zawory+automatyczne%2C+Rotametry.';
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();
};
