/* [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 theSitetree=[ 
	['PAGE','4714',jdecode('Home'),jdecode(''),'/4714.html','true',[],''],
	['PAGE','35775',jdecode('Neuheiten+%2F+Aktionen'),jdecode(''),'/35775.html','true',[],''],
	['PAGE','5202',jdecode('Reitsportartikel'),jdecode(''),'/5202/index.html','true',[ 
		['PAGE','47493',jdecode('f%C3%BCr+den+Reiter'),jdecode(''),'/5202/47493.html','true',[],''],
		['PAGE','42252',jdecode('Sicherheit+und+Zubeh%C3%B6r'),jdecode(''),'/5202/42252.html','true',[],''],
		['PAGE','47502',jdecode('f%C3%BCr+das+Pferd'),jdecode(''),'/5202/47502.html','true',[],'']
	],''],
	['PAGE','10472',jdecode('Araber+Show+Halfter'),jdecode(''),'/10472/index.html','true',[ 
		['PAGE','47914',jdecode('Gr%C3%B6ssentabelle+f%C3%BCr+Show-Halfter'),jdecode(''),'/10472/47914.html','true',[],'']
	],''],
	['PAGE','5256',jdecode('Kontakt'),jdecode(''),'/5256/index.html','true',[ 
		['PAGE','44365',jdecode('Kontakt+%28Form+followup+page%29'),jdecode(''),'/5256/44365.html','false',[],'']
	],''],
	['PAGE','12402',jdecode('G%C3%A4stebuch'),jdecode(''),'/12402.html','true',[],''],
	['PAGE','12403',jdecode('G%C3%A4stebuch+Eintr%C3%A4ge'),jdecode(''),'/12403.html','false',[],''],
	['PAGE','19115',jdecode('Anfahrt'),jdecode(''),'/19115.html','true',[],''],
	['PAGE','22141',jdecode('Lieferanten'),jdecode(''),'/22141.html','true',[],''],
	['PAGE','43526',jdecode('Links'),jdecode(''),'/43526.html','true',[],''],
	['PAGE','43553',jdecode('Impressum'),jdecode(''),'/43553.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Basic';
theSitetree.paletteFamily='2E681F';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10829';
theSitetree.graphicsetId='11286';
theSitetree.contentColor='2E681F';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				name: 			'Basic',
				paletteFamily: 	'2E681F',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10829',
				graphicsetId: 	'11286',
				contentColor: 	'2E681F',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35775',
internalId:  '',
customField: '20090521-094716'
};
webappMappings['1002']=webappMappings['1002-12402ABW0X0INXVGO']={
webappId:    '1002',
documentId:  '12402',
internalId:  '12402ABW0X0INXVGO',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4714',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '19115',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10472',
internalId:  '',
customField: '20090118-202045'
};
webappMappings['1501']=webappMappings['1501-2177967']={
webappId:    '1501',
documentId:  '4714',
internalId:  '2177967',
customField: '1501'
};
webappMappings['1009']=webappMappings['1009-6227809']={
webappId:    '1009',
documentId:  '44365',
internalId:  '6227809',
customField: 'isFollowupPage:true;documentId:5256;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4714',
internalId:  '',
customField: '20090521-094251'
};
webappMappings['7008']=webappMappings['7008-5714']={
webappId:    '7008',
documentId:  '5256',
internalId:  '5714',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5202',
internalId:  '',
customField: '20090521-094645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47493',
internalId:  '',
customField: '20090118-204654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42252',
internalId:  '',
customField: '20060930-153752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47502',
internalId:  '',
customField: '20080206-204713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47914',
internalId:  '',
customField: '20080109-222802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5256',
internalId:  '',
customField: '20060122-191124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44365',
internalId:  '',
customField: '20060122-174813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12402',
internalId:  '',
customField: '20040728-231218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12403',
internalId:  '',
customField: '20040728-231218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19115',
internalId:  '',
customField: '20041014-222606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22141',
internalId:  '',
customField: '20060122-183405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43526',
internalId:  '',
customField: '20090118-211210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43553',
internalId:  '',
customField: '20080103-203315'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXVGO';
var companyName   = 'Heidi+Meister%2C+Sch%C3%BCrbergstrasse+21%2C+4805+Brittnau';
var htmlTitle	  = 'Reitsport+Meister+-+klein%2C+aber+fein';
var metaKeywords  = 'reitsport%2C+z%C3%A4ume%2C+araber%2C+showz%C3%A4ume%2C+trensen%2C+reitstiefel%2C+bottinen%2C+regendecken%2C+stallartikel%2C+reithosen%2C+reithelme%2C+gerten%2C+peitschen%2C+dressur%2C+western%2C+springen%2C+concours%2C+gamaschen%2C+gygax%2C+kentucky%2C+georg+schumacher%2C+brittnau%2C+zofingen%2C+wiggertal%2C+meister';
var metaContents  = 'reitsport%2C+z%C3%A4ume%2C+araber%2C+showz%C3%A4ume%2C+trensen%2C+reitstiefel%2C+bottinen%2C+regendecken%2C+stallartikel%2C+reithosen%2C+reithelme%2C+gerten%2C+peitschen%2C+dressur%2C+western%2C+springen%2C+concours%2C+gamaschen%2Cwiggertal%2C+zofingen%2C+brittnau';
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();
};
