/* [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(''),'/4606.html','true',[],'',''],
	['PAGE','13910',jdecode('News'),jdecode(''),'/13910.html','true',[],'',''],
	['PAGE','13478',jdecode('Unser+Sportpferde-Team'),jdecode(''),'/13478.html','true',[],'',''],
	['PAGE','13802',jdecode('Unsere+Pferde'),jdecode(''),'/13802.html','true',[],'',''],
	['PAGE','50901',jdecode('Unsere+Fohlen'),jdecode(''),'/50901.html','true',[],'',''],
	['PAGE','13829',jdecode('Unsere+Deckhengste'),jdecode(''),'/13829.html','true',[],'',''],
	['PAGE','64501',jdecode('Nachzucht+Rickmer'),jdecode(''),'/64501.html','true',[],'',''],
	['PAGE','64601',jdecode('Nachzucht+Avalon'),jdecode(''),'/64601.html','true',[],'',''],
	['PAGE','60701',jdecode('Unsere+Sport-%2FZuchtstuten'),jdecode(''),'/60701.html','true',[],'',''],
	['PAGE','38474',jdecode('Resultate'),jdecode(''),'/38474.html','true',[],'',''],
	['PAGE','13883',jdecode('Verkaufspferde%2FVerkauf'),jdecode(''),'/13883.html','true',[],'',''],
	['PAGE','75001',jdecode('Andere+Oberh%C3%B6fler'),jdecode(''),'/75001.html','true',[],'',''],
	['PAGE','13856',jdecode('Unsere+Dienstleistungen'),jdecode(''),'/13856.html','true',[],'',''],
	['PAGE','23519',jdecode('Pferdetransporte'),jdecode(''),'/23519.html','true',[],'',''],
	['PAGE','20584',jdecode('Reitsportshop'),jdecode(''),'/20584.html','true',[],'',''],
	['PAGE','29112',jdecode('Aktionen+und+Aktuelles'),jdecode(''),'/29112.html','true',[],'',''],
	['PAGE','20611',jdecode('Entmistungsanlagen'),jdecode(''),'/20611.html','true',[],'',''],
	['PAGE','20638',jdecode('Sattelschr%C3%A4nke'),jdecode(''),'/20638.html','true',[],'',''],
	['PAGE','20665',jdecode('F%C3%BChranlagen'),jdecode(''),'/20665.html','true',[],'',''],
	['PAGE','20692',jdecode('Solarium%2FHindernisse'),jdecode(''),'/20692.html','true',[],'',''],
	['PAGE','45501',jdecode('Links'),jdecode(''),'/45501.html','true',[],'',''],
	['PAGE','13937',jdecode('So+finde+Sie+uns'),jdecode(''),'/13937.html','true',[],'','']];
var siteelementCount=22;
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 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:  '4606',
internalId:  '',
customField: '20100629-124125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13910',
internalId:  '',
customField: '20100702-173835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13478',
internalId:  '',
customField: '20100629-201540'
};
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: '20100629-202825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60701',
internalId:  '',
customField: '20100630-074456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13856',
internalId:  '',
customField: '20100629-195152'
};
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: '20100702-180614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29112',
internalId:  '',
customField: '20100629-124604'
};
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: '20100629-201254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13937',
internalId:  '',
customField: '20100629-125323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75001',
internalId:  '',
customField: '20100702-180129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64501',
internalId:  '',
customField: '20090914-180101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64601',
internalId:  '',
customField: '20100630-073913'
};
var canonHostname = 'hptworkerdb01b.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();
};
