/* [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','21122',jdecode('Home'),jdecode(''), jdecode('%2F21122.html'), 'true',[],'',''],
	['PAGE','994',jdecode('%C3%9Cber+uns'),jdecode(''), jdecode('%2F994%2Findex.html'), 'true',[ 
		['PAGE','21101',jdecode('Wer+sind+wir%3F'),jdecode(''), jdecode('%2F994%2F21101.html'), 'true',[],'',''],
		['PAGE','138201',jdecode('Konzept'),jdecode(''), jdecode('%2F994%2F138201.html'), 'true',[],'',''],
		['PAGE','177023',jdecode('Jahresbericht'),jdecode(''), jdecode('%2F994%2F177023.html'), 'true',[],'','']
	],'',''],
	['PAGE','5501',jdecode('Aktuell'),jdecode(''), jdecode('%2F5501%2Findex.html'), 'true',[ 
		['PAGE','193467',jdecode('Staatsbeitragsgesetz'),jdecode(''), jdecode('%2F5501%2F193467.html'), 'true',[],'',''],
		['PAGE','190345',jdecode('News'),jdecode(''), jdecode('%2F5501%2F190345.html'), 'true',[],'',''],
		['PAGE','161512',jdecode('zu+vermieten'),jdecode(''), jdecode('%2F5501%2F161512.html'), 'true',[],'',''],
		['PAGE','188423',jdecode('schappo'),jdecode(''), jdecode('%2F5501%2F188423.html'), 'true',[],'','']
	],'',''],
	['PAGE','973',jdecode('Mitglieder'),jdecode(''), jdecode('%2F973%2Findex.html'), 'true',[ 
		['PAGE','5543',jdecode('Statuten'),jdecode(''), jdecode('%2F973%2F5543.html'), 'true',[],'',''],
		['PAGE','199789',jdecode('Mitglieder+%C3%BCber+die+GI-Basel'),jdecode(''), jdecode('%2F973%2F199789.html'), 'true',[],'','']
	],'',''],
	['PAGE','164612',jdecode('Mitglied+werden'),jdecode(''), jdecode('%2F164612.html'), 'true',[],'',''],
	['PAGE','192767',jdecode('Newsletter+GI-Basel'),jdecode(''), jdecode('%2F192767.html'), 'true',[],'',''],
	['PAGE','177623',jdecode('Veranstaltungen'),jdecode(''), jdecode('%2F177623%2Findex.html'), 'true',[ 
		['PAGE','177644',jdecode('GI-Basel+aktuell'),jdecode(''), jdecode('%2F177623%2F177644.html'), 'true',[],'',''],
		['PAGE','177665',jdecode('Mitglieder-Anl%C3%A4sse'),jdecode(''), jdecode('%2F177623%2F177665.html'), 'true',[],'',''],
		['PAGE','93801',jdecode('Anlass+publizieren'),jdecode(''), jdecode('%2F177623%2F93801.html'), 'true',[],'',''],
		['PAGE','177707',jdecode('Bisherige+Anl%C3%A4sse'),jdecode(''), jdecode('%2F177623%2F177707.html'), 'true',[],'','']
	],'',''],
	['PAGE','148433',jdecode('Medien'),jdecode(''), jdecode('%2F148433%2Findex.html'), 'true',[ 
		['PAGE','161012',jdecode('Medienecho'),jdecode(''), jdecode('%2F148433%2F161012.html'), 'true',[],'','']
	],'',''],
	['PAGE','123301',jdecode('Archiv'),jdecode(''), jdecode('%2F123301%2Findex.html'), 'true',[ 
		['PAGE','149412',jdecode('Geschichte'),jdecode(''), jdecode('%2F123301%2F149412.html'), 'true',[],'',''],
		['PAGE','135601',jdecode('Veranstaltung+10'),jdecode(''), jdecode('%2F123301%2F135601.html'), 'true',[],'',''],
		['PAGE','5564',jdecode('Jahresberichte'),jdecode(''), jdecode('%2F123301%2F5564.html'), 'true',[],'',''],
		['PAGE','119601',jdecode('Veranstaltungen+09'),jdecode(''), jdecode('%2F123301%2F119601.html'), 'true',[],'',''],
		['PAGE','114001',jdecode('Veranstaltungen+08'),jdecode(''), jdecode('%2F123301%2F114001.html'), 'true',[],'',''],
		['PAGE','5522',jdecode('Veranstaltungen+07'),jdecode(''), jdecode('%2F123301%2F5522.html'), 'true',[],'',''],
		['PAGE','107201',jdecode('Dokumente'),jdecode(''), jdecode('%2F123301%2F107201.html'), 'true',[],'','']
	],'',''],
	['PAGE','5606',jdecode('Kontakt'),jdecode(''), jdecode('%2F5606.html'), 'true',[],'','']];
var siteelementCount=31;
theSitetree.topTemplateName='Borders';
theSitetree.paletteFamily='CECEA9';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10571';
theSitetree.graphicsetId='10772';
theSitetree.contentColor='692643';
theSitetree.contentBGColor='F3F9FC';
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: 			'Borders',
				paletteFamily: 	'CECEA9',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10571',
				graphicsetId: 	'10772',
				contentColor: 	'692643',
				contentBGColor: 'F3F9FC',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '21122',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-23']={
webappId:    '7008',
documentId:  '5606',
internalId:  '23',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-24']={
webappId:    '7008',
documentId:  '93801',
internalId:  '24',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138201',
internalId:  '',
customField: '20110804-095447'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '188423',
internalId:  '-',
customField: '20111102-125327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21122',
internalId:  '',
customField: '20120126-151352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20111116-091822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20120105-091341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20111201-113250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20111214-132416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93801',
internalId:  '',
customField: '20110908-110011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119601',
internalId:  '',
customField: '20091215-073009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114001',
internalId:  '',
customField: '20080514-155743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5522',
internalId:  '',
customField: '20090129-084259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107201',
internalId:  '',
customField: '20091022-081819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5543',
internalId:  '',
customField: '20110616-000420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5564',
internalId:  '',
customField: '20110901-104630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5606',
internalId:  '',
customField: '20111214-133142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '164612',
internalId:  '',
customField: '20111117-100804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135601',
internalId:  '',
customField: '20110302-080921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123301',
internalId:  '',
customField: '20111117-100105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '177623',
internalId:  '',
customField: '20111116-090640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '177023',
internalId:  '',
customField: '20110905-095027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161512',
internalId:  '',
customField: '20111109-162519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148433',
internalId:  '',
customField: '20120112-093332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161012',
internalId:  '',
customField: '20120126-100710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149412',
internalId:  '',
customField: '20110905-102611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '177644',
internalId:  '',
customField: '20120112-110534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '177665',
internalId:  '',
customField: '20120112-105414'
};
webappMappings['1501']=webappMappings['1501-18566074']={
webappId:    '1501',
documentId:  '21122',
internalId:  '18566074',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '177707',
internalId:  '',
customField: '20120112-105506'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '190345',
internalId:  '-',
customField: '20111214-132622'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '192767',
internalId:  '-',
customField: '20111214-133036'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '193467',
internalId:  '-',
customField: '20120126-100353'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '199789',
internalId:  '-',
customField: '20120126-151800'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2LFH';
var companyName   = 'GI-BASEL+-++Gemeinn%C3%BCtzige+Institutionen+Basel';
var htmlTitle	  = 'IGGBS';
var metaKeywords  = '';
var metaContents  = '';
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();
};

