/* [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','4606',jdecode('Home'),jdecode(''), jdecode('%2F4606.html'), 'true',[],'',''],
	['PAGE','76901',jdecode('Pferdesportzentrum+Oberhof'),jdecode(''), jdecode('%2F76901.html'), 'true',[],'',''],
	['PAGE','77101',jdecode('Unser+Projekt'),jdecode(''), jdecode('%2F77101.html'), 'true',[],'',''],
	['PAGE','13478',jdecode('Unser+Sportpferde-Team'),jdecode(''), jdecode('%2F13478.html'), 'true',[],'',''],
	['PAGE','13910',jdecode('News'),jdecode(''), jdecode('%2F13910%2Findex.html'), 'true',[ 
		['PAGE','38474',jdecode('Resultate'),jdecode(''), jdecode('%2F13910%2F38474.html'), 'true',[],'','']
	],'',''],
	['PAGE','13829',jdecode('Unsere+Deckhengste'),jdecode(''), jdecode('%2F13829%2Findex.html'), 'true',[ 
		['PAGE','64501',jdecode('Nachzucht+Rickmer'),jdecode(''), jdecode('%2F13829%2F64501.html'), 'true',[],'',''],
		['PAGE','64601',jdecode('Nachzucht+Avalon'),jdecode(''), jdecode('%2F13829%2F64601.html'), 'true',[],'','']
	],'',''],
	['PAGE','60701',jdecode('Unsere+Sport-%2FZuchtstuten'),jdecode(''), jdecode('%2F60701%2Findex.html'), 'true',[ 
		['PAGE','50901',jdecode('Unsere+Fohlen'),jdecode(''), jdecode('%2F60701%2F50901.html'), 'true',[],'','']
	],'',''],
	['PAGE','13802',jdecode('Unsere+Pferde'),jdecode(''), jdecode('%2F13802.html'), 'true',[],'',''],
	['PAGE','13883',jdecode('Verkaufspferde%2FVerkauf'),jdecode(''), jdecode('%2F13883.html'), 'true',[],'',''],
	['PAGE','75001',jdecode('Andere+Oberh%C3%B6fler'),jdecode(''), jdecode('%2F75001.html'), 'true',[],'',''],
	['PAGE','20584',jdecode('Reitsportshop'),jdecode(''), jdecode('%2F20584%2Findex.html'), 'true',[ 
		['PAGE','29112',jdecode('Aktionen+und+Aktuelles'),jdecode(''), jdecode('%2F20584%2F29112.html'), 'true',[],'','']
	],'',''],
	['PAGE','13856',jdecode('Unsere+Dienstleistungen'),jdecode(''), jdecode('%2F13856%2Findex.html'), 'true',[ 
		['PAGE','23519',jdecode('Pferdetransporte'),jdecode(''), jdecode('%2F13856%2F23519.html'), 'true',[],'',''],
		['PAGE','20611',jdecode('Entmistungsanlagen'),jdecode(''), jdecode('%2F13856%2F20611.html'), 'true',[],'',''],
		['PAGE','20638',jdecode('Sattelschr%C3%A4nke'),jdecode(''), jdecode('%2F13856%2F20638.html'), 'true',[],'',''],
		['PAGE','20665',jdecode('F%C3%BChranlagen'),jdecode(''), jdecode('%2F13856%2F20665.html'), 'true',[],'',''],
		['PAGE','20692',jdecode('Solarium%2FHindernisse'),jdecode(''), jdecode('%2F13856%2F20692.html'), 'true',[],'','']
	],'',''],
	['PAGE','45501',jdecode('Links'),jdecode(''), jdecode('%2F45501.html'), 'true',[],'',''],
	['PAGE','84401',jdecode('Kontakt'),jdecode(''), jdecode('%2F84401.html'), 'true',[],'',''],
	['PAGE','13937',jdecode('So+finde+Sie+uns'),jdecode(''), jdecode('%2F13937.html'), 'true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='3D4B78';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='424';
theSitetree.graphicsetId='467';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D4B78';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Logg',
				paletteFamily: 	'3D4B78',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'424',
				graphicsetId: 	'467',
				contentColor: 	'FFFFFF',
				contentBGColor: '3D4B78',
				a_color: 		'3D4B78',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4606',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '76901',
internalId:  '-',
customField: '20111127-100502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4606',
internalId:  '',
customField: '20111123-102313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13910',
internalId:  '',
customField: '20111207-073910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13478',
internalId:  '',
customField: '20111112-185720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13802',
internalId:  '',
customField: '20100630-082229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50901',
internalId:  '',
customField: '20081113-150903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13829',
internalId:  '',
customField: '20111202-001112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60701',
internalId:  '',
customField: '20111112-182437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13856',
internalId:  '',
customField: '20111202-002244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13883',
internalId:  '',
customField: '20100629-125004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23519',
internalId:  '',
customField: '20100629-194924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38474',
internalId:  '',
customField: '20100630-064251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20584',
internalId:  '',
customField: '20111129-133446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29112',
internalId:  '',
customField: '20111129-133916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20611',
internalId:  '',
customField: '20070123-185857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20638',
internalId:  '',
customField: '20070123-191024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20665',
internalId:  '',
customField: '20070123-190122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20692',
internalId:  '',
customField: '20050402-091840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45501',
internalId:  '',
customField: '20111202-001021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13937',
internalId:  '',
customField: '20100629-125323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75001',
internalId:  '',
customField: '20111129-150229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64501',
internalId:  '',
customField: '20090914-180101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64601',
internalId:  '',
customField: '20100630-073913'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '77101',
internalId:  '-',
customField: '20111129-150732'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '84401',
internalId:  '-',
customField: '20111202-004325'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXES2';
var companyName   = 'Sportpferde+vom+Oberhof';
var htmlTitle	  = '';
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();
};

