/* [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','501',jdecode('Startseite'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','7301',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/7301/index.html','true',[ 
		['PAGE','7343',jdecode('Vorstand+%26+Ressorts'),jdecode(''),'/7301/7343.html','true',[],'',''],
		['PAGE','657',jdecode('Statuten'),jdecode(''),'/7301/657.html','true',[],'',''],
		['PAGE','60001',jdecode('Jahresbericht+2007'),jdecode(''),'/7301/60001.html','true',[],'',''],
		['PAGE','78101',jdecode('Flyer+insieme+Innerschwyz'),jdecode(''),'/7301/78101.html','true',[],'','']
	],'',''],
	['PAGE','636',jdecode('Dienstleistungen'),jdecode(''),'/636/index.html','true',[ 
		['PAGE','14122',jdecode('Entlastungsdienst'),jdecode(''),'/636/14122.html','true',[],'',''],
		['PAGE','573',jdecode('Bildungklub'),jdecode(''),'/636/573.html','true',[],'','']
	],'',''],
	['PAGE','113901',jdecode('Jahresprogramm+2010'),jdecode(''),'/113901/index.html','true',[ 
		['PAGE','82101',jdecode('Jahresprogramm+2009'),jdecode(''),'/113901/82101.html','true',[],'',''],
		['PAGE','53801',jdecode('Jahresprogramm+2008'),jdecode(''),'/113901/53801.html','true',[],'',''],
		['PAGE','552',jdecode('Jahresprogramm+2007'),jdecode(''),'/113901/552.html','true',[],'','']
	],'',''],
	['PAGE','11501',jdecode('Spenden+%26+Helfen'),jdecode(''),'/11501.html','true',[],'',''],
	['PAGE','12101',jdecode('Mitgliedschaft'),jdecode(''),'/12101.html','true',[],'',''],
	['PAGE','11201',jdecode('Impressionen'),jdecode(''),'/11201/index.html','true',[ 
		['PAGE','27401',jdecode('Freizeitgruppe+Mythen'),jdecode(''),'/11201/27401.html','true',[],'',''],
		['PAGE','44801',jdecode('Sommerlager%2FHerbstlager'),jdecode(''),'/11201/44801.html','true',[],'',''],
		['PAGE','34301',jdecode('ZYT+HA+%2F+GV+%2F+Advent'),jdecode(''),'/11201/34301.html','true',[],'','']
	],'',''],
	['PAGE','720',jdecode('Kontakt'),jdecode(''),'/720/index.html','true',[ 
		['PAGE','3201',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/720/3201.html','false',[],'','']
	],'',''],
	['PAGE','699',jdecode('Links'),jdecode(''),'/699.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='555454';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10892',
				contentColor: 	'555454',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-736734']={
webappId:    '1501',
documentId:  '501',
internalId:  '736734',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113901',
internalId:  '',
customField: '20100103-172645'
};
webappMappings['7060']=webappMappings['7060-1f8acd340e4d4ca6140954a35cd20570']={
webappId:    '7060',
documentId:  '34301',
internalId:  '1f8acd340e4d4ca6140954a35cd20570',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-20d370a659d8c1a2d677ee5cefa98431']={
webappId:    '7060',
documentId:  '44801',
internalId:  '20d370a659d8c1a2d677ee5cefa98431',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-c8200a92dc9a9593def0848bf815b5fc']={
webappId:    '7060',
documentId:  '27401',
internalId:  'c8200a92dc9a9593def0848bf815b5fc',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100214-121325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20081122-132504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7343',
internalId:  '',
customField: '20091127-073129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20081122-124848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20070630-130710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14122',
internalId:  '',
customField: '20070410-223443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20070923-114945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53801',
internalId:  '',
customField: '20090102-221204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20080316-152003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20100126-224227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20070221-195222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20070401-182407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27401',
internalId:  '',
customField: '20100106-173943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44801',
internalId:  '',
customField: '20100106-173934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34301',
internalId:  '',
customField: '20100106-173923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20070127-151053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20070122-182356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20080203-103336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60001',
internalId:  '',
customField: '20080311-215205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78101',
internalId:  '',
customField: '20081122-132356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82101',
internalId:  '',
customField: '20100103-170229'
};
webappMappings['7008']=webappMappings['7008-1235']={
webappId:    '7008',
documentId:  '720',
internalId:  '1235',
customField: 'language:de;country:CH;'
};
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010INXHWY';
var companyName   = 'insieme+Innerschwyz';
var htmlTitle	  = 'insieme+Innerschwyz+-+f%C3%BCr+Menschen+mit+geistiger+oder+cerebraler+Behinderung';
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();
};
