/* [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','5001',jdecode('Home'),jdecode(''), jdecode('%2F5001.html'), 'true',[],'',''],
	['PAGE','5052',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F5052%2Findex.html'), 'true',[ 
		['PAGE','5073',jdecode('Geschichte'),jdecode(''), jdecode('%2F5052%2F5073.html'), 'true',[],'',''],
		['PAGE','5094',jdecode('Unser+Team'),jdecode(''), jdecode('%2F5052%2F5094.html'), 'true',[],'','']
	],'',''],
	['PAGE','5220',jdecode('KF+Sanierung'),jdecode(''), jdecode('%2F5220%2Findex.html'), 'true',[ 
		['PAGE','5241',jdecode('Gesetz'),jdecode(''), jdecode('%2F5220%2F5241.html'), 'true',[],'',''],
		['PAGE','5262',jdecode('Unsere+Leistungen'),jdecode(''), jdecode('%2F5220%2F5262.html'), 'true',[],'',''],
		['PAGE','5283',jdecode('Bilder'),jdecode(''), jdecode('%2F5220%2F5283.html'), 'true',[],'',''],
		['PAGE','14501',jdecode('Bilder+Anlagen'),jdecode(''), jdecode('%2F5220%2F14501.html'), 'true',[],'',''],
		['PAGE','5304',jdecode('Referenzen'),jdecode(''), jdecode('%2F5220%2F5304.html'), 'true',[],'','']
	],'',''],
	['PAGE','5115',jdecode('Kugelfangkasten'),jdecode(''), jdecode('%2F5115%2Findex.html'), 'true',[ 
		['PAGE','10401',jdecode('Vorschriften'),jdecode(''), jdecode('%2F5115%2F10401.html'), 'true',[],'',''],
		['PAGE','5157',jdecode('Masse+und+Leistung'),jdecode(''), jdecode('%2F5115%2F5157.html'), 'true',[],'',''],
		['PAGE','5178',jdecode('Bilder'),jdecode(''), jdecode('%2F5115%2F5178.html'), 'true',[],'',''],
		['PAGE','5199',jdecode('Referenzen'),jdecode(''), jdecode('%2F5115%2F5199.html'), 'true',[],'','']
	],'',''],
	['PAGE','5325',jdecode('Hybag-Berin+Cup'),jdecode(''), jdecode('%2F5325%2Findex.html'), 'true',[ 
		['PAGE','12901',jdecode('Adressen'),jdecode(''), jdecode('%2F5325%2F12901.html'), 'true',[],'',''],
		['PAGE','5346',jdecode('Reglement'),jdecode(''), jdecode('%2F5325%2F5346.html'), 'true',[],'',''],
		['PAGE','5367',jdecode('Anmeldung'),jdecode(''), jdecode('%2F5325%2F5367.html'), 'true',[],'',''],
		['PAGE','5388',jdecode('Qualifikation'),jdecode(''), jdecode('%2F5325%2F5388.html'), 'true',[],'',''],
		['PAGE','5409',jdecode('Resultate+Final'),jdecode(''), jdecode('%2F5325%2F5409.html'), 'true',[],'',''],
		['PAGE','5430',jdecode('Bilder+Final+2009'),jdecode(''), jdecode('%2F5325%2F5430.html'), 'true',[],'',''],
		['PAGE','22501',jdecode('Bilder+Final+2010'),jdecode(''), jdecode('%2F5325%2F22501.html'), 'true',[],'',''],
		['PAGE','37801',jdecode('Bilder+Final+2011'),jdecode(''), jdecode('%2F5325%2F37801.html'), 'true',[],'','']
	],'',''],
	['PAGE','5451',jdecode('Jobs'),jdecode(''), jdecode('%2F5451.html'), 'true',[],'',''],
	['PAGE','5472',jdecode('Kontakt'),jdecode(''), jdecode('%2F5472.html'), 'true',[],'',''],
	['PAGE','20601',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F20601.html'), 'true',[],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='1243CC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10587';
theSitetree.graphicsetId='10562';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Circulation',
				paletteFamily: 	'1243CC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10587',
				graphicsetId: 	'10562',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20100317-091605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20100317-091703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5073',
internalId:  '',
customField: '20091012-083048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5094',
internalId:  '',
customField: '20090924-181434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5451',
internalId:  '',
customField: '20090920-111548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5472',
internalId:  '',
customField: '20090924-182830'
};
webappMappings['1501']=webappMappings['1501-30090092']={
webappId:    '1501',
documentId:  '5001',
internalId:  '30090092',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5115',
internalId:  '',
customField: '20100816-194022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5220',
internalId:  '',
customField: '20100816-193750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5241',
internalId:  '',
customField: '20100816-193827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5157',
internalId:  '',
customField: '20100816-194057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5325',
internalId:  '',
customField: '20090926-184629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20090904-171712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5178',
internalId:  '',
customField: '20100317-093035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5346',
internalId:  '',
customField: '20110304-122825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5367',
internalId:  '',
customField: '20110304-122443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5388',
internalId:  '',
customField: '20110924-101730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5409',
internalId:  '',
customField: '20111013-124406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5430',
internalId:  '',
customField: '20090926-190626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5262',
internalId:  '',
customField: '20100816-193915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5283',
internalId:  '',
customField: '20090920-150758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5304',
internalId:  '',
customField: '20100816-193952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5199',
internalId:  '',
customField: '20100816-194123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20091110-180249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14501',
internalId:  '',
customField: '20091112-223433'
};
webappMappings['1002']=webappMappings['1002-20601abw330ineyc6']={
webappId:    '1002',
documentId:  '20601',
internalId:  '20601abw330ineyc6',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20090924-113723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22501',
internalId:  '',
customField: '20101009-163103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37801',
internalId:  '',
customField: '20111020-105506'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW330INEYC6';
var companyName   = 'Berin+GmbH';
var htmlTitle	  = 'berin-gmbh.ch';
var metaKeywords  = 'Berin-GmbHKugelfangsanierungKugelfangkasten';
var metaContents  = 'Kugelfangsanierungen+und+Kugelfangkasten';
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();
};

