/* [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','4536',jdecode('Homepage'),jdecode(''), jdecode('%2F4536.html'), 'true',[],'',''],
	['PAGE','6702',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F6702%2Findex.html'), 'true',[ 
		['PAGE','6756',jdecode('Unsere+Heissluftballone'),jdecode(''), jdecode('%2F6702%2F6756.html'), 'true',[],'','']
	],'',''],
	['PAGE','13933',jdecode('Geschichte+des+Piloten'),jdecode(''), jdecode('%2F13933.html'), 'true',[],'',''],
	['PAGE','6783',jdecode('Angebote+'),jdecode(''), jdecode('%2F6783.html'), 'true',[],'',''],
	['PAGE','162836',jdecode('Wetter'),jdecode(''), jdecode('%2F162836.html'), 'true',[],'',''],
	['PAGE','11832',jdecode('Anl%C3%A4sse+%26+News'),jdecode(''), jdecode('%2F11832.html'), 'true',[],'',''],
	['PAGE','18464',jdecode('Bildergalerie'),jdecode(''), jdecode('%2F18464.html'), 'true',[],'',''],
	['PAGE','58209',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F58209%2Findex.html'), 'true',[ 
		['PAGE','58210',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F58209%2F58210.html'), 'false',[],'','']
	],'',''],
	['PAGE','6864',jdecode('Links'),jdecode(''), jdecode('%2F6864.html'), 'true',[],'',''],
	['PAGE','143909',jdecode('Murmi+im+Heissluftballon'),jdecode(''), jdecode('%2F143909.html'), 'true',[],'',''],
	['PAGE','170371',jdecode('Kontakt'),jdecode(''), jdecode('%2F170371%2Findex.html'), 'true',[ 
		['PAGE','170442',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''), jdecode('%2F170371%2F170442.html'), 'false',[],'','']
	],'',''],
	['PAGE','87409',jdecode('...und+zum+Schluss...'),jdecode(''), jdecode('%2F87409.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='3D4B78';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='426';
theSitetree.graphicsetId='468';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D4B78';
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: 			'Logg',
				paletteFamily: 	'3D4B78',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'426',
				graphicsetId: 	'468',
				contentColor: 	'FFFFFF',
				contentBGColor: '3D4B78',
				a_color: 		'3D4B78',
				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:  '4536',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-3138']={
webappId:    '7008',
documentId:  '170371',
internalId:  '3138',
customField: 'language:de;country:CH;'
};
webappMappings['1002']=webappMappings['1002-58209ABW0X0INXX5Z']={
webappId:    '1002',
documentId:  '58209',
internalId:  '58209ABW0X0INXX5Z',
customField: 'icq=true'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4536',
internalId:  '',
customField: '20111105-142632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6702',
internalId:  '',
customField: '20091008-115117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6756',
internalId:  '',
customField: '20080227-151203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13933',
internalId:  '',
customField: '20100131-162050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6783',
internalId:  '',
customField: '20110611-193334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '162836',
internalId:  '',
customField: '20081112-105908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11832',
internalId:  '',
customField: '20110914-234939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18464',
internalId:  '',
customField: '20100814-154107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58209',
internalId:  '',
customField: '20071002-122508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58210',
internalId:  '',
customField: '20050201-061326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6864',
internalId:  '',
customField: '20101101-235520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143909',
internalId:  '',
customField: '20091008-142440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '170371',
internalId:  '',
customField: '20090521-152845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '170442',
internalId:  '',
customField: '20061120-170427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87409',
internalId:  '',
customField: '20100622-172944'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXX5Z';
var companyName   = 'Butterfly+-+Ballonteam';
var htmlTitle	  = '';
var metaKeywords  = 'Heissluftballon%2CHeissluftballonfahrten%2CBallonfahren%2CBallon%2CBallonpilot%2CLuftfahrten%2CBallonteam%2CBallonfahrt%2CBallonfahrten%2CHeissluftballonfahren%2CHB-QBY%2CHB-QIU%2CHB-QKP%2CZ%EF%BF%BDrcher+Kantonalbank%2CUniversal%2CButterfly%2CMartin+Steinmann%2CZKB%2CHot+Air%2CDer+Traum+vom+fliegen%2CSteinmann%2CMartin%2CBallonfahrt%2CBallonwoche%2CBallonerlebniss%2CStehplatz+am+Himmel%2CWeidenkorb%2CVogelfrei%2CBallongruppe+Zugersee%2CMartins+Ballonfahrten%2CMartins+Ballonfahrt%2CBallonteam%2CKappel+am+Albis%2CZ%EF%BF%BDrcher+Kantonalbank%2CMallorca%2CBalloon%2CBalloonteam%2CLink%2CWebseite%2CWebseiten%2CHomepage%2CMurmi%2CFlugreise%2CHelene+Fischer%2CBallon%2C';
var metaContents  = 'Heissluftballon%2CHeissluftballonfahrten%2CBallonfahren%2CBallon%2CBallonpilot%2CLuftfahrten%2CBallonteam%2CBallonfahrt%2CBallonfahrten%2CHeissluftballonfahren%2CHB-QBY%2CHB-QIU%2CHB-QKP%2CMartin+Steinmann%2CZ%EF%BF%BDrcher+Kantonalbank%2CUniversal%2CButterfly%2CZKB%2CHot+Air%2CDer+Traum+vom+fliegen%2CSteinmann%2CMartin%2CBallonfahrt%2CBallonwoch%2CBallonerlebniss%2CStehplatz+am+Himmel%2CWeidenkorb%2CVogelfrei%2CBallongruppe+Zugersee%2CMartins+Ballonfahrten%2CMartins+Ballonfahrt%2CBallonteam%2CKappel+am+Albis%2CZ%EF%BF%BDrcher+Kantonalbank%2CMallorca%2CBalloon%2CBalloonteam%2CLink%2CWebseite%2CWebseiten%2CHomepage%2CMurmi%2CFlugreise%2CHelene+Fischer%2CBallon%2C';
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();
};

