/* [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','6201',jdecode('en'),jdecode(''),'/6201/index.html','true',[ 
		['PAGE','7701',jdecode('company+profile'),jdecode(''),'/6201/7701.html','true',[],''],
		['PAGE','11912',jdecode('custom+solutions'),jdecode(''),'/6201/11912.html','true',[],''],
		['PAGE','11954',jdecode('confidentiality'),jdecode(''),'/6201/11954.html','true',[],''],
		['PAGE','11933',jdecode('environment'),jdecode(''),'/6201/11933.html','true',[],''],
		['PAGE','7722',jdecode('quality'),jdecode(''),'/6201/7722.html','true',[],''],
		['PAGE','12412',jdecode('culture'),jdecode(''),'/6201/12412.html','true',[],''],
		['PAGE','7743',jdecode('our+group'),jdecode(''),'/6201/7743.html','true',[],''],
		['PAGE','7764',jdecode('contact'),jdecode(''),'/6201/7764.html','true',[],'']
	],''],
	['PAGE','6922',jdecode('de'),jdecode(''),'/6922/index.html','true',[ 
		['PAGE','27312',jdecode('firmenprofil'),jdecode(''),'/6922/27312.html','true',[],''],
		['PAGE','27333',jdecode('l%C3%B6sungen'),jdecode(''),'/6922/27333.html','true',[],''],
		['PAGE','27354',jdecode('geheimhaltung'),jdecode(''),'/6922/27354.html','true',[],''],
		['PAGE','27375',jdecode('umwelt'),jdecode(''),'/6922/27375.html','true',[],''],
		['PAGE','27396',jdecode('qualit%C3%A4t'),jdecode(''),'/6922/27396.html','true',[],''],
		['PAGE','27417',jdecode('kultur'),jdecode(''),'/6922/27417.html','true',[],''],
		['PAGE','27438',jdecode('gruppe'),jdecode(''),'/6922/27438.html','true',[],''],
		['PAGE','27459',jdecode('kontakt'),jdecode(''),'/6922/27459.html','true',[],'']
	],''],
	['PAGE','9812',jdecode('pl'),jdecode(''),'/9812/index.html','true',[ 
		['PAGE','27480',jdecode('profil+firmy'),jdecode(''),'/9812/27480.html','true',[],''],
		['PAGE','27501',jdecode('rozwi%C4%85zania'),jdecode(''),'/9812/27501.html','true',[],''],
		['PAGE','27522',jdecode('poufno%C5%9B%C4%87'),jdecode(''),'/9812/27522.html','true',[],''],
		['PAGE','27543',jdecode('%C5%9Brodowisko'),jdecode(''),'/9812/27543.html','true',[],''],
		['PAGE','27564',jdecode('jako%C5%9B%C4%87'),jdecode(''),'/9812/27564.html','true',[],''],
		['PAGE','27585',jdecode('kultura'),jdecode(''),'/9812/27585.html','true',[],''],
		['PAGE','27606',jdecode('nasza+grupa'),jdecode(''),'/9812/27606.html','true',[],''],
		['PAGE','27627',jdecode('kontakt'),jdecode(''),'/9812/27627.html','true',[],'']
	],'']];
var siteelementCount=27;
theSitetree.topTemplateName='Esoteric';
theSitetree.paletteFamily='2A5997';
theSitetree.keyvisualId='5864';
theSitetree.keyvisualName='kv_5864.jpg';
theSitetree.fontsetId='27824';
theSitetree.graphicsetId='11881';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='C4D4E9';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				name: 			'Esoteric',
				paletteFamily: 	'2A5997',
				keyvisualId: 	'5864',
				keyvisualName: 	'kv_5864.jpg',
				fontsetId: 		'27824',
				graphicsetId: 	'11881',
				contentColor: 	'000000',
				contentBGColor: 'C4D4E9',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'DBDBDB',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20090601-111857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11954',
internalId:  '',
customField: '20090601-111947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7764',
internalId:  '',
customField: '20090601-112146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27396',
internalId:  '',
customField: '20090601-112307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20090601-111934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6922',
internalId:  '',
customField: '20090601-112158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7743',
internalId:  '',
customField: '20090601-112133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7722',
internalId:  '',
customField: '20090601-112050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27333',
internalId:  '',
customField: '20090601-112228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27354',
internalId:  '',
customField: '20090601-112241'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9812',
internalId:  '',
customField: '20090601-112501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12412',
internalId:  '',
customField: '20090601-112116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27312',
internalId:  '',
customField: '20090601-112216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11933',
internalId:  '',
customField: '20090601-112028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27375',
internalId:  '',
customField: '20090601-112256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11912',
internalId:  '',
customField: '20090601-111920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27417',
internalId:  '',
customField: '20090601-112405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27438',
internalId:  '',
customField: '20090601-112430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27459',
internalId:  '',
customField: '20090601-112439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27480',
internalId:  '',
customField: '20090417-081157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20090417-081157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27522',
internalId:  '',
customField: '20090417-081157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27543',
internalId:  '',
customField: '20090417-081157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27564',
internalId:  '',
customField: '20090417-081157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27585',
internalId:  '',
customField: '20090417-081157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27606',
internalId:  '',
customField: '20090417-081157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27627',
internalId:  '',
customField: '20090417-081157'
};
var canonHostname = 'wsc2.home.net.pl';
var accountId     = 'AHPL10INZQZA';
var companyName   = '';
var htmlTitle	  = 'SFB+POLSKA+Sp.+z+o.o.+Assembly+Services+Outsourcing%3B+Montagedienstleistungen';
var metaKeywords  = 'assembly%2C+quality%2C+outsourcing%2C+automotive%2C+aftermarket%2C+procurement%2C+storage+ISO%2C+FMEA%2C+SPC+%2CMSA';
var metaContents  = 'Assembly+outsourcing+and+quality+assurance+services+for+automotive+and+other+industries.+';
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();
};

