/* [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','4517',jdecode('Home'),jdecode(''), jdecode('%2F4517.html'), 'true',[],'',''],
	['PAGE','22428',jdecode('Vorstand'),jdecode(''), jdecode('%2F22428.html'), 'true',[],'',''],
	['PAGE','22455',jdecode('Ch%C3%B6re+GLKGV'),jdecode(''), jdecode('%2F22455.html'), 'true',[],'',''],
	['PAGE','22401',jdecode('Statuten'),jdecode(''), jdecode('%2F22401.html'), 'true',[],'',''],
	['PAGE','8965',jdecode('Geschichte'),jdecode(''), jdecode('%2F8965.html'), 'true',[],'',''],
	['PAGE','22482',jdecode('Aktuelles'),jdecode(''), jdecode('%2F22482.html'), 'true',[],'',''],
	['PAGE','22509',jdecode('Veranstaltungen'),jdecode(''), jdecode('%2F22509.html'), 'true',[],'',''],
	['PAGE','22536',jdecode('Kurse'),jdecode(''), jdecode('%2F22536.html'), 'true',[],'',''],
	['PAGE','38301',jdecode('N%C3%A4felser+Fahrt+2011'),jdecode(''), jdecode('%2F38301.html'), 'true',[],'',''],
	['PAGE','54701',jdecode('N%C3%A4felser+Fahrt+2012'),jdecode(''), jdecode('%2F54701.html'), 'true',[],'',''],
	['PAGE','29884',jdecode('Fotogalerie'),jdecode(''), jdecode('%2F29884.html'), 'true',[],'',''],
	['PAGE','53401',jdecode('Ehrenmitglieder'),jdecode(''), jdecode('%2F53401.html'), 'true',[],'',''],
	['PAGE','22563',jdecode('Kontakt+Webmaster'),jdecode(''), jdecode('%2F22563.html'), 'true',[],'',''],
	['PAGE','57301',jdecode('Kontakt+Pr%C3%A4sident'),jdecode(''), jdecode('%2F57301.html'), 'true',[],'',''],
	['PAGE','22590',jdecode('Stellenb%C3%B6rse'),jdecode(''), jdecode('%2F22590.html'), 'true',[],'',''],
	['PAGE','22617',jdecode('Links'),jdecode(''), jdecode('%2F22617%2Findex.html'), 'true',[ 
		['PAGE','27401',jdecode('Zu+Glarnerch%C3%B6ren'),jdecode(''), jdecode('%2F22617%2F27401.html'), 'true',[],'',''],
		['PAGE','27428',jdecode('Andere+Ch%C3%B6re'),jdecode(''), jdecode('%2F22617%2F27428.html'), 'true',[],'','']
	],'',''],
	['PAGE','22902',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F22902%2Findex.html'), 'true',[ 
		['PAGE','22903',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F22902%2F22903.html'), 'false',[],'','']
	],'',''],
	['PAGE','42801',jdecode(''),jdecode(''), jdecode('%2F42801.html'), 'true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Match';
theSitetree.paletteFamily='FF3333';
theSitetree.keyvisualId='2698';
theSitetree.keyvisualName='kv_2698.jpg';
theSitetree.fontsetId='10701';
theSitetree.graphicsetId='10635';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CCCCCC';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21F'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Match',
				paletteFamily: 	'FF3333',
				keyvisualId: 	'2698',
				keyvisualName: 	'kv_2698.jpg',
				fontsetId: 		'10701',
				graphicsetId: 	'10635',
				contentColor: 	'000000',
				contentBGColor: 'CCCCCC',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FF3333',
				e_color: 		'545353',
				f_color: 		'545353',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-2897503']={
webappId:    '1501',
documentId:  '4517',
internalId:  '2897503',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-22902ahp010ine9ud']={
webappId:    '1002',
documentId:  '22902',
internalId:  '22902ahp010ine9ud',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4517',
internalId:  '',
customField: '20051205-174921'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4517',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-015407afe43adf6b898085dbc7385174']={
webappId:    '7060',
documentId:  '29884',
internalId:  '015407afe43adf6b898085dbc7385174',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22428',
internalId:  '',
customField: '20111122-140640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22455',
internalId:  '',
customField: '20120118-175059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22401',
internalId:  '',
customField: '20110815-151505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8965',
internalId:  '',
customField: '20120126-085141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22482',
internalId:  '',
customField: '20111218-072326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22509',
internalId:  '',
customField: '20120126-094729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22536',
internalId:  '',
customField: '20100113-110136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22563',
internalId:  '',
customField: '20110824-135833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22590',
internalId:  '',
customField: '20090524-153203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22617',
internalId:  '',
customField: '20110509-155043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27401',
internalId:  '',
customField: '20110509-155233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27428',
internalId:  '',
customField: '20110509-155253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22902',
internalId:  '',
customField: '20051028-095926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22903',
internalId:  '',
customField: '20051028-095926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29884',
internalId:  '',
customField: '20051217-131308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38301',
internalId:  '',
customField: '20110815-140403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42801',
internalId:  '',
customField: '20090712-153335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53401',
internalId:  '',
customField: '20120126-085016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54701',
internalId:  '',
customField: '20120124-034607'
};
webappMappings['7008']=webappMappings['7008-5096']={
webappId:    '7008',
documentId:  '22563',
internalId:  '5096',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-5098']={
webappId:    '7008',
documentId:  '57301',
internalId:  '5098',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57301',
internalId:  '',
customField: '20110930-044137'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'Ahp010INE9UD';
var companyName   = 'Glarner+Kantonal+Gesangverein';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};

