/* [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','214601',jdecode('Home'),jdecode(''),'/214601.html','true',[],'',''],
	['PAGE','1101',jdecode('%C3%9Cber+mich%2Funs'),jdecode(''),'/1101.html','true',[],'',''],
	['PAGE','282201',jdecode('News+2010'),jdecode(''),'/282201.html','true',[],'',''],
	['PAGE','325301',jdecode('Ausstellungen'),jdecode(''),'/325301.html','true',[],'',''],
	['PAGE','210501',jdecode('Peruaner-Weibchen'),jdecode(''),'/210501.html','true',[],'',''],
	['PAGE','210801',jdecode('Peruaner-B%C3%B6cke'),jdecode(''),'/210801.html','true',[],'',''],
	['PAGE','1215',jdecode('Verpaarungen+%2F+Babies'),jdecode(''),'/1215.html','true',[],'',''],
	['PAGE','215701',jdecode('Wissenswertes'),jdecode(''),'/215701.html','true',[],'',''],
	['PAGE','228401',jdecode('Ern%C3%A4hrung'),jdecode(''),'/228401.html','true',[],'',''],
	['PAGE','220301',jdecode('Aussenhaltung'),jdecode(''),'/220301.html','true',[],'',''],
	['PAGE','230801',jdecode('Schnappsch%C3%BCsse'),jdecode(''),'/230801.html','true',[],'',''],
	['PAGE','1236',jdecode('ABGABETIERE'),jdecode(''),'/1236.html','true',[],'',''],
	['PAGE','247701',jdecode('Ausgezogene+Meeris'),jdecode(''),'/247701.html','true',[],'',''],
	['PAGE','152233',jdecode('G%C3%A4stebuch+%2F+Email%2FLinks'),jdecode(''),'/152233/index.html','true',[ 
		['PAGE','152228',jdecode('Eintr%C3%A4ge'),jdecode(''),'/152233/152228.html','false',[],'','']
	],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='FFCC66';
theSitetree.keyvisualId='2055';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='281';
theSitetree.graphicsetId='343';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFCC66';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Architekt',
				paletteFamily: 	'FFCC66',
				keyvisualId: 	'2055',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'281',
				graphicsetId: 	'343',
				contentColor: 	'000000',
				contentBGColor: 'FFCC66',
				a_color: 		'FFCC66',
				b_color: 		'CC6600',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '214601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152233',
internalId:  '',
customField: '20090703-213937'
};
webappMappings['1002']=webappMappings['1002-152233abw0x0in23t6']={
webappId:    '1002',
documentId:  '152233',
internalId:  '152233abw0x0in23t6',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '214601',
internalId:  '',
customField: '20100528-140803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '247701',
internalId:  '',
customField: '20100110-223247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1236',
internalId:  '',
customField: '20100528-140248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '282201',
internalId:  '',
customField: '20100528-141911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1215',
internalId:  '',
customField: '20100110-223455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152228',
internalId:  '',
customField: '20070703-134902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '325301',
internalId:  '',
customField: '20091109-151430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20091011-191750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '210501',
internalId:  '',
customField: '20090917-183428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '210801',
internalId:  '',
customField: '20090917-180513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '215701',
internalId:  '',
customField: '20090611-162620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '228401',
internalId:  '',
customField: '20090427-175811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '220301',
internalId:  '',
customField: '20090210-113824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '230801',
internalId:  '',
customField: '20090705-213552'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN23T6';
var companyName   = 'Alina%27s+Meerschweinchenbande';
var htmlTitle	  = 'Alinas+Meerschweinchen';
var metaKeywords  = 'meerschweinchen++peruaner++';
var metaContents  = 'Peruaner+in+Vollfarben+und+in+Slateblue%2C+Weiss+und+Gold++Meerschweinchen+meerschweinchen++Alinas+Meerschweinchenbande+Alinas+Peruaner+in+Vollfarben+Meerschweinchen+in+Biberist';
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();
};
