/* [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','4528',jdecode('Home'),jdecode(''), jdecode('%2F4528.html'), 'true',[],'',''],
	['PAGE','4585',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F4585.html'), 'true',[],'',''],
	['PAGE','5263',jdecode('Bildergallerie'),jdecode(''), jdecode('%2F5263.html'), 'true',[],'',''],
	['PAGE','5209',jdecode('Kursinformationen'),jdecode(''), jdecode('%2F5209%2Findex.html'), 'true',[ 
		['PAGE','49901',jdecode('Klasseneinteilung'),jdecode(''), jdecode('%2F5209%2F49901.html'), 'true',[],'',''],
		['PAGE','16917',jdecode('Anfahrtsplan'),jdecode(''), jdecode('%2F5209%2F16917.html'), 'true',[],'',''],
		['PAGE','16929',jdecode('Routenplaner'),jdecode(''), jdecode('%2F5209%2F16929.html'), 'true',[],'',''],
		['PAGE','17342',jdecode('Kostenrechnung'),jdecode(''), jdecode('%2F5209%2F17342.html'), 'true',[],'','']
	],'',''],
	['PAGE','16719',jdecode('Kursanmeldung'),jdecode(''), jdecode('%2F16719.html'), 'true',[],'',''],
	['PAGE','5537',jdecode('Blog'),jdecode(''), jdecode('%2F5537.html'), 'false',[],'',''],
	['PAGE','5536',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F5536.html'), 'true',[],'',''],
	['PAGE','23101',jdecode('Schneesportleiter'),jdecode(''), jdecode('%2F23101%2Findex.html'), 'true',[ 
		['PAGE','55701',jdecode('Papiersammlung'),jdecode(''), jdecode('%2F23101%2F55701.html'), 'false',[],'',''],
		['PAGE','54401',jdecode('Sommerplausch+2011'),jdecode(''), jdecode('%2F23101%2F54401.html'), 'false',[],'',''],
		['PAGE','23122',jdecode('Ausbildung'),jdecode(''), jdecode('%2F23101%2F23122.html'), 'false',[],'',''],
		['PAGE','53401',jdecode('Abschlusstour'),jdecode(''), jdecode('%2F23101%2F53401.html'), 'true',[],'',''],
		['PAGE','25001',jdecode('Bildergalerie'),jdecode(''), jdecode('%2F23101%2F25001.html'), 'true',[],'',''],
		['PAGE','17048',jdecode('Es+war+einmal'),jdecode(''), jdecode('%2F23101%2F17048.html'), 'true',[],'','']
	],'',''],
	['PAGE','12801',jdecode('Forum'),jdecode(''), jdecode('%2F12801.html'), 'false',[],'',''],
	['PAGE','23143',jdecode('Archiv'),jdecode(''), jdecode('%2F23143.html'), 'true',[],'',''],
	['PAGE','27201',jdecode('Partner'),jdecode(''), jdecode('%2F27201.html'), 'true',[],'',''],
	['PAGE','4720',jdecode('Kontakt'),jdecode(''), jdecode('%2F4720.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Match';
theSitetree.paletteFamily='2354B7';
theSitetree.keyvisualId='2715';
theSitetree.keyvisualName='kv_2715.jpg';
theSitetree.fontsetId='10701';
theSitetree.graphicsetId='10633';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='C6E2FE';
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: 			'Match',
				paletteFamily: 	'2354B7',
				keyvisualId: 	'2715',
				keyvisualName: 	'kv_2715.jpg',
				fontsetId: 		'10701',
				graphicsetId: 	'10633',
				contentColor: 	'000000',
				contentBGColor: 'C6E2FE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'2354B7',
				e_color: 		'707070',
				f_color: 		'707070',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-5536ABW0X0INXETP']={
webappId:    '1002',
documentId:  '5536',
internalId:  '5536ABW0X0INXETP',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4528',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-9008']={
webappId:    '7008',
documentId:  '53401',
internalId:  '9008',
customField: 'language:de;country:CH;'
};
webappMappings['7050']=webappMappings['7050-883']={
webappId:    '7050',
documentId:  '5537',
internalId:  '883',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-1335']={
webappId:    '7008',
documentId:  '16719',
internalId:  '1335',
customField: 'language:de;country:CH;'
};
webappMappings['1501']=webappMappings['1501-1642166']={
webappId:    '1501',
documentId:  '4528',
internalId:  '1642166',
customField: '1501'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '16929',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4528',
internalId:  '',
customField: '20120205-215057'
};
webappMappings['1003']=webappMappings['1003-abw0x0inxetp1179e4e08ac']={
webappId:    '1003',
documentId:  '12801',
internalId:  'abw0x0inxetp1179e4e08ac',
customField: 'de:CH:'
};
webappMappings['7008']=webappMappings['7008-1336']={
webappId:    '7008',
documentId:  '23122',
internalId:  '1336',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23143',
internalId:  '',
customField: '20111105-110941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4585',
internalId:  '',
customField: '20101031-160015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5263',
internalId:  '',
customField: '20120123-222535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5209',
internalId:  '',
customField: '20101031-163155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16917',
internalId:  '',
customField: '20120107-103115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16929',
internalId:  '',
customField: '20061129-231130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17342',
internalId:  '',
customField: '20101031-163611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16719',
internalId:  '',
customField: '20111105-124259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5537',
internalId:  '',
customField: '20090621-222103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5536',
internalId:  '',
customField: '20030918-230423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23101',
internalId:  '',
customField: '20091018-200223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23122',
internalId:  '',
customField: '20111105-130327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25001',
internalId:  '',
customField: '20101031-164426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17048',
internalId:  '',
customField: '20071008-202054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20061129-232815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27201',
internalId:  '',
customField: '20120129-215213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4720',
internalId:  '',
customField: '20101031-165036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49901',
internalId:  '',
customField: '20101031-163426'
};
webappMappings['7008']=webappMappings['7008-6299']={
webappId:    '7008',
documentId:  '4720',
internalId:  '6299',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53401',
internalId:  '',
customField: '20110212-193321'
};
webappMappings['7008']=webappMappings['7008-9504']={
webappId:    '7008',
documentId:  '54401',
internalId:  '9504',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54401',
internalId:  '',
customField: '20110821-124851'
};
webappMappings['7008']=webappMappings['7008-10685']={
webappId:    '7008',
documentId:  '55701',
internalId:  '10685',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55701',
internalId:  '',
customField: '20100923-234035'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXETP';
var companyName   = 'Schneesportschule+KTV+Arbon';
var htmlTitle	  = 'Schneesportschule+KTV+Arbon';
var metaKeywords  = 'Ski+Snowboard+Kurs+KTV+Arbon+Schneesportschule+Schneesport+Kursangebot+Wildhaus+Januar+Skiclub+sca+Vergn%C3%BCgen+Vergnuegen+Freizeit+Sport+Aktiv+Fitness+Carving+Ski+Ski+Ski+Snowboard+Snowboard+Kurse+Schnee+Kurse+Schnee+Schneesportkurse%2C+Skikurs%2C+Snowboardkurs%2C+Kurs%2C+Kurse';
var metaContents  = 'Schneesportschule+KTV+Arbon+fuehrt+jaehrlich+Ski+und+Snowboard+Kurse+in+Wildhaus+durch.+Wir+haben+ein+breites+Angebot+von+Schneesportkursen';
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();
};

