/* [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','1508',jdecode('Home'),jdecode(''),'/1508.html','true',[],'',''],
	['PAGE','1592',jdecode('Familie+%2F+Familia'),jdecode(''),'/1592/index.html','true',[ 
		['PAGE','2109',jdecode('Claudia'),jdecode(''),'/1592/2109.html','true',[],'',''],
		['PAGE','2136',jdecode('Ivo'),jdecode(''),'/1592/2136.html','true',[],'',''],
		['PAGE','6696',jdecode('Dahiana'),jdecode(''),'/1592/6696.html','true',[],'',''],
		['PAGE','6723',jdecode('Dahian'),jdecode(''),'/1592/6723.html','true',[],'',''],
		['PAGE','35301',jdecode('Hier+sind+wir+zu+Hause'),jdecode(''),'/1592/35301.html','true',[],'',''],
		['PAGE','35322',jdecode('Test'),jdecode(''),'/1592/35322.html','true',[],'','']
	],'',''],
	['PAGE','6301',jdecode('Fotos'),jdecode(''),'/6301/index.html','true',[ 
		['PAGE','6328',jdecode('Familie+%2F+Familia'),jdecode(''),'/6301/6328.html','true',[],'',''],
		['PAGE','6355',jdecode('Diverses+%2F+Varios'),jdecode(''),'/6301/6355.html','true',[],'','']
	],'',''],
	['PAGE','2839',jdecode('G%C3%A4stebuch+%2F+Libro+de+visitas'),jdecode(''),'/2839.html','false',[],'',''],
	['PAGE','2838',jdecode('G%C3%A4stebuch'),jdecode(''),'/2838.html','true',[],'',''],
	['PAGE','8050',jdecode('Links+'),jdecode(''),'/8050.html','true',[],'',''],
	['PAGE','1565',jdecode('Tools'),jdecode(''),'/1565.html','true',[],'',''],
	['PAGE','32301',jdecode('Online-Shop'),jdecode(''),'/32301.html','true',[],'',''],
	['PAGE','39001',jdecode('Suche'),jdecode(''),'/39001.html','true',[],'',''],
	['PAGE','43901',jdecode('Kontakt'),jdecode(''),'/43901.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Ocean';
theSitetree.paletteFamily='1E77BA';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33083';
theSitetree.graphicsetId='14054';
theSitetree.contentColor='00386f';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Ocean',
				paletteFamily: 	'1E77BA',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33083',
				graphicsetId: 	'14054',
				contentColor: 	'00386f',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1508',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1592',
internalId:  '',
customField: '20090129-003613'
};
webappMappings['1002']=webappMappings['1002-2838ABW0X0INXSBN']={
webappId:    '1002',
documentId:  '2838',
internalId:  '2838ABW0X0INXSBN',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1508',
internalId:  '',
customField: '20110207-152212'
};
webappMappings['4001']=webappMappings['4001-26349999']={
webappId:    '4001',
documentId:  '32301',
internalId:  '26349999',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2109',
internalId:  '',
customField: '20050805-194038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2136',
internalId:  '',
customField: '20050613-122040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6696',
internalId:  '',
customField: '20050613-130613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6723',
internalId:  '',
customField: '20050613-131038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20071005-141427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6328',
internalId:  '',
customField: '20071122-144829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6355',
internalId:  '',
customField: '20071122-145314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2839',
internalId:  '',
customField: '20050805-194609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2838',
internalId:  '',
customField: '20050805-194758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8050',
internalId:  '',
customField: '20050613-133434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1565',
internalId:  '',
customField: '20050406-162310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32301',
internalId:  '',
customField: '20081103-132229'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '35301',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['7050']=webappMappings['7050-5']={
webappId:    '7050',
documentId:  '35322',
internalId:  '5',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35301',
internalId:  '',
customField: '20090127-112951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35322',
internalId:  '',
customField: '20091207-120145'
};
webappMappings['1501']=webappMappings['1501-209819']={
webappId:    '1501',
documentId:  '1508',
internalId:  '209819',
customField: '1501'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '39001',
internalId:  'search',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39001',
internalId:  '',
customField: '20090128-235252'
};
webappMappings['7008']=webappMappings['7008-492']={
webappId:    '7008',
documentId:  '43901',
internalId:  '492',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43901',
internalId:  '',
customField: '20090130-101931'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXSBN';
var companyName   = 'Familie+%2F+Familia+Hahn-Abreu%2C+Weesen%2C+Suiza';
var htmlTitle	  = 'Familie+Hahn-Abreu%2C+Weesen%2C+Suiza';
var metaKeywords  = 'ivo%2C+claudia%2C+dahian%2C+dahiana%2C+weesen%2C+suiza%2C+schweiz%2C+maim%3Fn%2C+maimon%2C+abreu%2C+hahn%2C+hahn-abreu%2C+familie%2C+familia%2C+dominikanische+republik%2C+republica+dominicana%2C+weesen+hall%C3%B6%C3%A4%C3%A4+%C3%BC%C3%BC+';
var metaContents  = 'Homepage+der+Familie+Hahn-Abreu+%C3%BC';
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();
};

