/* [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','2301',jdecode('Home'),jdecode(''), jdecode('%2F2301.html'), 'true',[],'',''],
	['PAGE','2401',jdecode('Hengst'),jdecode(''), jdecode('%2F2401.html'), 'true',[],'',''],
	['PAGE','2422',jdecode('Stuten'),jdecode(''), jdecode('%2F2422.html'), 'true',[],'',''],
	['PAGE','2443',jdecode('Fohlen'),jdecode(''), jdecode('%2F2443.html'), 'true',[],'',''],
	['PAGE','2464',jdecode('Verkaufspferde+'),jdecode(''), jdecode('%2F2464.html'), 'true',[],'',''],
	['PAGE','2485',jdecode('Rassestandard%2F+Zuchtgeschichte'),jdecode(''), jdecode('%2F2485.html'), 'true',[],'',''],
	['PAGE','16001',jdecode('Bilder+S%C3%BCdamerika'),jdecode(''), jdecode('%2F16001.html'), 'true',[],'',''],
	['PAGE','16022',jdecode('Buch+%C3%BCber+Criollos'),jdecode(''), jdecode('%2F16022.html'), 'true',[],'',''],
	['PAGE','2506',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F2506.html'), 'true',[],'',''],
	['PAGE','18601',jdecode('Links'),jdecode(''), jdecode('%2F18601.html'), 'true',[],'',''],
	['PAGE','18001',jdecode('Impressum'),jdecode(''), jdecode('%2F18001.html'), 'true',[],'',''],
	['PAGE','18622',jdecode('Kontakt'),jdecode(''), jdecode('%2F18622.html'), 'true',[],'',''],
	['PAGE','16043',jdecode('Hier+finden+Sie+uns'),jdecode(''), jdecode('%2F16043.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Game';
theSitetree.paletteFamily='3F0604';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32046';
theSitetree.graphicsetId='13865';
theSitetree.contentColor='cb9240';
theSitetree.contentBGColor='3F0604';
var localeDef={
  language: 'de',
  country: 'DE'
};
var prodDef={
  wl_name: 'alfahosting',
  product: 'WSCSYSSSSLY0XNQ8'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Game',
				paletteFamily: 	'3F0604',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32046',
				graphicsetId: 	'13865',
				contentColor: 	'cb9240',
				contentBGColor: '3F0604',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['7002']=webappMappings['7002-1796']={
webappId:    '7002',
documentId:  '2506',
internalId:  '1796',
customField: 'language:de;country:DE;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20111009-115614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2485',
internalId:  '',
customField: '20090613-095835'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2959595']={
webappId:    '1501',
documentId:  '2301',
internalId:  '2959595',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20110102-111301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2422',
internalId:  '',
customField: '20111009-121920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2464',
internalId:  '',
customField: '20111009-121513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2443',
internalId:  '',
customField: '20090704-101547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18622',
internalId:  '',
customField: '20090622-160958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2506',
internalId:  '',
customField: '20090616-144139'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '16043',
internalId:  'routing',
customField: 'de_DE'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16022',
internalId:  '',
customField: '20090617-125455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20090704-103327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16043',
internalId:  '',
customField: '20090617-123247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20110701-133844'
};
webappMappings['7008']=webappMappings['7008-2269']={
webappId:    '7008',
documentId:  '18622',
internalId:  '2269',
customField: 'language:de;country:DE;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20090811-120400'
};
var webAppHostname = 'cgi-wsc.alfahosting.de:80';
var canonHostname = 'wsc.alfahosting.de';
var accountId     = 'AAHS10INXH61';
var companyName   = 'La+Montana+++Caballos+Criollos';
var htmlTitle	  = 'Criollos+-+La+Montana+-+Gest%C3%BCt+%26+Deckstation';
var metaKeywords  = 'Criollos%2C+Pferde%2C+Zucht%2CCRZVD%2CZuchtverband+Spezialrassen+M%C3%BCnchen%2CCriollo+Hengst+%2C+Tape+Mandinga%2CCriollo+Fohlen%2C+Verkaufspferde%2C+Caballos+Criollos%2C';
var metaContents  = 'Criollo+Zucht%2C+Criollo+Deckhengst+%2C+Tape+Mandinga%2C+Criollo+Definitivo%2CDeckstation%2C+Pferdezucht%2C+S%C3%BCdamerika%2CCriollos+Bayern%2C+Criollos+Deutschland%2CCRZVD';
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();
};

