/* [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','4477',jdecode('Home'),jdecode(''),'/4477.html','true',[],'',''],
	['PAGE','4534',jdecode('Bildgalerie'),jdecode(''),'/4534/index.html','true',[ 
		['PAGE','156972',jdecode('neues+Riff%3A+ab+Sept+2006'),jdecode(''),'/4534/156972.html','true',[],'',''],
		['PAGE','108355',jdecode('altes+Riff+-+Sept.+2006'),jdecode(''),'/4534/108355.html','true',[],'',''],
		['PAGE','148772',jdecode('Juwelen'),jdecode(''),'/4534/148772.html','true',[],'','']
	],'',''],
	['PAGE','113548',jdecode('Publizierte+Berichte'),jdecode(''),'/113548/index.html','true',[ 
		['PAGE','148260',jdecode('Magazine'),jdecode(''),'/113548/148260.html','true',[],'',''],
		['PAGE','106802',jdecode('Biologisches+System'),jdecode(''),'/113548/106802.html','true',[],'',''],
		['PAGE','127103',jdecode('Wie+Korallen+zu+ihren+Farben+kommen'),jdecode(''),'/113548/127103.html','true',[],'',''],
		['PAGE','71701',jdecode('DSB-Deep+Sand+Bed'),jdecode(''),'/113548/71701.html','true',[],'',''],
		['PAGE','104302',jdecode('Funktion+des+DSB'),jdecode(''),'/113548/104302.html','true',[],'','']
	],'',''],
	['PAGE','68301',jdecode('Tauchbilder'),jdecode(''),'/68301.html','true',[],'',''],
	['PAGE','13862',jdecode('Ethik%2FUmweltschutz'),jdecode(''),'/13862.html','true',[],'',''],
	['PAGE','34657',jdecode('Lexikon'),jdecode(''),'/34657.html','true',[],'',''],
	['PAGE','37401',jdecode('Links'),jdecode(''),'/37401.html','true',[],'',''],
	['PAGE','13512',jdecode('G%C3%A4stebuch'),jdecode(''),'/13512.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Intense';
theSitetree.paletteFamily='947CFC';
theSitetree.keyvisualId='3513';
theSitetree.keyvisualName='kv_3513.jpg';
theSitetree.fontsetId='10654';
theSitetree.graphicsetId='10801';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='D7CEFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Intense',
				paletteFamily: 	'947CFC',
				keyvisualId: 	'3513',
				keyvisualName: 	'kv_3513.jpg',
				fontsetId: 		'10654',
				graphicsetId: 	'10801',
				contentColor: 	'000000',
				contentBGColor: 'D7CEFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'AD401A',
				e_color: 		'727171',
				f_color: 		'3F3F3F',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4477',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-13512ABW0X0INXL8Z']={
webappId:    '1002',
documentId:  '13512',
internalId:  '13512ABW0X0INXL8Z',
customField: 'icq=false'
};
webappMappings['1003']=webappMappings['1003-abw0x0inxl8z10c6b9f1e7e']={
webappId:    '1003',
documentId:  '135711',
internalId:  'abw0x0inxl8z10c6b9f1e7e',
customField: 'de:CH:'
};
webappMappings['1003']=webappMappings['1003-abw0x0inxl8z10c6b9f1b3f']={
webappId:    '1003',
documentId:  '134903',
internalId:  'abw0x0inxl8z10c6b9f1b3f',
customField: 'de:CH:'
};
webappMappings['1003']=webappMappings['1003-abw0x0inxl8z10c6b9f1b62']={
webappId:    '1003',
documentId:  '134930',
internalId:  'abw0x0inxl8z10c6b9f1b62',
customField: 'de:CH:'
};
webappMappings['1003']=webappMappings['1003-abw0x0inxl8z10c6b9f1ba8']={
webappId:    '1003',
documentId:  '134957',
internalId:  'abw0x0inxl8z10c6b9f1ba8',
customField: 'de:CH:'
};
webappMappings['1003']=webappMappings['1003-abw0x0inxl8z10c6b9f1e43']={
webappId:    '1003',
documentId:  '135457',
internalId:  'abw0x0inxl8z10c6b9f1e43',
customField: 'de:CH:'
};
webappMappings['1003']=webappMappings['1003-abw0x0inxl8z10c6b9f2327']={
webappId:    '1003',
documentId:  '137757',
internalId:  'abw0x0inxl8z10c6b9f2327',
customField: 'de:CH:'
};
webappMappings['1003']=webappMappings['1003-abw0x0inxl8z10c6b9f23eb']={
webappId:    '1003',
documentId:  '137703',
internalId:  'abw0x0inxl8z10c6b9f23eb',
customField: 'de:CH:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4477',
internalId:  '',
customField: '20100121-163511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4534',
internalId:  '',
customField: '20071213-220210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156972',
internalId:  '',
customField: '20081108-103026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108355',
internalId:  '',
customField: '20070408-142437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148772',
internalId:  '',
customField: '20070408-142517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113548',
internalId:  '',
customField: '20061227-085625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148260',
internalId:  '',
customField: '20080930-144102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106802',
internalId:  '',
customField: '20050917-192935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127103',
internalId:  '',
customField: '20051212-104647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71701',
internalId:  '',
customField: '20050724-233440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104302',
internalId:  '',
customField: '20060605-203025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68301',
internalId:  '',
customField: '20080921-122210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13862',
internalId:  '',
customField: '20071216-133537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34657',
internalId:  '',
customField: '20050809-194140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37401',
internalId:  '',
customField: '20070303-172616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13512',
internalId:  '',
customField: '20100121-163326'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXL8Z';
var companyName   = 'HAUSRIFF.CH';
var htmlTitle	  = 'Hausriff.ch-Seite+f%C3%BCr+Meerwasseraquaristik';
var metaKeywords  = 'Iwan+L%C3%A4sser%2C+Meerwasser%2C+Riffaquarstik%2C+Hausriff%2C+Korallen%2C+Steinkorallen%2C+farbige+Korallen%2C+SPS%2C+Korallenriff%2C+Salzwasser%2C+Riff%2C+';
var metaContents  = 'Hausriff.ch.+Entdecken+Sie+die+Welt+der+Riffaquaristik+in+Ihrervollen+Sch%C3%B6nheit.+';
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();
};
