/* [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','5401',jdecode('Home'),jdecode(''), jdecode('%2F5401.html'), 'true',[],'',''],
	['PAGE','5515',jdecode('Sp%C3%A4tz%C3%BCnder'),jdecode(''), jdecode('%2F5515%2Findex.html'), 'true',[ 
		['PAGE','43911',jdecode('Neumitglieder'),jdecode(''), jdecode('%2F5515%2F43911.html'), 'true',[],'',''],
		['PAGE','95522',jdecode('Ehemalige'),jdecode(''), jdecode('%2F5515%2F95522.html'), 'true',[],'','']
	],'',''],
	['PAGE','15711',jdecode('Sp%C3%A4tfritig'),jdecode(''), jdecode('%2F15711.html'), 'true',[],'',''],
	['PAGE','5557',jdecode('Nachtumzug'),jdecode(''), jdecode('%2F5557%2Findex.html'), 'true',[ 
		['PAGE','48122',jdecode('Anmeldung+Nachtumzug'),jdecode(''), jdecode('%2F5557%2F48122.html'), 'false',[],'','']
	],'',''],
	['PAGE','62222',jdecode('Fasnachtswagen'),jdecode(''), jdecode('%2F62222.html'), 'true',[],'',''],
	['PAGE','45322',jdecode('H%C3%A4n%C3%A4t%C3%A4p%C3%A4l%C3%A4'),jdecode(''), jdecode('%2F45322.html'), 'true',[],'',''],
	['PAGE','5452',jdecode('11.11.'),jdecode(''), jdecode('%2F5452.html'), 'true',[],'',''],
	['PAGE','21211',jdecode('Fasnachtstermine'),jdecode(''), jdecode('%2F21211.html'), 'true',[],'',''],
	['PAGE','21232',jdecode('Gallery'),jdecode(''), jdecode('%2F21232%2Findex.html'), 'true',[ 
		['PAGE','68422',jdecode('H%C3%A4n%C3%A4t%C3%A4p%C3%A4l%C3%A4+2011'),jdecode(''), jdecode('%2F21232%2F68422.html'), 'true',[],'',''],
		['PAGE','77922',jdecode('11.11.2011'),jdecode(''), jdecode('%2F21232%2F77922.html'), 'true',[],'','']
	],'',''],
	['PAGE','26211',jdecode('Links'),jdecode(''), jdecode('%2F26211.html'), 'true',[],'',''],
	['PAGE','27811',jdecode('Kontakt'),jdecode(''), jdecode('%2F27811.html'), 'true',[],'',''],
	['PAGE','26232',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F26232.html'), 'true',[],'',''],
	['PAGE','44222',jdecode('Wir+vermieten...'),jdecode(''), jdecode('%2F44222.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='BB5B23';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10381';
theSitetree.graphicsetId='10564';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21Y'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Circulation',
				paletteFamily: 	'BB5B23',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10381',
				graphicsetId: 	'10564',
				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:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20120116-085128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5452',
internalId:  '',
customField: '20120206-102405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15711',
internalId:  '',
customField: '20120206-135341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21211',
internalId:  '',
customField: '20120206-102645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5515',
internalId:  '',
customField: '20120116-090541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21232',
internalId:  '',
customField: '20110815-170550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5557',
internalId:  '',
customField: '20120207-130119'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-26232ahp340inv572']={
webappId:    '1002',
documentId:  '26232',
internalId:  '26232ahp340inv572',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26211',
internalId:  '',
customField: '20111007-101926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26232',
internalId:  '',
customField: '20091018-171532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43911',
internalId:  '',
customField: '20100811-202916'
};
webappMappings['1501']=webappMappings['1501-22175448']={
webappId:    '1501',
documentId:  '5401',
internalId:  '22175448',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27811',
internalId:  '',
customField: '20091018-171521'
};
webappMappings['7008']=webappMappings['7008-1466']={
webappId:    '7008',
documentId:  '27811',
internalId:  '1466',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44222',
internalId:  '',
customField: '20120116-091753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45322',
internalId:  '',
customField: '20110815-171159'
};
webappMappings['7008']=webappMappings['7008-3627']={
webappId:    '7008',
documentId:  '48122',
internalId:  '3627',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48122',
internalId:  '',
customField: '20111115-133402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62222',
internalId:  '',
customField: '20120206-135454'
};
webappMappings['7060']=webappMappings['7060-29d8b30ea6b2c1f05ef951b4610a0da4']={
webappId:    '7060',
documentId:  '68422',
internalId:  '29d8b30ea6b2c1f05ef951b4610a0da4',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68422',
internalId:  '',
customField: '20120111-093406'
};
webappMappings['7060']=webappMappings['7060-983ff2922bf4c8ea591f1d71eecdbb9d']={
webappId:    '7060',
documentId:  '77922',
internalId:  '983ff2922bf4c8ea591f1d71eecdbb9d',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77922',
internalId:  '',
customField: '20120111-152035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95522',
internalId:  '',
customField: '20120116-090414'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHP340INV572';
var companyName   = 'Sp%C3%A4tz%C3%BCnderclique+Ennenda';
var htmlTitle	  = 'Sp%C3%A4tz%C3%BCnderclique+Ennenda';
var metaKeywords  = 'Sp%C3%A4tz%C3%BCnderclique+Spaetzuender+Fasnacht+Ennenda';
var metaContents  = 'Sp%C3%A4tz%C3%BCnderclique+Spaetzuender+Fasnacht+Ennenda';
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();
};

