/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','4922',jdecode('Aktuelles+%2B+Allerlei'),jdecode(''), jdecode('%2F4922.html'), 'true',[],'',''],
	['PAGE','4943',jdecode('Kameliden'),jdecode(''), jdecode('%2F4943%2Findex.html'), 'true',[ 
		['PAGE','4964',jdecode('Neuweltkameliden'),jdecode(''), jdecode('%2F4943%2F4964.html'), 'true',[],'',''],
		['PAGE','4985',jdecode('Domestikation'),jdecode(''), jdecode('%2F4943%2F4985.html'), 'true',[],'','']
	],'',''],
	['PAGE','5006',jdecode('Alpakas'),jdecode(''), jdecode('%2F5006.html'), 'true',[],'',''],
	['PAGE','5069',jdecode('Huacaya-Alpaka'),jdecode(''), jdecode('%2F5069%2Findex.html'), 'true',[ 
		['PAGE','5111',jdecode('Verhalten'),jdecode(''), jdecode('%2F5069%2F5111.html'), 'true',[],'',''],
		['PAGE','102401',jdecode('...und+spucken+sie%3F'),jdecode(''), jdecode('%2F5069%2F102401.html'), 'true',[],'',''],
		['PAGE','102422',jdecode('Gr%C3%B6sse+und+Gewicht'),jdecode(''), jdecode('%2F5069%2F102422.html'), 'true',[],'',''],
		['PAGE','102443',jdecode('K%C3%B6rperbau'),jdecode(''), jdecode('%2F5069%2F102443.html'), 'true',[],'',''],
		['PAGE','102464',jdecode('Fundament'),jdecode(''), jdecode('%2F5069%2F102464.html'), 'true',[],'',''],
		['PAGE','102485',jdecode('Kopf+und+Ohren'),jdecode(''), jdecode('%2F5069%2F102485.html'), 'true',[],'',''],
		['PAGE','102506',jdecode('Augen'),jdecode(''), jdecode('%2F5069%2F102506.html'), 'true',[],'',''],
		['PAGE','102527',jdecode('Gebiss'),jdecode(''), jdecode('%2F5069%2F102527.html'), 'true',[],'',''],
		['PAGE','102548',jdecode('Verdauungsapparat'),jdecode(''), jdecode('%2F5069%2F102548.html'), 'true',[],'',''],
		['PAGE','102569',jdecode('Faser'),jdecode(''), jdecode('%2F5069%2F102569.html'), 'true',[],'',''],
		['PAGE','102590',jdecode('Vlies-Farben'),jdecode(''), jdecode('%2F5069%2F102590.html'), 'true',[],'',''],
		['PAGE','102611',jdecode('Lebenserwartung'),jdecode(''), jdecode('%2F5069%2F102611.html'), 'true',[],'',''],
		['PAGE','102632',jdecode('Trekking'),jdecode(''), jdecode('%2F5069%2F102632.html'), 'true',[],'','']
	],'',''],
	['PAGE','114801',jdecode('NEU%3A+Tr%C3%A4chtigkeit'),jdecode(''), jdecode('%2F114801.html'), 'true',[],'',''],
	['PAGE','55901',jdecode('Die+Alpaka-Geburt'),jdecode(''), jdecode('%2F55901.html'), 'true',[],'',''],
	['PAGE','97401',jdecode('Die+Alpaka-Faser+'),jdecode(''), jdecode('%2F97401%2Findex.html'), 'true',[ 
		['PAGE','97422',jdecode('Themen%C3%BCbersicht'),jdecode(''), jdecode('%2F97401%2F97422.html'), 'true',[],'',''],
		['PAGE','97443',jdecode('Wissenswertes'),jdecode(''), jdecode('%2F97401%2F97443.html'), 'true',[],'',''],
		['PAGE','97464',jdecode('Stammtier+Vikunja'),jdecode(''), jdecode('%2F97401%2F97464.html'), 'true',[],'',''],
		['PAGE','97485',jdecode('Haar+-+keine+Wolle'),jdecode(''), jdecode('%2F97401%2F97485.html'), 'true',[],'',''],
		['PAGE','97506',jdecode('Unterschied+zur+Wolle'),jdecode(''), jdecode('%2F97401%2F97506.html'), 'true',[],'',''],
		['PAGE','97527',jdecode('Einfl%C3%BCsse+auf+Qualit%C3%A4t'),jdecode(''), jdecode('%2F97401%2F97527.html'), 'true',[],'',''],
		['PAGE','97548',jdecode('Faser%2C+Vlies%2C+Behang'),jdecode(''), jdecode('%2F97401%2F97548.html'), 'true',[],'',''],
		['PAGE','97569',jdecode('Labormessung+Faser'),jdecode(''), jdecode('%2F97401%2F97569.html'), 'true',[],'',''],
		['PAGE','100001',jdecode('Wichtigste+Messwerte'),jdecode(''), jdecode('%2F97401%2F100001.html'), 'true',[],'',''],
		['PAGE','101201',jdecode('Weitere+Werte%2FFaszit'),jdecode(''), jdecode('%2F97401%2F101201.html'), 'true',[],'','']
	],'',''],
	['PAGE','5132',jdecode('Haltung'),jdecode(''), jdecode('%2F5132%2Findex.html'), 'true',[ 
		['PAGE','5153',jdecode('Herde'),jdecode(''), jdecode('%2F5132%2F5153.html'), 'true',[],'',''],
		['PAGE','5174',jdecode('Organisation+Betrieb'),jdecode(''), jdecode('%2F5132%2F5174.html'), 'true',[],'',''],
		['PAGE','5195',jdecode('Unterstand'),jdecode(''), jdecode('%2F5132%2F5195.html'), 'true',[],'',''],
		['PAGE','54201',jdecode('Kotplatz'),jdecode(''), jdecode('%2F5132%2F54201.html'), 'true',[],'',''],
		['PAGE','5216',jdecode('Weide%2FZ%C3%A4une'),jdecode(''), jdecode('%2F5132%2F5216.html'), 'true',[],'',''],
		['PAGE','5237',jdecode('F%C3%BCtterung'),jdecode(''), jdecode('%2F5132%2F5237.html'), 'true',[],'',''],
		['PAGE','5258',jdecode('Pflege'),jdecode(''), jdecode('%2F5132%2F5258.html'), 'true',[],'',''],
		['PAGE','5279',jdecode('Gesundheit%2FParasiten'),jdecode(''), jdecode('%2F5132%2F5279.html'), 'true',[],'',''],
		['PAGE','5300',jdecode('Zucht'),jdecode(''), jdecode('%2F5132%2F5300.html'), 'true',[],'',''],
		['PAGE','5321',jdecode('verschiedene+Tierarten'),jdecode(''), jdecode('%2F5132%2F5321.html'), 'true',[],'','']
	],'',''],
	['PAGE','5342',jdecode('Alpakas+vom+Ahornberg'),jdecode(''), jdecode('%2F5342%2Findex.html'), 'true',[ 
		['PAGE','5363',jdecode('Zucht-Stuten'),jdecode(''), jdecode('%2F5342%2F5363.html'), 'true',[],'',''],
		['PAGE','5384',jdecode('angehende+Zucht-Stuten'),jdecode(''), jdecode('%2F5342%2F5384.html'), 'true',[],'',''],
		['PAGE','5405',jdecode('Jungstuten'),jdecode(''), jdecode('%2F5342%2F5405.html'), 'true',[],'',''],
		['PAGE','5426',jdecode('Zucht-Hengste'),jdecode(''), jdecode('%2F5342%2F5426.html'), 'true',[],'',''],
		['PAGE','5468',jdecode('Junghengste'),jdecode(''), jdecode('%2F5342%2F5468.html'), 'true',[],'','']
	],'',''],
	['PAGE','5510',jdecode('Verkauf+Alpakas'),jdecode(''), jdecode('%2F5510%2Findex.html'), 'true',[ 
		['PAGE','33901',jdecode('Alpaka-Stuten'),jdecode(''), jdecode('%2F5510%2F33901.html'), 'true',[],'',''],
		['PAGE','33922',jdecode('Alpaka-Hengste'),jdecode(''), jdecode('%2F5510%2F33922.html'), 'true',[],'','']
	],'',''],
	['PAGE','48701',jdecode('Kontakt'),jdecode(''), jdecode('%2F48701.html'), 'true',[],'','']];
var siteelementCount=54;
theSitetree.topTemplateName='Galerie';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='75';
theSitetree.graphicsetId='80';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='D0D5DB';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Galerie',
				paletteFamily: 	'660000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'75',
				graphicsetId: 	'80',
				contentColor: 	'000066',
				contentBGColor: 'D0D5DB',
				a_color: 		'660000',
				b_color: 		'CCCC99',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20111021-200637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5132',
internalId:  '',
customField: '20091207-154331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5153',
internalId:  '',
customField: '20091207-155006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5174',
internalId:  '',
customField: '20091207-155105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5195',
internalId:  '',
customField: '20091207-155350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5216',
internalId:  '',
customField: '20091207-155748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5237',
internalId:  '',
customField: '20091207-160006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5258',
internalId:  '',
customField: '20110420-195715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5279',
internalId:  '',
customField: '20091207-160047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5300',
internalId:  '',
customField: '20110522-195248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5321',
internalId:  '',
customField: '20091207-160619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5342',
internalId:  '',
customField: '20091207-161118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5363',
internalId:  '',
customField: '20111021-201018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5006',
internalId:  '',
customField: '20110421-112253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5069',
internalId:  '',
customField: '20100404-200627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5111',
internalId:  '',
customField: '20100404-180417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5384',
internalId:  '',
customField: '20110502-190521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5405',
internalId:  '',
customField: '20110423-115555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5426',
internalId:  '',
customField: '20110626-202745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4943',
internalId:  '',
customField: '20091202-210804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4964',
internalId:  '',
customField: '20090202-114443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4985',
internalId:  '',
customField: '20091207-152112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114801',
internalId:  '',
customField: '20110522-213756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5468',
internalId:  '',
customField: '20110424-122524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97401',
internalId:  '',
customField: '20110522-215520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4922',
internalId:  '',
customField: '20111021-201648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5510',
internalId:  '',
customField: '20110423-130052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33901',
internalId:  '',
customField: '20110731-193636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33922',
internalId:  '',
customField: '20111021-201323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48701',
internalId:  '',
customField: '20110422-222513'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-1289']={
webappId:    '7008',
documentId:  '48701',
internalId:  '1289',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54201',
internalId:  '',
customField: '20091206-211203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55901',
internalId:  '',
customField: '20110420-191332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97443',
internalId:  '',
customField: '20100327-194939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97422',
internalId:  '',
customField: '20100324-150427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97464',
internalId:  '',
customField: '20100324-151013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97485',
internalId:  '',
customField: '20100321-173045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97506',
internalId:  '',
customField: '20100324-151126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97527',
internalId:  '',
customField: '20100324-151502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97548',
internalId:  '',
customField: '20100324-151548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97569',
internalId:  '',
customField: '20110420-195058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100001',
internalId:  '',
customField: '20100324-152600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101201',
internalId:  '',
customField: '20110420-195319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102401',
internalId:  '',
customField: '20100404-195412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102422',
internalId:  '',
customField: '20110424-120417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102443',
internalId:  '',
customField: '20100404-195753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102464',
internalId:  '',
customField: '20100404-173024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102485',
internalId:  '',
customField: '20100404-195917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102506',
internalId:  '',
customField: '20100404-174203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102527',
internalId:  '',
customField: '20100404-174831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102548',
internalId:  '',
customField: '20100404-200026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102569',
internalId:  '',
customField: '20100404-175256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102590',
internalId:  '',
customField: '20100404-175627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102611',
internalId:  '',
customField: '20100404-175925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102632',
internalId:  '',
customField: '20100404-180338'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW1X0INENLO';
var companyName   = 'Alpakas+vom+Ahornberg';
var htmlTitle	  = 'Alpakas+vom+Ahornberg';
var metaKeywords  = 'Alpaka%2C+Alpakas%2C+Alpaca%2C+Huacaya%2C+Huacaya-Alpaka%2C+Alpaka-Stute%2C+Alpaka-Hengst%2C+Neuweltkameliden%2C+Kameliden%2C++Alpakas+vom+Ahornberg%2C+AvA%2C+Alpakazucht%2C+Ahornberg%2C+Lauerz%2C+%0D%0AAlpaka-Faser%2C+Alpaka-Wolle%2C+Alpaka-Geburt';
var metaContents  = 'Die+kleine+aber+feine+Huacaya-Alpakazucht+mit+Erfahrung+seit+1992';
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();
};

