/* [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 theSitetree=[ 
	['PAGE','4534',jdecode('Home'),jdecode(''),'/4534.html','true',[],''],
	['PAGE','41214',jdecode('Team+Bimare+Schweiz'),jdecode(''),'/41214.html','true',[],''],
	['PAGE','225438',jdecode('Bimare+Katamarane'),jdecode(''),'/225438.html','true',[],''],
	['PAGE','233390',jdecode('Bimare+Modell+XJ+%2F+V1'),jdecode(''),'/233390.html','true',[],''],
	['PAGE','233408',jdecode('Bimare+Modell+X-2'),jdecode(''),'/233408.html','true',[],''],
	['PAGE','233417',jdecode('Bimare+Modell+X-4'),jdecode(''),'/233417.html','true',[],''],
	['PAGE','233399',jdecode('Bimare+Modell+X-16'),jdecode(''),'/233399.html','true',[],''],
	['PAGE','45001',jdecode('Faszination+Katamaran'),jdecode(''),'/45001.html','true',[],''],
	['PAGE','104704',jdecode('Katamaran+Training'),jdecode(''),'/104704.html','true',[],''],
	['PAGE','45503',jdecode('Katamaran+Lexikon'),jdecode(''),'/45503.html','true',[],''],
	['PAGE','43302',jdecode('Katamaran+Links'),jdecode(''),'/43302.html','true',[],''],
	['PAGE','40567',jdecode('Projekt+Navigator'),jdecode(''),'/40567.html','true',[],''],
	['PAGE','93016',jdecode('Projekt+Sponsoren+'),jdecode(''),'/93016.html','true',[],''],
	['PAGE','233142',jdecode('Partner+Informationen'),jdecode(''),'/233142.html','true',[],''],
	['PAGE','42201',jdecode('Thunersee'),jdecode(''),'/42201.html','false',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Art';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='1782';
theSitetree.keyvisualName='duene.jpg';
theSitetree.fontsetId='283';
theSitetree.graphicsetId='350';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				name: 			'Art',
				paletteFamily: 	'000000',
				keyvisualId: 	'1782',
				keyvisualName: 	'duene.jpg',
				fontsetId: 		'283',
				graphicsetId: 	'350',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4534',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4534',
internalId:  '',
customField: '20090223-101133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41214',
internalId:  '',
customField: '20090223-005850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40567',
internalId:  '',
customField: '20090223-234445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42201',
internalId:  '',
customField: '20080514-101329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93016',
internalId:  '',
customField: '20090223-233113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45001',
internalId:  '',
customField: '20080514-105533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '225438',
internalId:  '',
customField: '20080514-102550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104704',
internalId:  '',
customField: '20080514-102625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45503',
internalId:  '',
customField: '20080514-102746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43302',
internalId:  '',
customField: '20090412-231539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '233390',
internalId:  '',
customField: '20090508-215426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '233142',
internalId:  '',
customField: '20090223-104243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '233399',
internalId:  '',
customField: '20090508-215426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '233408',
internalId:  '',
customField: '20090508-215426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '233417',
internalId:  '',
customField: '20090508-215426'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXXZA';
var companyName   = 'www.bimare.ch';
var htmlTitle	  = 'Katamaran+Segeln+in+der+Schweiz';
var metaKeywords  = 'Ferienhaus%2C+S%C3%BCdfrankreich%2C+Kinderfreundlich%2C+Privat%2C+Portiragnes%2C+Katamaran%2C+Segeln%2C+Wassersport%2C+Sandstrand%2C+Cat+Sailing%2C+Fotos%2C+Catamaran+Infos%2C+Forum%2C+F18ht%2C+Ventilo%2C+Team+Volvento%2C+Thunersee';
var metaContents  = 'Informationen+%C3%BCber+Ferienhaus+in+S%C3%BCdfrankreich%2Cideal+f%C3%BCr+Ferien+mit+Kindern%2C+Sandstrand%2CPool%2C+Infos+%C3%BCber+Katamarane%2C+Segeln+mit+vielen+Bildern%2C+Catsailing+und+Wassersport';
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();
};

