/* [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','1646',jdecode('Home'),jdecode(''),'/1646/index.html','true',[ 
		['PAGE','13201',jdecode('Fran%C3%A7ais'),jdecode(''),'/1646/13201.html','true',[],'',''],
		['PAGE','13222',jdecode('Italiano'),jdecode(''),'/1646/13222.html','true',[],'','']
	],'',''],
	['PAGE','4101',jdecode('Projekte%2FProjets%2FProgetti'),jdecode(''),'/4101/index.html','true',[ 
		['PAGE','4801',jdecode('IPBV'),jdecode(''),'/4101/4801.html','true',[],'',''],
		['PAGE','4901',jdecode('GEMA'),jdecode(''),'/4101/4901.html','true',[],'',''],
		['PAGE','4922',jdecode('PRODESO'),jdecode(''),'/4101/4922.html','true',[],'',''],
		['PAGE','4943',jdecode('FEPROMU'),jdecode(''),'/4101/4943.html','true',[],'',''],
		['PAGE','4964',jdecode('CODEH-ICA'),jdecode(''),'/4101/4964.html','true',[],'',''],
		['PAGE','4985',jdecode('FRAUEN-BASISORGANISATION'),jdecode(''),'/4101/4985.html','true',[],'',''],
		['PAGE','5006',jdecode('L%C3%84NDLICHE+DORFSCHULEN'),jdecode(''),'/4101/5006.html','true',[],'',''],
		['PAGE','5027',jdecode('CASA+DE+SALUD'),jdecode(''),'/4101/5027.html','true',[],'','']
	],'',''],
	['PAGE','24861',jdecode('Berichte%2FRapports%2FRapporti'),jdecode(''),'/24861/index.html','true',[ 
		['PAGE','28161',jdecode('2010+Deutsch'),jdecode(''),'/24861/28161.html','true',[],'',''],
		['PAGE','24903',jdecode('2010+Fran%C3%A7ais'),jdecode(''),'/24861/24903.html','true',[],'',''],
		['PAGE','24924',jdecode('2010+Italiano'),jdecode(''),'/24861/24924.html','true',[],'','']
	],'',''],
	['PAGE','1688',jdecode('Fotos+%2F+Videos'),jdecode(''),'/1688.html','true',[],'',''],
	['PAGE','1709',jdecode('Blog+%26+News'),jdecode(''),'/1709.html','true',[],'',''],
	['PAGE','4122',jdecode('Statuten'),jdecode(''),'/4122.html','true',[],'',''],
	['PAGE','1720',jdecode('Guestbook'),jdecode(''),'/1720.html','true',[],'',''],
	['PAGE','1741',jdecode('Kontakt%2FContact%2FContatto'),jdecode(''),'/1741.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Favor';
theSitetree.paletteFamily='D2BD84';
theSitetree.keyvisualId='7367';
theSitetree.keyvisualName='kv_7367.jpg';
theSitetree.fontsetId='16471';
theSitetree.graphicsetId='12160';
theSitetree.contentColor='323232';
theSitetree.contentBGColor='F1EEDB';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Favor',
				paletteFamily: 	'D2BD84',
				keyvisualId: 	'7367',
				keyvisualName: 	'kv_7367.jpg',
				fontsetId: 		'16471',
				graphicsetId: 	'12160',
				contentColor: 	'323232',
				contentBGColor: 'F1EEDB',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-a653c4f889d04abe44c085bab1524ee1']={
webappId:    '7060',
documentId:  '1688',
internalId:  'a653c4f889d04abe44c085bab1524ee1',
customField: 'language:de;country:CH;'
};
webappMappings['7050']=webappMappings['7050-4753']={
webappId:    '7050',
documentId:  '1709',
internalId:  '4753',
customField: 'language:de;country:CH;'
};
webappMappings['7002']=webappMappings['7002-4908']={
webappId:    '7002',
documentId:  '1720',
internalId:  '4908',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-5565']={
webappId:    '7008',
documentId:  '1741',
internalId:  '5565',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1646',
internalId:  '',
customField: '20100314-170609'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1646',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1688',
internalId:  '',
customField: '20100315-190959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1709',
internalId:  '',
customField: '20100103-152226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1720',
internalId:  '',
customField: '20100315-221858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1741',
internalId:  '',
customField: '20100315-222148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4101',
internalId:  '',
customField: '20100410-150607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4122',
internalId:  '',
customField: '20100406-163451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20100410-150814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20100410-150955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4922',
internalId:  '',
customField: '20100410-151149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4943',
internalId:  '',
customField: '20100410-151550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4964',
internalId:  '',
customField: '20100314-233407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4985',
internalId:  '',
customField: '20100410-151818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5006',
internalId:  '',
customField: '20100314-233815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5027',
internalId:  '',
customField: '20100314-234313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13201',
internalId:  '',
customField: '20100314-171113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13222',
internalId:  '',
customField: '20100410-150508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24861',
internalId:  '',
customField: '20100520-184452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24903',
internalId:  '',
customField: '20100520-182821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24924',
internalId:  '',
customField: '20100618-113820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28161',
internalId:  '',
customField: '20100617-140926'
};
var canonHostname = 'wsc01.webland.ch';
var accountId     = 'AWB010IN244K';
var companyName   = 'Verein+Solidarit%C3%A4t+Schweiz-Peru%2C+Projekte+Dr.h.c.+G.+B%C3%A4rtschi';
var htmlTitle	  = 'Solidarit%C3%A4t+Schweiz-Peru%2C+Projekte+Dr.h.c.+G.+B%C3%A4rtschi+ist+online%21';
var metaKeywords  = 'solidaritaet-schweiz-peru%2C+Dr.h.c.+G.+B%C3%A4rtschi%2C+Gertrud+B%C3%A4rtschi%2C+Gertrud+Baertschi%2C+Solidarit%C3%A4t+Schweiz-Peru%2C+Solidaritaet+Schweiz-Peru+';
var metaContents  = 'Aufbauprojekte+in+st%C3%A4dtischen+Armenvierteln+und+auf+dem+Land+in+Peru.+Eine+Unterst%C3%BCtzung+zur+Selbst%C3%A4ndigkeit.';
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();
};
