/* [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','4607',jdecode('HOME'),jdecode(''), jdecode('%2F4607.html'), 'true',[],'',''],
	['PAGE','291601',jdecode('KONZERTE+%26+DATEN'),jdecode(''), jdecode('%2F291601.html'), 'true',[],'',''],
	['PAGE','4664',jdecode('BAND+%26+BACKGROUND'),jdecode(''), jdecode('%2F4664%2Findex.html'), 'true',[ 
		['PAGE','138322',jdecode('Spieler%2FMembers'),jdecode(''), jdecode('%2F4664%2F138322.html'), 'true',[],'',''],
		['PAGE','432001',jdecode('Repertoire'),jdecode(''), jdecode('%2F4664%2F432001.html'), 'true',[],'',''],
		['PAGE','416701',jdecode('Fotos%2FArchiv'),jdecode(''), jdecode('%2F4664%2F416701.html'), 'true',[],'','']
	],'',''],
	['PAGE','337601',jdecode('WORKSHOPS%2FKURSE'),jdecode(''), jdecode('%2F337601.html'), 'true',[],'',''],
	['PAGE','297301',jdecode('SPONSOREN+%2F+G%C3%96NNER'),jdecode(''), jdecode('%2F297301.html'), 'true',[],'',''],
	['PAGE','147222',jdecode('LINKS'),jdecode(''), jdecode('%2F147222.html'), 'true',[],'',''],
	['PAGE','147243',jdecode('KONTAKT+%26+BOOKING'),jdecode(''), jdecode('%2F147243.html'), 'true',[],'',''],
	['PAGE','388501',jdecode('G%C3%84STEBUCH'),jdecode(''), jdecode('%2F388501.html'), 'true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Blog';
theSitetree.paletteFamily='591617';
theSitetree.keyvisualId='11519';
theSitetree.keyvisualName='kv_11519.jpg';
theSitetree.fontsetId='32866';
theSitetree.graphicsetId='13951';
theSitetree.contentColor='212121';
theSitetree.contentBGColor='989696';
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: 			'Blog',
				paletteFamily: 	'591617',
				keyvisualId: 	'11519',
				keyvisualName: 	'kv_11519.jpg',
				fontsetId: 		'32866',
				graphicsetId: 	'13951',
				contentColor: 	'212121',
				contentBGColor: '989696',
				a_color: 		'FFB434',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4607',
internalId:  '1006',
customField: '1006'
};
webappMappings['5001']=webappMappings['5001--']={
webappId:    '5001',
documentId:  '337601',
internalId:  '-',
customField: 'language:de;country:CH;'
};
webappMappings['5001']=webappMappings['5001--']={
webappId:    '5001',
documentId:  '416701',
internalId:  '-',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-2416']={
webappId:    '7008',
documentId:  '147243',
internalId:  '2416',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '291601',
internalId:  '',
customField: '20120212-182416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4607',
internalId:  '',
customField: '20111103-090751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138322',
internalId:  '',
customField: '20111128-103841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4664',
internalId:  '',
customField: '20111114-102639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '416701',
internalId:  '',
customField: '20110904-192700'
};
webappMappings['1002']=webappMappings['1002-388501abw0x0inxpm0']={
webappId:    '1002',
documentId:  '388501',
internalId:  '388501abw0x0inxpm0',
customField: 'icq=false'
};
webappMappings['5001']=webappMappings['5001--']={
webappId:    '5001',
documentId:  '4607',
internalId:  '-',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '297301',
internalId:  '',
customField: '20090307-001255'
};
webappMappings['5001']=webappMappings['5001--']={
webappId:    '5001',
documentId:  '138322',
internalId:  '-',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147222',
internalId:  '',
customField: '20100224-105131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147243',
internalId:  '',
customField: '20110114-015105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '337601',
internalId:  '',
customField: '20110114-020000'
};
webappMappings['5001']=webappMappings['5001--']={
webappId:    '5001',
documentId:  '291601',
internalId:  '-',
customField: 'language:de;country:CH;'
};
webappMappings['5001']=webappMappings['5001--']={
webappId:    '5001',
documentId:  '4664',
internalId:  '-',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '388501',
internalId:  '',
customField: '20091017-172821'
};
webappMappings['5001']=webappMappings['5001--']={
webappId:    '5001',
documentId:  '297301',
internalId:  '-',
customField: 'language:de;country:CH;'
};
webappMappings['5001']=webappMappings['5001--']={
webappId:    '5001',
documentId:  '147222',
internalId:  '-',
customField: 'language:de;country:CH;'
};
webappMappings['5001']=webappMappings['5001--']={
webappId:    '5001',
documentId:  '147243',
internalId:  '-',
customField: 'language:de;country:CH;'
};
webappMappings['5001']=webappMappings['5001--']={
webappId:    '5001',
documentId:  '388501',
internalId:  '-',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '432001',
internalId:  '-',
customField: '20120123-223914'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXPM0';
var companyName   = 'Steelband+Saanenland.....++++++karibische+Musik+aus+dem+Berner+Oberland';
var htmlTitle	  = 'Karibischer+Sound+aus+dem+Saanenland';
var metaKeywords  = 'gstaad+saanenland%2C++saanen+gstaad%2C+simmental%2C+%5Bsaanenland%5D%2C+zweisimmen+gstaad%2C+musik%2C+berner+oberland%2C+band+berner+oberland%2C++karibische+musik%2C++unrerhaltung+musikgruppe%2C+band%2C+%5Bsaanenland%5D%2C%5Bunterhaltung%5D%2C+%5Bmusikgruppe%5D%2C+%5Bunterhaltungsmusik%5D%2C+%5Bsteeldrum%5D%2C+%5Bsteelpan%5D%2C+%5Bband%5D%2C+band+gstaad%2C+musikgruppe+gstaad+saanen%2C+musikgruppe+hochzeit%2C+musikgruppe+live%2C+suche+musikgruppe%2C+suche+band%2C+unterhaltungsmusik+band%2C+unterhaltungsmusik+ch%2C+unterhaltungsmusik+hochzeit%2C+unterhaltungsmusik+live%2C+unterhaltungsmusik+party%2C+band+saanenland%2C+karibische+musik%2C+band+berner+oberland%2C+karibik+music%2C+karibik+musik%2C+karibischer+sound%2C+musik+berner+oberland%2C';
var metaContents  = 'Steelband+Saanenland.+Die+Musikformation+im+Berner+Oberland+mit+dem+gewissen+Etwas.+Karibische+Kl%C3%A4nge+vef%C3%BChren+sie+in+die+S%C3%BCdsee.+Unterhaltung+die+Sie+begeistern+wird.';
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();
};

