/* [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','84762',jdecode('Startseite'),jdecode(''), jdecode('%2F84762.html'), 'true',[],'',''],
	['PAGE','4517',jdecode('Der+Nymphensittich'),jdecode(''), jdecode('%2F4517.html'), 'true',[],'',''],
	['PAGE','115201',jdecode('Modellrennsport'),jdecode(''), jdecode('%2F115201.html'), 'true',[],'',''],
	['PAGE','4574',jdecode('Nymphensittiche+2011'),jdecode(''), jdecode('%2F4574.html'), 'true',[],'',''],
	['PAGE','86086',jdecode('Wellensittich'),jdecode(''), jdecode('%2F86086.html'), 'true',[],'',''],
	['PAGE','123701',jdecode('Wellensittiche+2011'),jdecode(''), jdecode('%2F123701.html'), 'true',[],'',''],
	['PAGE','41241',jdecode('+Singsittich'),jdecode(''), jdecode('%2F41241.html'), 'true',[],'',''],
	['PAGE','95201',jdecode('Unsere+Aras'),jdecode(''), jdecode('%2F95201.html'), 'true',[],'',''],
	['PAGE','4628',jdecode('Haltung+%2F+Pflege'),jdecode(''), jdecode('%2F4628.html'), 'true',[],'',''],
	['PAGE','83311',jdecode('Ern%C3%A4hrung'),jdecode(''), jdecode('%2F83311.html'), 'true',[],'',''],
	['PAGE','42441',jdecode('Zuchtanlage'),jdecode(''), jdecode('%2F42441.html'), 'true',[],'',''],
	['PAGE','82788',jdecode('Die+Zucht'),jdecode(''), jdecode('%2F82788.html'), 'true',[],'',''],
	['PAGE','4655',jdecode('F%C3%BCtterung'),jdecode(''), jdecode('%2F4655.html'), 'true',[],'',''],
	['PAGE','110901',jdecode('Unsere+Degus'),jdecode(''), jdecode('%2F110901.html'), 'true',[],'',''],
	['PAGE','118801',jdecode('Abgabetiere'),jdecode(''), jdecode('%2F118801.html'), 'true',[],'',''],
	['PAGE','83004',jdecode('News'),jdecode(''), jdecode('%2F83004.html'), 'true',[],'',''],
	['PAGE','9401',jdecode('Meine+Besten'),jdecode(''), jdecode('%2F9401.html'), 'true',[],'',''],
	['PAGE','41884',jdecode('Ausstellungen+2009'),jdecode(''), jdecode('%2F41884.html'), 'true',[],'',''],
	['PAGE','82714',jdecode('Mein+Verein'),jdecode(''), jdecode('%2F82714.html'), 'true',[],'',''],
	['PAGE','4709',jdecode('Photos+von+Haltern'),jdecode(''), jdecode('%2F4709.html'), 'true',[],'',''],
	['PAGE','4682',jdecode('Sonstiges'),jdecode(''), jdecode('%2F4682.html'), 'true',[],'',''],
	['PAGE','4601',jdecode('Links+'),jdecode(''), jdecode('%2F4601.html'), 'true',[],'',''],
	['PAGE','41268',jdecode('Kontakt+'),jdecode(''), jdecode('%2F41268.html'), 'true',[],'',''],
	['PAGE','80141',jdecode('Ihr+Weg+zu+uns'),jdecode(''), jdecode('%2F80141.html'), 'true',[],'',''],
	['PAGE','80247',jdecode('Anfahrt'),jdecode(''), jdecode('%2F80247.html'), 'true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Flat';
theSitetree.paletteFamily='669999';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16702';
theSitetree.graphicsetId='12238';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='9ABABA';
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: 			'Flat',
				paletteFamily: 	'669999',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16702',
				graphicsetId: 	'12238',
				contentColor: 	'FFFFFF',
				contentBGColor: '9ABABA',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '84762',
internalId:  '1006',
customField: '1006'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '80141',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84762',
internalId:  '',
customField: '20111031-153217'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '80247',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118801',
internalId:  '',
customField: '20111031-154427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41884',
internalId:  '',
customField: '20091012-105753'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '84762',
internalId:  '1501',
customField: '1501'
};
webappMappings['1501']=webappMappings['1501-9073886']={
webappId:    '1501',
documentId:  '84762',
internalId:  '9073886',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4517',
internalId:  '',
customField: '20070319-130652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4574',
internalId:  '',
customField: '20111031-152503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42441',
internalId:  '',
customField: '20101109-155552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82788',
internalId:  '',
customField: '20061206-114551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86086',
internalId:  '',
customField: '20110131-175342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41241',
internalId:  '',
customField: '20061008-110655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95201',
internalId:  '',
customField: '20090126-112529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83004',
internalId:  '',
customField: '20111031-152837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20090125-210806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123701',
internalId:  '',
customField: '20101227-173030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4628',
internalId:  '',
customField: '20110105-174937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20061117-173258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83311',
internalId:  '',
customField: '20061117-120350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4709',
internalId:  '',
customField: '20071213-135425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4682',
internalId:  '',
customField: '20050416-110445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20091120-081933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41268',
internalId:  '',
customField: '20070319-093938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82714',
internalId:  '',
customField: '20091012-125426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115201',
internalId:  '',
customField: '20111102-093557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80141',
internalId:  '',
customField: '20060821-135116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80247',
internalId:  '',
customField: '20060821-142636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110901',
internalId:  '',
customField: '20100821-194246'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXETF';
var companyName   = 'Nymphensittichzucht';
var htmlTitle	  = 'Nymphensittich';
var metaKeywords  = 'Nymphensittichzucht%2CNymphensittich+Weisskopf+Geperlt+Trottmann+Schecken+Zimtperlschecken+Wildfarbig+Handaufzucht+Gelbwangennymphensittich+Schweizermeister+Wellensittichzucht+wellensittich+Degu+Deguzucht+aras+ara+Zenoah+dichtungen+Deguzucht';
var metaContents  = 'Nymphensittichzucht%2CNymphensittich%2CTrottmann%2CNymphensittichverkauf+Schecken+Zimtgeperlt+Weisskopf+HandaufzuchtGelbwangennymphensittich+Schweizermeister+Wellensitttichzucht+wellensittich+Degu+Deguzucht+aras+ara+Degus+Zenoah+dichtungen+Deguzucht';
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();
};

