/* [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','5201',jdecode('Home'),jdecode(''),'/5201/index.html','true',[ 
		['PAGE','160201',jdecode('Neuheiten'),jdecode(''),'/5201/160201.html','true',[],'','']
	],'',''],
	['PAGE','5315',jdecode('Angebote'),jdecode(''),'/5315.html','true',[],'',''],
	['PAGE','122401',jdecode('Anwendertreffen'),jdecode(''),'/122401/index.html','true',[ 
		['PAGE','5294',jdecode('R%C3%BCckblick'),jdecode(''),'/122401/5294.html','true',[],'','']
	],'',''],
	['PAGE','398323',jdecode('Archiv'),jdecode(''),'/398323/index.html','true',[ 
		['PAGE','398344',jdecode('ab+Januar+2010'),jdecode(''),'/398323/398344.html','true',[],'',''],
		['PAGE','146222',jdecode('bis+Dezember+2009'),jdecode(''),'/398323/146222.html','true',[],'','']
	],'',''],
	['PAGE','400323',jdecode('BERNINA+in+der+Schule'),jdecode(''),'/400323/index.html','true',[ 
		['PAGE','287612',jdecode('Mode+Design+Schule+Z%C3%BCrich+2009'),jdecode(''),'/400323/287612.html','true',[],'',''],
		['PAGE','412223',jdecode('Mode+Design+Schule+Z%C3%BCrich+2010'),jdecode(''),'/400323/412223.html','true',[],'',''],
		['PAGE','400344',jdecode('Sch%C3%B6nenberg'),jdecode(''),'/400323/400344.html','true',[],'',''],
		['PAGE','400365',jdecode('Schaffhausen'),jdecode(''),'/400323/400365.html','true',[],'',''],
		['PAGE','418923',jdecode('Kantonsschule+Seetal'),jdecode(''),'/400323/418923.html','true',[],'','']
	],'',''],
	['PAGE','5420',jdecode('Events'),jdecode(''),'/5420/index.html','true',[ 
		['PAGE','376123',jdecode('Workshop+Sch%C3%BCrze+'),jdecode(''),'/5420/376123.html','true',[],'',''],
		['PAGE','109401',jdecode('Gemeinschaftswerk'),jdecode(''),'/5420/109401.html','true',[],'',''],
		['PAGE','231301',jdecode('M%C3%A4nnerkurs'),jdecode(''),'/5420/231301.html','true',[],'',''],
		['PAGE','423323',jdecode('T%C3%B6ff-Club'),jdecode(''),'/5420/423323.html','true',[],'','']
	],'',''],
	['PAGE','109806',jdecode('G%C3%A4stebuch'),jdecode(''),'/109806/index.html','true',[ 
		['PAGE','109801',jdecode('Eintr%C3%A4ge'),jdecode(''),'/109806/109801.html','true',[],'','']
	],'',''],
	['PAGE','5336',jdecode('Inhaberin'),jdecode(''),'/5336.html','true',[],'',''],
	['PAGE','438523',jdecode('Kreativtage'),jdecode(''),'/438523/index.html','true',[ 
		['PAGE','438823',jdecode('Kreativtage+Sommer+2010'),jdecode(''),'/438523/438823.html','true',[],'',''],
		['PAGE','363323',jdecode('Kreativtage+Fr%C3%BChling+2010'),jdecode(''),'/438523/363323.html','true',[],'',''],
		['PAGE','266112',jdecode('Kreativtage+Herbst+2009'),jdecode(''),'/438523/266112.html','true',[],'',''],
		['PAGE','195101',jdecode('Kreativtage+Fr%C3%BChling+2009'),jdecode(''),'/438523/195101.html','true',[],'',''],
		['PAGE','142201',jdecode('Kreativtage+Herbst+2008'),jdecode(''),'/438523/142201.html','true',[],'','']
	],'',''],
	['PAGE','5399',jdecode('Kurse'),jdecode(''),'/5399/index.html','true',[ 
		['PAGE','5252',jdecode('Laufende+Kurse'),jdecode(''),'/5399/5252.html','true',[],'',''],
		['PAGE','396623',jdecode('Kleider+n%C3%A4hen'),jdecode(''),'/5399/396623.html','true',[],'',''],
		['PAGE','421123',jdecode('Kinderkleider+n%C3%A4hen'),jdecode(''),'/5399/421123.html','true',[],'',''],
		['PAGE','285512',jdecode('Patch-+und+Quiltkurs'),jdecode(''),'/5399/285512.html','true',[],'',''],
		['PAGE','125701',jdecode('Sticksoftware'),jdecode(''),'/5399/125701.html','true',[],'',''],
		['PAGE','138901',jdecode('Overlock'),jdecode(''),'/5399/138901.html','true',[],'',''],
		['PAGE','146201',jdecode('Kursanmeldung'),jdecode(''),'/5399/146201.html','true',[],'',''],
		['PAGE','126301',jdecode('Privatstunden'),jdecode(''),'/5399/126301.html','true',[],'','']
	],'',''],
	['PAGE','5273',jdecode('Kurszentrum'),jdecode(''),'/5273.html','true',[],'',''],
	['PAGE','5357',jdecode('Lageplan'),jdecode(''),'/5357.html','true',[],'',''],
	['PAGE','42701',jdecode('Links'),jdecode(''),'/42701.html','true',[],'',''],
	['PAGE','129401',jdecode('Stickfaden'),jdecode(''),'/129401/index.html','true',[ 
		['PAGE','129422',jdecode('Isacord'),jdecode(''),'/129401/129422.html','true',[],'',''],
		['PAGE','129443',jdecode('Polysheen'),jdecode(''),'/129401/129443.html','true',[],'','']
	],'',''],
	['PAGE','266312',jdecode('Chinareise'),jdecode(''),'/266312.html','true',[],'',''],
	['PAGE','315223',jdecode('Frankreichreise'),jdecode(''),'/315223.html','true',[],'',''],
	['PAGE','433523',jdecode('Reise+an+die+Ostsee'),jdecode(''),'/433523.html','true',[],'',''],
	['PAGE','381923',jdecode('Handball'),jdecode(''),'/381923.html','true',[],'','']];
var siteelementCount=47;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='01343D';
theSitetree.keyvisualId='2160';
theSitetree.keyvisualName='communication.jpg';
theSitetree.fontsetId='357';
theSitetree.graphicsetId='409';
theSitetree.contentColor='FF0000';
theSitetree.contentBGColor='01343D';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Medium',
				paletteFamily: 	'01343D',
				keyvisualId: 	'2160',
				keyvisualName: 	'communication.jpg',
				fontsetId: 		'357',
				graphicsetId: 	'409',
				contentColor: 	'FF0000',
				contentBGColor: '01343D',
				a_color: 		'01343D',
				b_color: 		'8EBFC6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-109806abw0x0in2g0a']={
webappId:    '1002',
documentId:  '109806',
internalId:  '109806abw0x0in2g0a',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '412223',
internalId:  '',
customField: '20100331-104814'
};
webappMappings['7008']=webappMappings['7008-799']={
webappId:    '7008',
documentId:  '129422',
internalId:  '799',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-800']={
webappId:    '7008',
documentId:  '129443',
internalId:  '800',
customField: 'language:de;country:CH;'
};
webappMappings['1003']=webappMappings['1003-abw0x0in2g0a11b672c8246']={
webappId:    '1003',
documentId:  '5201',
internalId:  'abw0x0in2g0a11b672c8246',
customField: 'de:CH:'
};
webappMappings['7008']=webappMappings['7008-801']={
webappId:    '7008',
documentId:  '146201',
internalId:  '801',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100820-131811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '160201',
internalId:  '',
customField: '20100815-201009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5273',
internalId:  '',
customField: '20090622-173844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5315',
internalId:  '',
customField: '20090622-172956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5399',
internalId:  '',
customField: '20100814-204943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146201',
internalId:  '',
customField: '20100114-224549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142201',
internalId:  '',
customField: '20100814-205148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195101',
internalId:  '',
customField: '20100814-205252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5252',
internalId:  '',
customField: '20100818-220510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125701',
internalId:  '',
customField: '20100809-183411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138901',
internalId:  '',
customField: '20100314-234155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126301',
internalId:  '',
customField: '20100114-224058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129401',
internalId:  '',
customField: '20090622-175605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129422',
internalId:  '',
customField: '20080728-024143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129443',
internalId:  '',
customField: '20080728-024204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5336',
internalId:  '',
customField: '20090622-173754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122401',
internalId:  '',
customField: '20100802-220552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5294',
internalId:  '',
customField: '20100802-213753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5420',
internalId:  '',
customField: '20100508-003610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109401',
internalId:  '',
customField: '20090622-173438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '231301',
internalId:  '',
customField: '20090622-173550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109806',
internalId:  '',
customField: '20090622-173619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109801',
internalId:  '',
customField: '20080430-200001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42701',
internalId:  '',
customField: '20100721-091731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5357',
internalId:  '',
customField: '20100809-213047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146222',
internalId:  '',
customField: '20100114-114249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '438823',
internalId:  '',
customField: '20100820-132429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '438523',
internalId:  '',
customField: '20100814-205926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '433523',
internalId:  '',
customField: '20100803-020224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '423323',
internalId:  '',
customField: '20100508-002732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '421123',
internalId:  '',
customField: '20100428-182109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '418923',
internalId:  '',
customField: '20100426-092458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '400365',
internalId:  '',
customField: '20100124-143355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '400344',
internalId:  '',
customField: '20100124-152310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '400323',
internalId:  '',
customField: '20100426-101925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '398344',
internalId:  '',
customField: '20100812-232154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '398323',
internalId:  '',
customField: '20100114-223643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '315223',
internalId:  '',
customField: '20090522-201752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '287612',
internalId:  '',
customField: '20100329-172646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '285512',
internalId:  '',
customField: '20100713-222154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '266312',
internalId:  '',
customField: '20090628-221042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '266112',
internalId:  '',
customField: '20100814-205358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '396623',
internalId:  '',
customField: '20100126-163440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '381923',
internalId:  '',
customField: '20091123-091236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '376123',
internalId:  '',
customField: '20091104-214642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '363323',
internalId:  '',
customField: '20100814-205535'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2G0A';
var companyName   = 'nso+schaffhausen';
var htmlTitle	  = 'Kurszentrum+NSO';
var metaKeywords  = 'Patchworkkurs%3B+Bernina%3B+NSO%3B+Overlock%3B+Patschwork%3B+Quilten%3B++Sticksoftware%3B++Kurszentrum%3B++Schaffhausen%3B++Schuldienstkurse%3B++Privatstunden%3B++N%3Fhkurse%3B++Schnittmustersoftware%3B+Dora+Amstutz%3B+BERNINA++Kurse+mit+Sticksoftware%3B++Kurse+mit+Overlockmaschinen%3B++BERNINA-Kurse%3B+Softwarekurse%3B+Stickkurs%3B+Sticksoftware%3B';
var metaContents  = 'Patchworkkues%3B+Bernina%3B+Kurse+mit+Sticksoftware%3B++Kurse+mit+Overlockmaschinen%3B++Quilten+mit+dem+BSR%3B+Patchen+mit+dem+Patchworkfuss%3B+BERNINA-Kurse%3B+Softwarekurse%3B+Stickkurs%3B+Sticksoftware%3B++NSO%3B++Overlock%3B++Sticksoftware%3B++Kurszentrum%3B++Schaffhausen%3B++Schuldienstkurse%3B++Privatstunden%3B++N%C3%A4hkurse%3B++Schnittmustersoftware%3B+Dora+Amstutz%3B+BERNINA%3B+My+Label';
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();
};
