/* [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','3301',jdecode('HOME'),jdecode(''),'/3301.html','true',[],'',''],
	['PAGE','3352',jdecode('PROFILE'),jdecode(''),'/3352.html','true',[],'',''],
	['PAGE','3415',jdecode('SERVICES'),jdecode(''),'/3415.html','true',[],'',''],
	['PAGE','3478',jdecode('MISSION'),jdecode(''),'/3478.html','true',[],'',''],
	['PAGE','3701',jdecode('CONTACT+'),jdecode(''),'/3701.html','true',[],'',''],
	['PAGE','15101',jdecode('DIRECTIONS'),jdecode(''),'/15101/index.html','true',[ 
		['PAGE','13301',jdecode('WITBANK'),jdecode(''),'/15101/13301.html','true',[],'',''],
		['PAGE','15001',jdecode('BETHAL'),jdecode(''),'/15101/15001.html','true',[],'','']
	],'',''],
	['PAGE','3541',jdecode('NEWS+%26+PHOTO%26%23x27%3BS'),jdecode(''),'/3541/index.html','true',[ 
		['PAGE','15701',jdecode('NEWS'),jdecode(''),'/3541/15701.html','true',[],'','']
	],'',''],
	['PAGE','15722',jdecode('PHOTO%26%23x27%3BS'),jdecode(''),'/15722/index.html','true',[ 
		['PAGE','17401',jdecode('OFFICES'),jdecode(''),'/15722/17401.html','true',[],'',''],
		['PAGE','17422',jdecode('MASCOT%26%23x27%3BS'),jdecode(''),'/15722/17422.html','true',[],'',''],
		['PAGE','17443',jdecode('TRACK+N4'),jdecode(''),'/15722/17443.html','true',[],'','']
	],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Seifenblase';
theSitetree.paletteFamily='FF9B5E';
theSitetree.keyvisualId='2346';
theSitetree.keyvisualName='aerzte4.jpg';
theSitetree.fontsetId='381';
theSitetree.graphicsetId='430';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Seifenblase',
				paletteFamily: 	'FF9B5E',
				keyvisualId: 	'2346',
				keyvisualName: 	'aerzte4.jpg',
				fontsetId: 		'381',
				graphicsetId: 	'430',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'CC3300',
				e_color: 		'FF3300',
				f_color: 		'FF9966',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20100624-185039'
};
webappMappings['7008']=webappMappings['7008-3496']={
webappId:    '7008',
documentId:  '3701',
internalId:  '3496',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3352',
internalId:  '',
customField: '20100625-122827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3415',
internalId:  '',
customField: '20100624-201218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3478',
internalId:  '',
customField: '20100623-204815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3701',
internalId:  '',
customField: '20100604-130157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20100628-221309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3541',
internalId:  '',
customField: '20100714-110542'
};
webappMappings['7060']=webappMappings['7060-01ca2a2a899d3f468964575c9c55ef18']={
webappId:    '7060',
documentId:  '17401',
internalId:  '01ca2a2a899d3f468964575c9c55ef18',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20100628-220458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20100628-222042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15701',
internalId:  '',
customField: '20100714-110705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15722',
internalId:  '',
customField: '20100714-112412'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-10151844']={
webappId:    '1501',
documentId:  '3301',
internalId:  '10151844',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-478b6d0627cecf1b05cfd8c2f11b5bff']={
webappId:    '7060',
documentId:  '17422',
internalId:  '478b6d0627cecf1b05cfd8c2f11b5bff',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-ddf8c218c1b146aa2328bfc07f37be85']={
webappId:    '7060',
documentId:  '17443',
internalId:  'ddf8c218c1b146aa2328bfc07f37be85',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20100715-131737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17422',
internalId:  '',
customField: '20100715-134601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17443',
internalId:  '',
customField: '20100714-125820'
};
var canonHostname = 'sitebuilder1.jnb2.host-h.net';
var accountId     = 'AHTZ10IN2J33';
var companyName   = 'IHAMSS';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};
