/* [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','501',jdecode('Startseite'),jdecode(''),'/501/index.html','true',[ 
		['PAGE','18501',jdecode('Kurze+Vorstellung+%28Folgeseite%29'),jdecode(''),'/501/18501.html','false',[],'','']
	],'',''],
	['PAGE','506834',jdecode('AKTUELLES'),jdecode(''),'/506834.html','true',[],'',''],
	['PAGE','512434',jdecode('Tr%C3%BCbsee'),jdecode(''),'/512434.html','true',[],'',''],
	['PAGE','283601',jdecode('Wald+'),jdecode(''),'/283601.html','true',[],'',''],
	['PAGE','504634',jdecode('Fotostudio'),jdecode(''),'/504634.html','true',[],'',''],
	['PAGE','166901',jdecode('Wasser'),jdecode(''),'/166901.html','true',[],'',''],
	['PAGE','489512',jdecode('Digital+Art+'),jdecode(''),'/489512.html','true',[],'',''],
	['PAGE','479312',jdecode('Feiertage'),jdecode(''),'/479312.html','true',[],'',''],
	['PAGE','473112',jdecode('Oldtimer'),jdecode(''),'/473112.html','true',[],'',''],
	['PAGE','454912',jdecode('Skulpturen'),jdecode(''),'/454912.html','true',[],'',''],
	['PAGE','447812',jdecode('Greifv%C3%B6gel+%2F+Eulen'),jdecode(''),'/447812.html','true',[],'',''],
	['PAGE','438912',jdecode('Reptilien+%2F+Amphibien'),jdecode(''),'/438912.html','true',[],'',''],
	['PAGE','382201',jdecode('Winterzauber'),jdecode(''),'/382201.html','true',[],'',''],
	['PAGE','356301',jdecode('Rigi'),jdecode(''),'/356301.html','true',[],'',''],
	['PAGE','206101',jdecode('Jungfraujoch'),jdecode(''),'/206101.html','true',[],'',''],
	['PAGE','215501',jdecode('Natursch%C3%B6nheiten'),jdecode(''),'/215501.html','true',[],'',''],
	['PAGE','353001',jdecode('Rheinfall+bei+Nacht'),jdecode(''),'/353001.html','true',[],'',''],
	['PAGE','493512',jdecode('Orchideen'),jdecode(''),'/493512.html','true',[],'',''],
	['PAGE','52801',jdecode('Blumen+'),jdecode(''),'/52801.html','true',[],'',''],
	['PAGE','377101',jdecode('Interlaken%2C+Schweiz+'),jdecode(''),'/377101.html','true',[],'',''],
	['PAGE','298501',jdecode('Hotels+in+der+Schweiz'),jdecode(''),'/298501.html','true',[],'',''],
	['PAGE','165701',jdecode('Rahmenbilder'),jdecode(''),'/165701.html','true',[],'',''],
	['PAGE','330401',jdecode('Costa+del+Sol++'),jdecode(''),'/330401.html','true',[],'',''],
	['PAGE','464212',jdecode('Lokomotiven'),jdecode(''),'/464212.html','true',[],'',''],
	['PAGE','269601',jdecode('Technik++'),jdecode(''),'/269601.html','true',[],'',''],
	['PAGE','229901',jdecode('Schmetterlinge'),jdecode(''),'/229901.html','true',[],'',''],
	['PAGE','8501',jdecode('Insekten+%2F+Spinnen'),jdecode(''),'/8501.html','true',[],'',''],
	['PAGE','185701',jdecode('Zoo'),jdecode(''),'/185701.html','true',[],'',''],
	['PAGE','552',jdecode('Postkarten+Motive'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','175501',jdecode('HDR-Technik'),jdecode(''),'/175501.html','true',[],'',''],
	['PAGE','195401',jdecode('Bunt+gemischt'),jdecode(''),'/195401.html','true',[],'',''],
	['PAGE','239101',jdecode('Toplisten'),jdecode(''),'/239101.html','true',[],'',''],
	['PAGE','451612',jdecode('Zeichnungen'),jdecode(''),'/451612.html','true',[],'',''],
	['PAGE','165706',jdecode('G%C3%A4stebuch'),jdecode(''),'/165706.html','true',[],'',''],
	['PAGE','417001',jdecode('Ausstellung'),jdecode(''),'/417001.html','true',[],'',''],
	['PAGE','327201',jdecode('Impressum'),jdecode(''),'/327201.html','true',[],'','']];
var siteelementCount=37;
theSitetree.topTemplateName='Match';
theSitetree.paletteFamily='A1C183';
theSitetree.keyvisualId='2698';
theSitetree.keyvisualName='kv_2698.jpg';
theSitetree.fontsetId='10701';
theSitetree.graphicsetId='10634';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='DBE9CF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Match',
				paletteFamily: 	'A1C183',
				keyvisualId: 	'2698',
				keyvisualName: 	'kv_2698.jpg',
				fontsetId: 		'10701',
				graphicsetId: 	'10634',
				contentColor: 	'000000',
				contentBGColor: 'DBE9CF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'306102',
				e_color: 		'707070',
				f_color: 		'707070',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '417001',
internalId:  '',
customField: '20090630-231016'
};
webappMappings['7008']=webappMappings['7008-2463']={
webappId:    '7008',
documentId:  '501',
internalId:  '2463',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18501',
internalId:  '',
customField: '20070908-215952'
};
webappMappings['1002']=webappMappings['1002-165706abw1x0in2fpv']={
webappId:    '1002',
documentId:  '165706',
internalId:  '165706abw1x0in2fpv',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100823-225746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '447812',
internalId:  '',
customField: '20100128-223346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '377101',
internalId:  '',
customField: '20090811-224237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '382201',
internalId:  '',
customField: '20100228-224140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '356301',
internalId:  '',
customField: '20090420-101826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '353001',
internalId:  '',
customField: '20081217-200621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '330401',
internalId:  '',
customField: '20090619-233421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '298501',
internalId:  '',
customField: '20100902-233225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '283601',
internalId:  '',
customField: '20100610-225413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '269601',
internalId:  '',
customField: '20100830-205225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '229901',
internalId:  '',
customField: '20091012-221904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '215501',
internalId:  '',
customField: '20090722-174610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '206101',
internalId:  '',
customField: '20090226-201157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20090618-224901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20100816-114742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52801',
internalId:  '',
customField: '20100608-225502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '166901',
internalId:  '',
customField: '20100317-224541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '175501',
internalId:  '',
customField: '20091205-235913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '185701',
internalId:  '',
customField: '20100209-222902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195401',
internalId:  '',
customField: '20090928-224135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '239101',
internalId:  '',
customField: '20100816-213434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '327201',
internalId:  '',
customField: '20100124-101353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '165706',
internalId:  '',
customField: '20090312-143158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '165701',
internalId:  '',
customField: '20100531-110439'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-20617263']={
webappId:    '1501',
documentId:  '501',
internalId:  '20617263',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '438912',
internalId:  '',
customField: '20100209-222444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '451612',
internalId:  '',
customField: '20100617-230605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '454912',
internalId:  '',
customField: '20100830-155946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '464212',
internalId:  '',
customField: '20091021-233105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473112',
internalId:  '',
customField: '20100105-110359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '479312',
internalId:  '',
customField: '20100103-224316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '489512',
internalId:  '',
customField: '20100502-185325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '493512',
internalId:  '',
customField: '20100819-230456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '504634',
internalId:  '',
customField: '20100820-214808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '506834',
internalId:  '',
customField: '20100830-205341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '512434',
internalId:  '',
customField: '20100816-111026'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW1X0IN2FPV';
var companyName   = 'Fotopage+von+Hans+B%C3%BChler+';
var htmlTitle	  = '';
var metaKeywords  = 'http%3A%2F%2Fwww.hansbuehler-fotopages.ch%2F+Digitale+Fotografie+';
var metaContents  = 'http%3A%2F%2Fwww.hansbuehler-fotopages.ch%2F%3BFotopage+Hans+B%C3%BChler%3B+Greifv%C3%B6gel%3B+Digital+Art%3B+Winterzauber%3BLandschaften%3B+Blumen%3B+Insekten%3B+Schmetterlinge%3B+Wasser%3B++++++';
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();
};
