/* [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','401',jdecode('Home'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','32801',jdecode('Was+ist+%22Lebe+Digital%22'),jdecode(''), jdecode('%2F32801.html'), 'true',[],'',''],
	['PAGE','25501',jdecode('Best+of+%22Lebe+Digital%22'),jdecode(''), jdecode('%2F25501.html'), 'true',[],'',''],
	['PAGE','5022',jdecode('Online+Marktplatz+ricardo.ch'),jdecode(''), jdecode('%2F5022.html'), 'true',[],'',''],
	['PAGE','14601',jdecode('Digitale+Fotos'),jdecode(''), jdecode('%2F14601.html'), 'true',[],'',''],
	['PAGE','61401',jdecode('Fotobook+Workshop'),jdecode(''), jdecode('%2F61401.html'), 'true',[],'',''],
	['PAGE','5001',jdecode('Digitale+Musik%3A+MP3%2C+iPOD'),jdecode(''), jdecode('%2F5001.html'), 'true',[],'',''],
	['PAGE','5043',jdecode('Search%21+Suchen+im+Internet'),jdecode(''), jdecode('%2F5043.html'), 'true',[],'',''],
	['PAGE','62001',jdecode('Umstieg+auf+Windows+7'),jdecode(''), jdecode('%2F62001.html'), 'true',[],'',''],
	['PAGE','5064',jdecode('Kontakt+%26+Kursleitung'),jdecode(''), jdecode('%2F5064.html'), 'true',[],'',''],
	['PAGE','27801',jdecode('Kursdaten'),jdecode(''), jdecode('%2F27801.html'), 'true',[],'',''],
	['PAGE','31701',jdecode('Kursorte'),jdecode(''), jdecode('%2F31701.html'), 'true',[],'',''],
	['PAGE','26901',jdecode('Feedback+Formular'),jdecode(''), jdecode('%2F26901%2Findex.html'), 'true',[ 
		['PAGE','27201',jdecode('Feedback+Formular+%28Folgeseite%29'),jdecode(''), jdecode('%2F26901%2F27201.html'), 'false',[],'','']
	],'',''],
	['PAGE','8401',jdecode('%22Webweiser%22'),jdecode(''), jdecode('%2F8401.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='FFD375';
theSitetree.keyvisualId='1961';
theSitetree.keyvisualName='agentur.jpg';
theSitetree.fontsetId='330';
theSitetree.graphicsetId='385';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stylus',
				paletteFamily: 	'FFD375',
				keyvisualId: 	'1961',
				keyvisualName: 	'agentur.jpg',
				fontsetId: 		'330',
				graphicsetId: 	'385',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFD375',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-3764']={
webappId:    '7008',
documentId:  '27801',
internalId:  '3764',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100327-200651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61401',
internalId:  '',
customField: '20100407-083421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20100407-081126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20090124-170305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5022',
internalId:  '',
customField: '20100201-104617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5043',
internalId:  '',
customField: '20100502-124437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20091230-112306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32801',
internalId:  '',
customField: '20091230-111738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5064',
internalId:  '',
customField: '20110515-142254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27801',
internalId:  '',
customField: '20110515-141935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62001',
internalId:  '',
customField: '20101028-171527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31701',
internalId:  '',
customField: '20100806-114320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26901',
internalId:  '',
customField: '20070629-105525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27201',
internalId:  '',
customField: '20070629-103745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20090130-091551'
};
webappMappings['7008']=webappMappings['7008-3763']={
webappId:    '7008',
documentId:  '26901',
internalId:  '3763',
customField: 'language:de;country:CH;'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2RBM';
var companyName   = 'Seminare+f%C3%BCr+den+Digital+Lifestyle';
var htmlTitle	  = 'LEBE+DIGITAL+-+Seminare+f%C3%BCr+den+Digital+Lifestyle';
var metaKeywords  = 'Kurs%2C+Seminar%2C+iPOD%2C+ipod%2C+iPhone%2C+iTunes%2C+MP3%2C+Google%2C+Musik%2C+Download%2C+ricardo.ch%2C+H%C3%B6rb%C3%BCcher%2C+Musik%2C+Internet+Sicherheit%2C+Datensicherheit%2C+Marktplatz%2C+Office%2C+Powerpoint%2C+Apple%2C+Symantec%2C+Logitech%2C+Digitalfoto%2C+Digitalkamera%2C+Digital+Foto%2C+Kamera%2C+Fotos';
var metaContents  = 'Lebe+Digital+-+Seminare+f%C3%BCr+den+Digital+Lifestyle';
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();
};

