/* [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','203',jdecode('Home'),jdecode(''), jdecode('%2F203.html'), 'true',[],'',''],
	['PAGE','60001',jdecode('NEWS+HAITI'),jdecode(''), jdecode('%2F60001.html'), 'true',[],'',''],
	['PAGE','9901',jdecode('News+%26+Aktuelles'),jdecode(''), jdecode('%2F9901%2Findex.html'), 'true',[ 
		['PAGE','48701',jdecode('Medien'),jdecode(''), jdecode('%2F9901%2F48701.html'), 'true',[],'','']
	],'',''],
	['PAGE','29301',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F29301%2Findex.html'), 'true',[ 
		['PAGE','29343',jdecode('Vorstand'),jdecode(''), jdecode('%2F29301%2F29343.html'), 'true',[],'','']
	],'',''],
	['PAGE','24743',jdecode('Adoption'),jdecode(''), jdecode('%2F24743%2Findex.html'), 'true',[ 
		['PAGE','24764',jdecode('Voraussetzungen+'),jdecode(''), jdecode('%2F24743%2F24764.html'), 'true',[],'',''],
		['PAGE','24785',jdecode('Verfahrensablauf'),jdecode(''), jdecode('%2F24743%2F24785.html'), 'true',[],'',''],
		['PAGE','24806',jdecode('Kosten'),jdecode(''), jdecode('%2F24743%2F24806.html'), 'true',[],'',''],
		['PAGE','31001',jdecode('Rechtliche+Bestimmungen'),jdecode(''), jdecode('%2F24743%2F31001.html'), 'true',[],'','']
	],'',''],
	['PAGE','24827',jdecode('Haiti'),jdecode(''), jdecode('%2F24827%2Findex.html'), 'true',[ 
		['PAGE','24869',jdecode('Adoption+Haiti'),jdecode(''), jdecode('%2F24827%2F24869.html'), 'true',[],'',''],
		['PAGE','43001',jdecode('Impressionen+Haiti'),jdecode(''), jdecode('%2F24827%2F43001.html'), 'true',[],'','']
	],'',''],
	['PAGE','22901',jdecode('Kontakt'),jdecode(''), jdecode('%2F22901%2Findex.html'), 'true',[ 
		['PAGE','23301',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''), jdecode('%2F22901%2F23301.html'), 'false',[],'',''],
		['PAGE','24701',jdecode('Adresse%2C+Telefon'),jdecode(''), jdecode('%2F22901%2F24701.html'), 'true',[],'','']
	],'',''],
	['PAGE','36601',jdecode('Links'),jdecode(''), jdecode('%2F36601.html'), 'true',[],'',''],
	['PAGE','64001',jdecode('Adoptivelterntreffen+2010'),jdecode(''), jdecode('%2F64001.html'), 'true',[],'',''],
	['PAGE','73201',jdecode('Adoptivelterntreffen+2011'),jdecode(''), jdecode('%2F73201.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Inspiration';
theSitetree.paletteFamily='A99797';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='100';
theSitetree.graphicsetId='125';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='A99797';
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: 			'Inspiration',
				paletteFamily: 	'A99797',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'100',
				graphicsetId: 	'125',
				contentColor: 	'FFFFFF',
				contentBGColor: 'A99797',
				a_color: 		'A99797',
				b_color: 		'C5BAB6',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20110303-202741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '203',
internalId:  '',
customField: '20110303-202833'
};
webappMappings['7060']=webappMappings['7060-cc0fbfcb036d34cd5041fa5f77cbd1f8']={
webappId:    '7060',
documentId:  '43001',
internalId:  'cc0fbfcb036d34cd5041fa5f77cbd1f8',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '203',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-2351']={
webappId:    '7008',
documentId:  '22901',
internalId:  '2351',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48701',
internalId:  '',
customField: '20070320-201543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20070320-200059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29343',
internalId:  '',
customField: '20100218-074353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24743',
internalId:  '',
customField: '20070103-114541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24764',
internalId:  '',
customField: '20110303-202121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24785',
internalId:  '',
customField: '20070103-204049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24806',
internalId:  '',
customField: '20100601-191902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31001',
internalId:  '',
customField: '20070103-104254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24827',
internalId:  '',
customField: '20080529-143548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24869',
internalId:  '',
customField: '20080529-144652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43001',
internalId:  '',
customField: '20070103-204534'
};
webappMappings['7060']=webappMappings['7060-8d6fcfa163df2ad5c3d6ba324b01df5b']={
webappId:    '7060',
documentId:  '73201',
internalId:  '8d6fcfa163df2ad5c3d6ba324b01df5b',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73201',
internalId:  '',
customField: '20120106-154610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22901',
internalId:  '',
customField: '20061205-080728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23301',
internalId:  '',
customField: '20061012-135456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24701',
internalId:  '',
customField: '20100218-074139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36601',
internalId:  '',
customField: '20070109-203704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60001',
internalId:  '',
customField: '20100713-194844'
};
webappMappings['7060']=webappMappings['7060-a77bd4d46b0219a79fb864d174338bc3']={
webappId:    '7060',
documentId:  '64001',
internalId:  'a77bd4d46b0219a79fb864d174338bc3',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64001',
internalId:  '',
customField: '20120102-151908'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'Ahp010INEU16';
var companyName   = 'T+I+M+O+U+N+-+enfants+et+parents';
var htmlTitle	  = 'timoun+-+enfants+et+parents';
var metaKeywords  = 'Adoption++Haiti++Burkina+Faso++Adoptionsvermittlungsstelle++Schweiz+Auslandsadoption+internationale+Adoption';
var metaContents  = 'Adoption++Haiti++Burkina+Faso++Adoptionsvermittlungsstelle++Schweiz+Auslandsadoption+internationale+Adoption';
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();
};

