/* [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','4521',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/4521.html','true',[],'',''],
	['PAGE','8973',jdecode('Unsere+Zielsetz.'),jdecode(''),'/8973.html','true',[],'',''],
	['PAGE','9000',jdecode('Bes.+Aktivit%C3%A4ten'),jdecode(''),'/9000.html','true',[],'',''],
	['PAGE','16701',jdecode('Spez.+Vereinsakt.'),jdecode(''),'/16701.html','true',[],'',''],
	['PAGE','36103',jdecode('Unsere+Mitglieder'),jdecode(''),'/36103.html','true',[],'',''],
	['PAGE','9027',jdecode('Termine%2C+Eins%C3%A4tze'),jdecode(''),'/9027.html','true',[],'',''],
	['PAGE','9054',jdecode('Kontakt%2C+Formulare'),jdecode(''),'/9054/index.html','true',[ 
		['PAGE','37451',jdecode('Kontakt%2C+Formulare+%28Folgeseite%29'),jdecode(''),'/9054/37451.html','true',[],'',''],
		['PAGE','15159',jdecode('So+finden+Sie+uns'),jdecode(''),'/9054/15159.html','true',[],'','']
	],'',''],
	['PAGE','13201',jdecode('Angebote'),jdecode(''),'/13201.html','true',[],'',''],
	['PAGE','11905',jdecode('Hundeinfos'),jdecode(''),'/11905/index.html','true',[ 
		['PAGE','11932',jdecode('SKG+Mitteilungen'),jdecode(''),'/11905/11932.html','true',[],'','']
	],'',''],
	['PAGE','9429',jdecode('G%C3%A4stebuch'),jdecode(''),'/9429/index.html','true',[ 
		['PAGE','9430',jdecode('Eintr%C3%A4ge'),jdecode(''),'/9429/9430.html','true',[],'','']
	],'',''],
	['PAGE','17001',jdecode('Partnerorg.%26Links'),jdecode(''),'/17001.html','true',[],'',''],
	['PAGE','14901',jdecode('Humor'),jdecode(''),'/14901.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Mosaic';
theSitetree.paletteFamily='F3F2BE';
theSitetree.keyvisualId='2592';
theSitetree.keyvisualName='hund.jpg';
theSitetree.fontsetId='10362';
theSitetree.graphicsetId='10518';
theSitetree.contentColor='234773';
theSitetree.contentBGColor='F3F2BE';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Mosaic',
				paletteFamily: 	'F3F2BE',
				keyvisualId: 	'2592',
				keyvisualName: 	'hund.jpg',
				fontsetId: 		'10362',
				graphicsetId: 	'10518',
				contentColor: 	'234773',
				contentBGColor: 'F3F2BE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D85161',
				e_color: 		'A1A05C',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8973',
internalId:  '',
customField: '20080204-090740'
};
webappMappings['1002']=webappMappings['1002-9429ABW0X0INXX27']={
webappId:    '1002',
documentId:  '9429',
internalId:  '9429ABW0X0INXX27',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4521',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4521',
internalId:  '',
customField: '20100627-213843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9000',
internalId:  '',
customField: '20090509-220929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20100228-221426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36103',
internalId:  '',
customField: '20090509-222336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9027',
internalId:  '',
customField: '20100627-214257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9054',
internalId:  '',
customField: '20091020-195837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37451',
internalId:  '',
customField: '20060929-170411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15159',
internalId:  '',
customField: '20090303-233442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13201',
internalId:  '',
customField: '20060723-234018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11905',
internalId:  '',
customField: '20080417-144915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11932',
internalId:  '',
customField: '20100117-161429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9429',
internalId:  '',
customField: '20060529-014630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9430',
internalId:  '',
customField: '20060201-212725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20100117-161516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20070706-100126'
};
webappMappings['7008']=webappMappings['7008-2562']={
webappId:    '7008',
documentId:  '9054',
internalId:  '2562',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXX27';
var companyName   = 'HSV+Saanenland';
var htmlTitle	  = 'hundesportverein-saanen.ch';
var metaKeywords  = 'Hundesport';
var metaContents  = 'Hundesportverein';
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();
};
