/* [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','13901',jdecode('Der+Liberal+Award+2011'),jdecode(''), jdecode('%2F13901.html'), 'true',[],'',''],
	['PAGE','1492',jdecode('Der+Liberal+Award+-+Die+Idee'),jdecode(''), jdecode('%2F1492.html'), 'true',[],'',''],
	['PAGE','1519',jdecode('Die+bisherigen+Preistr%C3%A4ger'),jdecode(''), jdecode('%2F1519%2Findex.html'), 'true',[ 
		['PAGE','1546',jdecode('2000%3A+Ernst+Buschor'),jdecode(''), jdecode('%2F1519%2F1546.html'), 'true',[],'',''],
		['PAGE','1573',jdecode('2001%3A+Klaus+Schwab'),jdecode(''), jdecode('%2F1519%2F1573.html'), 'true',[],'',''],
		['PAGE','1600',jdecode('2002%3A+Roger+Schawinski'),jdecode(''), jdecode('%2F1519%2F1600.html'), 'true',[],'',''],
		['PAGE','1627',jdecode('2003%3A+Pascal+Couchepin'),jdecode(''), jdecode('%2F1519%2F1627.html'), 'true',[],'',''],
		['PAGE','1654',jdecode('2004%3A+Roger+K%C3%B6ppel'),jdecode(''), jdecode('%2F1519%2F1654.html'), 'true',[],'',''],
		['PAGE','4601',jdecode('2005%3A+Aargauer+Regierung'),jdecode(''), jdecode('%2F1519%2F4601.html'), 'true',[],'',''],
		['PAGE','10901',jdecode('2006%3A+Obwaldner+Bev%C3%B6lkerung'),jdecode(''), jdecode('%2F1519%2F10901.html'), 'true',[],'',''],
		['PAGE','7601',jdecode('2007%3A+Karl-Heinz+Grasser'),jdecode(''), jdecode('%2F1519%2F7601.html'), 'true',[],'',''],
		['PAGE','15401',jdecode('2008%3A+Held%2C+Kappeler%2C+J%C3%A4ger'),jdecode(''), jdecode('%2F1519%2F15401.html'), 'true',[],'',''],
		['PAGE','17101',jdecode('2009%3A+Andreas+Thiel'),jdecode(''), jdecode('%2F1519%2F17101.html'), 'true',[],'',''],
		['PAGE','19101',jdecode('2010%3A+Konrad+Hummler'),jdecode(''), jdecode('%2F1519%2F19101.html'), 'true',[],'','']
	],'',''],
	['PAGE','3528',jdecode('Liberal+Award+-+Die+Bilder'),jdecode(''), jdecode('%2F3528.html'), 'true',[],'',''],
	['PAGE','5801',jdecode('Wer+dahinter+steht'),jdecode(''), jdecode('%2F5801.html'), 'true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='D72B2B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10893';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21F'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'D72B2B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10893',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D72B2B',
				e_color: 		'D72B2B',
				f_color: 		'D72B2B',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-d1796874285a863d4e94093bc5b15265']={
webappId:    '7060',
documentId:  '3528',
internalId:  'd1796874285a863d4e94093bc5b15265',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20111203-151149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1492',
internalId:  '',
customField: '20101024-095720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1519',
internalId:  '',
customField: '20111203-153336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1546',
internalId:  '',
customField: '20050825-083302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1573',
internalId:  '',
customField: '20050825-083130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1600',
internalId:  '',
customField: '20041004-145603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1627',
internalId:  '',
customField: '20041004-145612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1654',
internalId:  '',
customField: '20050815-141429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20061029-112949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20070719-091811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20081020-211247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3528',
internalId:  '',
customField: '20041023-140056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20101024-095904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20111203-153840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17101',
internalId:  '',
customField: '20111203-153530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20111203-150230'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'Ahp010IN2NP6';
var companyName   = 'Liberal+Award';
var htmlTitle	  = 'Liberal+Award';
var metaKeywords  = 'Liberal+Jungfreisinnige+JFZH+Couchepin+K%EF%BF%BDppel+Schawinski+Schwab+Buschor+Politik';
var metaContents  = 'Liberal+Award+-+Jungfreisinniger+Preis+f%EF%BF%BDr+liberale+Pers%EF%BF%BDnlichkeiten';
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();
};

