/* [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','401',jdecode('Home'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','33701',jdecode('Christlicher+Glaube'),jdecode(''), jdecode('%2F33701.html'), 'true',[],'',''],
	['PAGE','25301',jdecode('Aktuell'),jdecode(''), jdecode('%2F25301.html'), 'true',[],'',''],
	['PAGE','6001',jdecode('Politische+Positionen'),jdecode(''), jdecode('%2F6001.html'), 'true',[],'',''],
	['PAGE','8001',jdecode('Kompetenzen'),jdecode(''), jdecode('%2F8001.html'), 'true',[],'',''],
	['PAGE','29701',jdecode('Parolen'),jdecode(''), jdecode('%2F29701.html'), 'true',[],'',''],
	['PAGE','7101',jdecode('Links'),jdecode(''), jdecode('%2F7101.html'), 'true',[],'',''],
	['PAGE','4906',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F4906.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Fellow';
theSitetree.paletteFamily='003C73';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10637';
theSitetree.graphicsetId='10691';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2QE'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Fellow',
				paletteFamily: 	'003C73',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10637',
				graphicsetId: 	'10691',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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['1002']=webappMappings['1002-4906abw0x0inewe1']={
webappId:    '1002',
documentId:  '4906',
internalId:  '4906abw0x0inewe1',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20120105-162946'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29701',
internalId:  '',
customField: '20120129-160801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20120105-163323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20120105-163411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20111203-123543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4906',
internalId:  '',
customField: '20080812-200319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25301',
internalId:  '',
customField: '20090303-230428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33701',
internalId:  '',
customField: '20120105-163120'
};
webappMappings['7050']=webappMappings['7050-472']={
webappId:    '7050',
documentId:  '25301',
internalId:  '472',
customField: 'language:de;country:CH;'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INEWE1';
var companyName   = '';
var htmlTitle	  = 'Lukas+R.+Michel';
var metaKeywords  = 'Lukas+R.+Michel%2C+EDU+BS%2C+Eidgen%EF%BF%BDssisch-Demokratische+Union+Kanton+Basel-Stadt%2C+Christlich%2C+Evangelisch%2C+Konservativ%2C+Bibeltreu%2C+Biblisch%2C+Politik%2C+Basel%2C+Schweiz%2C+Werte%2C+Ehe%2C+Familie%2C+Kinder%2C+Jesus+Christus%2C+Abtreibung%2C+Homosexualit%EF%BF%BDt%2C+Wahlen%2C+Wahl%2C+Nationalrat%2C+Grosser+Rat%2C+Grossrat%2C+Gro%EF%BF%BDer+Rat%2C+Regierungsrat%2C+Grossratswahlen%2C+Regierungsratswahlen%2C+Gesamterneuerungswahlen%2C+Parlamentswahlen';
var metaContents  = 'Vorstellung+der+politischen+Ziele%2C+T%EF%BF%BDtigkeiten+und+Person+von+Lukas+R.+Michel+%28EDU+Basel-Stadt%29';
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();
};

