/* [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','4556',jdecode('Die+Lesungen'),jdecode(''),'/4556.html','true',[],'',''],
	['PAGE','32213',jdecode('Die+News'),jdecode(''),'/32213.html','true',[],'',''],
	['PAGE','4667',jdecode('Die+Biographie'),jdecode(''),'/4667.html','true',[],'',''],
	['PAGE','9242',jdecode('Die+B%C3%BCcher+%26+Texte'),jdecode(''),'/9242/index.html','true',[ 
		['PAGE','34184',jdecode('Wunderzeit'),jdecode(''),'/9242/34184.html','true',[],'',''],
		['PAGE','34211',jdecode('Der+kurze+Weg....'),jdecode(''),'/9242/34211.html','true',[],'',''],
		['PAGE','41537',jdecode('Der+blinde+Masseur'),jdecode(''),'/9242/41537.html','true',[],'',''],
		['PAGE','44867',jdecode('Zaira'),jdecode(''),'/9242/44867.html','true',[],'',''],
		['PAGE','28395',jdecode('Die+Kolumnen'),jdecode(''),'/9242/28395.html','true',[],'',''],
		['PAGE','33693',jdecode('Erich+Fried+Beitrag'),jdecode(''),'/9242/33693.html','true',[],'',''],
		['PAGE','32240',jdecode('Weitere+Texte'),jdecode(''),'/9242/32240.html','true',[],'','']
	],'',''],
	['PAGE','33114',jdecode('Die+Pressestimmen'),jdecode(''),'/33114.html','true',[],'',''],
	['PAGE','18802',jdecode('Das+G%C3%A4stebuch'),jdecode(''),'/18802/index.html','true',[ 
		['PAGE','18803',jdecode('Die+Eintr%C3%A4ge'),jdecode(''),'/18802/18803.html','false',[],'','']
	],'',''],
	['PAGE','28136',jdecode('Der+Kontakt'),jdecode(''),'/28136/index.html','true',[ 
		['PAGE','28175',jdecode('Kontakte+%28Folgeseite%29'),jdecode(''),'/28136/28175.html','false',[],'','']
	],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Speed';
theSitetree.paletteFamily='CC0000';
theSitetree.keyvisualId='2342';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='373';
theSitetree.graphicsetId='423';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='CC0000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Speed',
				paletteFamily: 	'CC0000',
				keyvisualId: 	'2342',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'373',
				graphicsetId: 	'423',
				contentColor: 	'FFFFFF',
				contentBGColor: 'CC0000',
				a_color: 		'CC0000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18802',
internalId:  '',
customField: '20080604-150910'
};
webappMappings['1002']=webappMappings['1002-18802ABW0X0INXXHJ']={
webappId:    '1002',
documentId:  '18802',
internalId:  '18802ABW0X0INXXHJ',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4556',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4556',
internalId:  '',
customField: '20090418-080255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32213',
internalId:  '',
customField: '20081211-121930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4667',
internalId:  '',
customField: '20071222-215516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9242',
internalId:  '',
customField: '20090418-080817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34184',
internalId:  '',
customField: '20040331-231026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34211',
internalId:  '',
customField: '20040407-213918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41537',
internalId:  '',
customField: '20060227-095658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44867',
internalId:  '',
customField: '20080105-213941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28395',
internalId:  '',
customField: '20040311-212858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33693',
internalId:  '',
customField: '20040311-212836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32240',
internalId:  '',
customField: '20070316-164521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33114',
internalId:  '',
customField: '20080604-150903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18803',
internalId:  '',
customField: '20040206-191325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28136',
internalId:  '',
customField: '20060208-221917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28175',
internalId:  '',
customField: '20040907-180720'
};
webappMappings['7008']=webappMappings['7008-4044']={
webappId:    '7008',
documentId:  '28136',
internalId:  '4044',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXXHJ';
var companyName   = 'Catalin+Dorian+Florescu';
var htmlTitle	  = 'Catalin+Dorian+Florescu+-+Der+Autor+und+sein+Werk';
var metaKeywords  = 'Catalin+Florescu+Catalin+Dorian+Florescu+Wunderzeit+Chamisso+F%C3%B6rderpreis+Werkjahr+der+Stadt+Z%C3%BCrich+Der+kurze+Weg+nach+Hause+Anna+Seghers+PreisPro+Helvetia+Stipendium+Hermann+Lenz+Stipendium+Buch+des+Jahres+Schiller+Stiftung+Kolumnist+Tages+Anzeiger+Kolumnist+Z%C3%BCri+Tipp+Werkjahr+des+Kantons+Z%C3%BCrich+Villa+Waldberg+Aufenthaltsstipendium+Polirom+Vrema+minunlior+Der+blinde+Masseur+Pendo+Verlag+Zaira';
var metaContents  = 'Homepage+des+Schweizer+Schriftstellers+Catalin+Dorian+Florescu%2C+wohnhaft+in+Z%C3%BCrich%2C+Autor+der+B%C3%BCcher+Wunderzeit+und+Der+kurze+Weg+nach+Hause%2C+Verfasser+verschiedener+Kolumnen+und+Beitr%C3%A4ge+zu+Anthalogien';
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();
};
