/* [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','1501',jdecode('Home'),jdecode(''),'/1501.html','true',[],'',''],
	['PAGE','2701',jdecode('Wanderreiter'),jdecode(''),'/2701/index.html','true',[ 
		['PAGE','2722',jdecode('Agenda'),jdecode(''),'/2701/2722.html','true',[],'',''],
		['PAGE','2743',jdecode('%C3%BCber+uns'),jdecode(''),'/2701/2743.html','true',[],'',''],
		['PAGE','2764',jdecode('Berichte+Wanderritte'),jdecode(''),'/2701/2764.html','true',[],'',''],
		['PAGE','2806',jdecode('Offenburg+2006'),jdecode(''),'/2701/2806.html','true',[],'',''],
		['PAGE','2827',jdecode('Vogesen+2007'),jdecode(''),'/2701/2827.html','true',[],'',''],
		['PAGE','2848',jdecode('Haute+Sa%C3%B4ne+2008'),jdecode(''),'/2701/2848.html','true',[],'',''],
		['PAGE','52701',jdecode('Vercors+2009'),jdecode(''),'/2701/52701.html','true',[],'','']
	],'',''],
	['PAGE','2995',jdecode('Shop+f%C3%BCr+Wanderreiter'),jdecode(''),'/2995/index.html','true',[ 
		['PAGE','33022',jdecode('Sattelzubeh%C3%B6r'),jdecode(''),'/2995/33022.html','true',[],'',''],
		['PAGE','33043',jdecode('Sattelunterlagen'),jdecode(''),'/2995/33043.html','true',[],'',''],
		['PAGE','33001',jdecode('Packsysteme'),jdecode(''),'/2995/33001.html','true',[],'',''],
		['PAGE','3016',jdecode('AGBs'),jdecode(''),'/2995/3016.html','true',[],'','']
	],'',''],
	['PAGE','2869',jdecode('Wanderreitstationen'),jdecode(''),'/2869.html','true',[],'',''],
	['PAGE','2932',jdecode('Packsattel-Reiten'),jdecode(''),'/2932.html','true',[],'',''],
	['PAGE','3037',jdecode('Occasionen'),jdecode(''),'/3037.html','true',[],'',''],
	['PAGE','14915',jdecode('Anfahrt'),jdecode(''),'/14915.html','true',[],'',''],
	['PAGE','3079',jdecode('Kontakt'),jdecode(''),'/3079.html','true',[],'',''],
	['PAGE','48501',jdecode('Les+Pichettes'),jdecode(''),'/48501.html','true',[],'',''],
	['PAGE','3100',jdecode('Links'),jdecode(''),'/3100.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='A5B351';
theSitetree.keyvisualId='6854';
theSitetree.keyvisualName='kv_6854.jpg';
theSitetree.fontsetId='11212';
theSitetree.graphicsetId='12031';
theSitetree.contentColor='657025';
theSitetree.contentBGColor='C1CF70';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'A5B351',
				keyvisualId: 	'6854',
				keyvisualName: 	'kv_6854.jpg',
				fontsetId: 		'11212',
				graphicsetId: 	'12031',
				contentColor: 	'657025',
				contentBGColor: 'C1CF70',
				a_color: 		'C1CF70',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '14915',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1501',
internalId:  '',
customField: '20100603-122243'
};
webappMappings['7060']=webappMappings['7060-e500fd32fc7423f1557ebc67afab425d']={
webappId:    '7060',
documentId:  '48501',
internalId:  'e500fd32fc7423f1557ebc67afab425d',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-773']={
webappId:    '7008',
documentId:  '3079',
internalId:  '773',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20090227-101315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52701',
internalId:  '',
customField: '20090822-222800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14915',
internalId:  '',
customField: '20090815-205735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2722',
internalId:  '',
customField: '20100603-124645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2743',
internalId:  '',
customField: '20090415-193600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2764',
internalId:  '',
customField: '20100603-122343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2806',
internalId:  '',
customField: '20081207-154822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2827',
internalId:  '',
customField: '20090224-183051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2848',
internalId:  '',
customField: '20090224-183129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2995',
internalId:  '',
customField: '20100508-223035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33022',
internalId:  '',
customField: '20090902-200428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33043',
internalId:  '',
customField: '20090902-200734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33001',
internalId:  '',
customField: '20100508-215255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3016',
internalId:  '',
customField: '20090227-110602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2869',
internalId:  '',
customField: '20100508-215811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2932',
internalId:  '',
customField: '20100508-220106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3037',
internalId:  '',
customField: '20100508-220210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3079',
internalId:  '',
customField: '20081201-210112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48501',
internalId:  '',
customField: '20100508-220304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3100',
internalId:  '',
customField: '20090902-202856'
};
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHOPT0IN3VUK';
var companyName   = 'Amazone-Reitsport+%2F+www.wanderreiter.ch';
var htmlTitle	  = 'Amaone-Reitsport';
var metaKeywords  = '';
var metaContents  = '';
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();
};
