/* [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','4593',jdecode('Home'),jdecode(''), jdecode('%2F4593.html'), 'true',[],'',''],
	['PAGE','4677',jdecode('Kursangebot'),jdecode(''), jdecode('%2F4677%2Findex.html'), 'true',[ 
		['PAGE','70910',jdecode('NEU+22.WG+ab+M%C3%A4rz+2012'),jdecode(''), jdecode('%2F4677%2F70910.html'), 'true',[],'',''],
		['PAGE','70919',jdecode('NEU+23.WG+ab+Sept.+2012'),jdecode(''), jdecode('%2F4677%2F70919.html'), 'true',[],'',''],
		['PAGE','68032',jdecode('Programm+11%2F12'),jdecode(''), jdecode('%2F4677%2F68032.html'), 'true',[],'',''],
		['PAGE','70878',jdecode('Programm+12%2F13'),jdecode(''), jdecode('%2F4677%2F70878.html'), 'true',[],'','']
	],'',''],
	['PAGE','5043',jdecode('Curricula+%2F+Kosten'),jdecode(''), jdecode('%2F5043.html'), 'true',[],'',''],
	['PAGE','20743',jdecode('Infos+zur+Zertifizierung'),jdecode(''), jdecode('%2F20743%2Findex.html'), 'true',[ 
		['PAGE','21007',jdecode('PsychologInnen'),jdecode(''), jdecode('%2F20743%2F21007.html'), 'true',[],'',''],
		['PAGE','21411',jdecode('%C3%84rztInnen'),jdecode(''), jdecode('%2F20743%2F21411.html'), 'true',[],'','']
	],'',''],
	['PAGE','5070',jdecode('Lehrtherapeuten'),jdecode(''), jdecode('%2F5070.html'), 'true',[],'',''],
	['PAGE','19800',jdecode('Wissenschaftlicher+Beirat'),jdecode(''), jdecode('%2F19800.html'), 'true',[],'',''],
	['PAGE','71280',jdecode('Kursunterlagen'),jdecode(''), jdecode('%2F71280.html'), 'true',[],'',''],
	['PAGE','19055',jdecode('Aktuelle+Infos'),jdecode(''), jdecode('%2F19055.html'), 'true',[],'',''],
	['PAGE','4758',jdecode('Kontakt'),jdecode(''), jdecode('%2F4758.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Concise';
theSitetree.paletteFamily='E11923';
theSitetree.keyvisualId='7267';
theSitetree.keyvisualName='kv_7267.jpg';
theSitetree.fontsetId='16437';
theSitetree.graphicsetId='12140';
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: 			'Concise',
				paletteFamily: 	'E11923',
				keyvisualId: 	'7267',
				keyvisualName: 	'kv_7267.jpg',
				fontsetId: 		'16437',
				graphicsetId: 	'12140',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4593',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4593',
internalId:  '',
customField: '20120208-151423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4677',
internalId:  '',
customField: '20120126-204951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71280',
internalId:  '',
customField: '20100916-153220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68032',
internalId:  '',
customField: '20101116-112322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5043',
internalId:  '',
customField: '20100307-091103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20743',
internalId:  '',
customField: '20100126-154119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21007',
internalId:  '',
customField: '20120119-202049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21411',
internalId:  '',
customField: '20120104-152839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5070',
internalId:  '',
customField: '20120131-134045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19800',
internalId:  '',
customField: '20060802-171542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4758',
internalId:  '',
customField: '20110408-111023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19055',
internalId:  '',
customField: '20110905-083017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70878',
internalId:  '',
customField: '20111201-175420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70910',
internalId:  '',
customField: '20120126-204912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70919',
internalId:  '',
customField: '20111001-211059'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHOPT0IN3OY6';
var companyName   = '++++Akademie+f%C3%BCr+Verhaltenstherapie+und+Methodenintegration';
var htmlTitle	  = 'aim+homepage';
var metaKeywords  = 'verhaltenstherapie%2C+psychotherapie%2C+weiterbildung%2C+aim%2C+psychologen%2C+%C3%A4rzte';
var metaContents  = 'verhaltenstherapie%2C+psychotherapie%2C+weiterbildung%2C+aim%2C+psychologen%2C+%C3%A4rzte';
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();
};

