/* [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','801',jdecode('Home'),jdecode(''),'/801.html','true',[],'',''],
	['PAGE','5722',jdecode('Vorwort+'),jdecode(''),'/5722.html','true',[],'',''],
	['PAGE','5743',jdecode('Herkunft'),jdecode(''),'/5743.html','true',[],'',''],
	['PAGE','5827',jdecode('Unsere+Vorfahren'),jdecode(''),'/5827.html','true',[],'',''],
	['PAGE','136601',jdecode('Wohnsitze'),jdecode(''),'/136601.html','true',[],'',''],
	['PAGE','5848',jdecode('Auswanderung'),jdecode(''),'/5848.html','true',[],'',''],
	['PAGE','5869',jdecode('Wappen'),jdecode(''),'/5869/index.html','true',[ 
		['PAGE','5890',jdecode('Wappen+von+1675'),jdecode(''),'/5869/5890.html','true',[],'',''],
		['PAGE','5911',jdecode('Wappen+von+1762'),jdecode(''),'/5869/5911.html','true',[],'',''],
		['PAGE','5932',jdecode('Wappen+von+1784'),jdecode(''),'/5869/5932.html','true',[],'',''],
		['PAGE','5953',jdecode('Wappen+von+1788'),jdecode(''),'/5869/5953.html','true',[],'',''],
		['PAGE','5974',jdecode('Wappen+von+1868'),jdecode(''),'/5869/5974.html','true',[],'','']
	],'',''],
	['PAGE','62801',jdecode('Stammbaum'),jdecode(''),'/62801.html','true',[],'',''],
	['PAGE','5995',jdecode('Biographien'),jdecode(''),'/5995/index.html','true',[ 
		['PAGE','142401',jdecode('Der+Junker+von+Visp'),jdecode(''),'/5995/142401.html','true',[],'',''],
		['PAGE','142601',jdecode('Der+Kastlan+von+Sitten'),jdecode(''),'/5995/142601.html','true',[],'',''],
		['PAGE','142643',jdecode('Der+Kastlan+von+Niedergesteln'),jdecode(''),'/5995/142643.html','true',[],'',''],
		['PAGE','142664',jdecode('Der+Ammann+von+Geren'),jdecode(''),'/5995/142664.html','true',[],'',''],
		['PAGE','142422',jdecode('Die+sch%C3%B6ne+Margaretha'),jdecode(''),'/5995/142422.html','true',[],'',''],
		['PAGE','142622',jdecode('Der+Domherr'),jdecode(''),'/5995/142622.html','true',[],'',''],
		['PAGE','142685',jdecode('Der+Erbauer+der+Kapelle+Muzot'),jdecode(''),'/5995/142685.html','true',[],'','']
	],'',''],
	['PAGE','6037',jdecode('Fotos'),jdecode(''),'/6037/index.html','true',[ 
		['PAGE','123801',jdecode('Historische+Fotos'),jdecode(''),'/6037/123801.html','true',[],'','']
	],'',''],
	['PAGE','6058',jdecode('Links'),jdecode(''),'/6058.html','true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Bow';
theSitetree.paletteFamily='1DA51F';
theSitetree.keyvisualId='12024';
theSitetree.keyvisualName='kv_12024.jpg';
theSitetree.fontsetId='33246';
theSitetree.graphicsetId='14114';
theSitetree.contentColor='333333';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Bow',
				paletteFamily: 	'1DA51F',
				keyvisualId: 	'12024',
				keyvisualName: 	'kv_12024.jpg',
				fontsetId: 		'33246',
				graphicsetId: 	'14114',
				contentColor: 	'333333',
				contentBGColor: 'FFFFFF',
				a_color: 		'F2F5F8',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20091013-102632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5722',
internalId:  '',
customField: '20091013-102247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5827',
internalId:  '',
customField: '20090626-220446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5848',
internalId:  '',
customField: '20091013-161802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5869',
internalId:  '',
customField: '20080530-165253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5890',
internalId:  '',
customField: '20090626-203109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5911',
internalId:  '',
customField: '20080530-165502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5743',
internalId:  '',
customField: '20091013-145950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5932',
internalId:  '',
customField: '20080530-165841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5953',
internalId:  '',
customField: '20080604-175723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5974',
internalId:  '',
customField: '20080530-170805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62801',
internalId:  '',
customField: '20080529-094854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5995',
internalId:  '',
customField: '20091013-163913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6037',
internalId:  '',
customField: '20080522-105735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123801',
internalId:  '',
customField: '20080602-131924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6058',
internalId:  '',
customField: '20080522-105735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '136601',
internalId:  '',
customField: '20091013-155456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142401',
internalId:  '',
customField: '20091013-172952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142601',
internalId:  '',
customField: '20091013-164330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142643',
internalId:  '',
customField: '20091013-164330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142664',
internalId:  '',
customField: '20091013-164330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142422',
internalId:  '',
customField: '20091013-162411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142622',
internalId:  '',
customField: '20091013-164330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142685',
internalId:  '',
customField: '20091013-164330'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXPA8';
var companyName   = 'Imwinkelried';
var htmlTitle	  = 'Imwinkelried';
var metaKeywords  = 'Geschichte+einer+alten+Walliserfamilie%2C+Imwinkelried%2C+Genealogie+Familie+Imwinkelried%2C+Geschichte+Imwinkelried%2C+Wappen+Imwinkelried%2C+Imwinkelried+Rene%2CStammbaum%2CFamilienstammbaum%2C+Genealogie%2C+Rene+Imwinkelried%2C+Goms%2C+Obergoms%2C+Stammbaum%2C+Wallis%2C+Valais%2C+Stammbaumforschung%2C+Walliser+Geschichte%2C+Walliser+Alpen';
var metaContents  = 'Imwinkelried%2C+Familie+Imwinkelried%2C+Ein+St%C3%BCck+Familiengeschichte%2C++Genealogie+Imwinkelried%2C+Stammbaum+Imwinkelried%2C+history+imwinkelried%2C+familyhistory+imwinkelried%2C+Familiengeschichte+Imwinkelried%2C+Imwinkelried%2Bback+to+the+roots%2C+Zeneggen%2C+Goms%2C+Obergoms%2C+Rene+Imwinkelried%2CStammbaum%2CFamilienstammbaum%2CGenalogie%2C+Wallis%2C+Stammbaumforschung%2C+Walliser+Geschichte%2C+Familiengeschichte%2C+Walliser+Alpen';
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();
};
