/* [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','4596',jdecode('Home%2FTextproben'),jdecode(''),'/4596.html','true',[],'',''],
	['PAGE','4761',jdecode('Bestellen%2FAGB'),jdecode(''),'/4761/index.html','true',[ 
		['PAGE','517791',jdecode('Bestellen%2FAGB+%28Folgeseite%29'),jdecode(''),'/4761/517791.html','false',[],'','']
	],'',''],
	['PAGE','4680',jdecode('Aktuelles+Produkt'),jdecode(''),'/4680.html','true',[],'',''],
	['PAGE','4653',jdecode('Islamistische+News'),jdecode(''),'/4653.html','true',[],'',''],
	['PAGE','107119',jdecode('Kleinstein-News***'),jdecode(''),'/107119.html','true',[],'',''],
	['PAGE','4734',jdecode('***Terrorismus'),jdecode(''),'/4734.html','true',[],'',''],
	['PAGE','108919',jdecode('***Bad+News'),jdecode(''),'/108919.html','true',[],'',''],
	['PAGE','109165',jdecode('***God+News'),jdecode(''),'/109165.html','true',[],'',''],
	['PAGE','109919',jdecode('***Gedichte'),jdecode(''),'/109919.html','true',[],'',''],
	['PAGE','115722',jdecode('***%22Weisheiten%22'),jdecode(''),'/115722.html','true',[],'',''],
	['PAGE','142219',jdecode('***Hiob+und+andere'),jdecode(''),'/142219/index.html','true',[ 
		['PAGE','280348',jdecode('God+News+%28Folgeseite%29'),jdecode(''),'/142219/280348.html','false',[],'','']
	],'',''],
	['PAGE','4707',jdecode('***Autoren'),jdecode(''),'/4707.html','true',[],'',''],
	['PAGE','528291',jdecode('G%C3%A4stebuch'),jdecode(''),'/528291.html','true',[],'',''],
	['PAGE','528290',jdecode('Eintr%C3%A4ge'),jdecode(''),'/528290.html','false',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Sportive';
theSitetree.paletteFamily='E9EEF4';
theSitetree.keyvisualId='2659';
theSitetree.keyvisualName='auto2.jpg';
theSitetree.fontsetId='221';
theSitetree.graphicsetId='262';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='E9EEF4';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Sportive',
				paletteFamily: 	'E9EEF4',
				keyvisualId: 	'2659',
				keyvisualName: 	'auto2.jpg',
				fontsetId: 		'221',
				graphicsetId: 	'262',
				contentColor: 	'000066',
				contentBGColor: 'E9EEF4',
				a_color: 		'E9EEF4',
				b_color: 		'C1C4D3',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4653',
internalId:  '',
customField: '20100218-194458'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4596',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4761',
internalId:  '',
customField: '20080916-130346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '517791',
internalId:  '',
customField: '20070402-104311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4680',
internalId:  '',
customField: '20080415-201026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4596',
internalId:  '',
customField: '20100218-193845'
};
webappMappings['1002']=webappMappings['1002-528291abw0x0inxsz9']={
webappId:    '1002',
documentId:  '528291',
internalId:  '528291abw0x0inxsz9',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107119',
internalId:  '',
customField: '20090209-220704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4734',
internalId:  '',
customField: '20100108-204325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108919',
internalId:  '',
customField: '20100216-175429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109165',
internalId:  '',
customField: '20091229-101413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109919',
internalId:  '',
customField: '20080123-075253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115722',
internalId:  '',
customField: '20100218-200007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142219',
internalId:  '',
customField: '20100209-212720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '280348',
internalId:  '',
customField: '20070212-064925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4707',
internalId:  '',
customField: '20090106-190416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '528291',
internalId:  '',
customField: '20091108-102950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '528290',
internalId:  '',
customField: '20070819-132525'
};
webappMappings['7008']=webappMappings['7008-2742']={
webappId:    '7008',
documentId:  '4761',
internalId:  '2742',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXSZ9';
var companyName   = 'AARON-Edition+Bern+%28Schweiz%29';
var htmlTitle	  = 'Im+Fegefeuer%2C+ISBN+3-033-00308-7%2C+S.+Entlebucher%2C+AARON-Edition+Bern%3A+alternatives+Lesevergn%C3%BCgen...';
var metaKeywords  = 'die+buchneuheit+des+monats+bucherstling+bestseller+isbn+3-033-00308-7+aaron-edition+aaronedition+kaum+aufgelegt+schon+vergriffen+entlebucher+simon+kephas+petros+kleinstein+im+fegefeuer+lass+den+barabbas+frei+verfr%C3%BChte+angst+vor+dem+sterben+am+11+november+1982+als+l%C3%B6wensohn+breschnew+starb+eine+feuerbrunst+und+ein+unn%C3%B6tiges+opfer+einmal+zu+viel+gefurzt+furz+ein+pr%C3%A4chtiges+leben';
var metaContents  = 'Homepage+des+Vereins+AARON-Edition%2C+Postfach%2C+CH-3004+Bern.+Aktuell+zu+verkaufender+Titel%3A+Im+Fegefeuer%2C+ISBN+3-033-00308-7%2C+von+Simon+Entlebucher+%28Co-Autor%3A+Kephas+Petros+Kleinstein%29.+Ausgabedatum%3A+Dezember+2004.+Preis.+CHF+23.--+bzw.+EURO+15.--+plus+Versandkosten.';
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();
};
