/* [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','4597',jdecode('Home'),jdecode(''),'/4597.html','true',[],'',''],
	['PAGE','4654',jdecode('Romina+'),jdecode(''),'/4654/index.html','true',[ 
		['PAGE','4681',jdecode('Wie+alles+begann..'),jdecode(''),'/4654/4681.html','true',[],'',''],
		['PAGE','4708',jdecode('CI+'),jdecode(''),'/4654/4708.html','true',[],'','']
	],'',''],
	['PAGE','4735',jdecode('Tagebuch++%22neu%22'),jdecode(''),'/4735/index.html','true',[ 
		['PAGE','14327',jdecode('2005+%2F+2006+'),jdecode(''),'/4735/14327.html','true',[],'',''],
		['PAGE','31701',jdecode('2007'),jdecode(''),'/4735/31701.html','true',[],'',''],
		['PAGE','44201',jdecode('2008+'),jdecode(''),'/4735/44201.html','true',[],'',''],
		['PAGE','55901',jdecode('2009+'),jdecode(''),'/4735/55901.html','true',[],'',''],
		['PAGE','64512',jdecode('2010+%22neu%22'),jdecode(''),'/4735/64512.html','true',[],'','']
	],'',''],
	['PAGE','12216',jdecode('Erlebnisberichte+'),jdecode(''),'/12216/index.html','true',[ 
		['PAGE','12243',jdecode('Reise+in+ein+anderes+Land+'),jdecode(''),'/12216/12243.html','true',[],'',''],
		['PAGE','13816',jdecode('Der+Tag+der+alles+ver%C3%A4nderte'),jdecode(''),'/12216/13816.html','true',[],'','']
	],'',''],
	['PAGE','5409',jdecode('G%C3%A4stebuch'),jdecode(''),'/5409/index.html','true',[ 
		['PAGE','5410',jdecode('Eintr%C3%A4ge'),jdecode(''),'/5409/5410.html','false',[],'','']
	],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Seasons_winter';
theSitetree.paletteFamily='FFFFFF';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='21093';
theSitetree.graphicsetId='13196';
theSitetree.contentColor='2E2E2E';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Seasons_winter',
				paletteFamily: 	'FFFFFF',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'21093',
				graphicsetId: 	'13196',
				contentColor: 	'2E2E2E',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4735',
internalId:  '',
customField: '20070825-085154'
};
webappMappings['1002']=webappMappings['1002-5409ABW0X0INXXMO']={
webappId:    '1002',
documentId:  '5409',
internalId:  '5409ABW0X0INXXMO',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4597',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4597',
internalId:  '',
customField: '20101203-064816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44201',
internalId:  '',
customField: '20081217-072643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4654',
internalId:  '',
customField: '20060925-110221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4681',
internalId:  '',
customField: '20110202-075809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4708',
internalId:  '',
customField: '20050604-173635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14327',
internalId:  '',
customField: '20070321-090305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31701',
internalId:  '',
customField: '20071210-070013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55901',
internalId:  '',
customField: '20090928-071853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12216',
internalId:  '',
customField: '20050618-101914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12243',
internalId:  '',
customField: '20050618-102317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13816',
internalId:  '',
customField: '20051205-145719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64512',
internalId:  '',
customField: '20100426-065719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5409',
internalId:  '',
customField: '20040831-211402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5410',
internalId:  '',
customField: '20040831-211402'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXXMO';
var companyName   = 'Romina%27s+Stille';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};

