/* [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','1601',jdecode('Home'),jdecode(''), jdecode('%2F1601.html'), 'false',[],'',''],
	['PAGE','403101',jdecode('Baugutachter+Bayern'),jdecode(''), jdecode('%2F403101.html'), 'true',[],'',''],
	['PAGE','24701',jdecode('Kontaktinformation+'),jdecode(''), jdecode('%2F24701.html'), 'false',[],'',''],
	['PAGE','307801',jdecode('Info.+Unternehmen'),jdecode(''), jdecode('%2F307801.html'), 'false',[],'',''],
	['PAGE','71801',jdecode('Info.+Privatkunden+'),jdecode(''), jdecode('%2F71801.html'), 'false',[],'',''],
	['PAGE','8722',jdecode('Baubegleitung'),jdecode(''), jdecode('%2F8722.html'), 'false',[],'',''],
	['PAGE','278001',jdecode('Bauabnahme'),jdecode(''), jdecode('%2F278001.html'), 'false',[],'',''],
	['PAGE','4622',jdecode('Hilfe+beim+Hauskauf'),jdecode(''), jdecode('%2F4622.html'), 'false',[],'',''],
	['PAGE','4643',jdecode('Beweissicherung'),jdecode(''), jdecode('%2F4643.html'), 'false',[],'',''],
	['PAGE','2301',jdecode('Techn.+Hausverwaltung'),jdecode(''), jdecode('%2F2301.html'), 'false',[],'',''],
	['PAGE','77401',jdecode('Immobilien+-+Zertifikat'),jdecode(''), jdecode('%2F77401.html'), 'false',[],'',''],
	['PAGE','68401',jdecode('Gutachterleistungen'),jdecode(''), jdecode('%2F68401.html'), 'false',[],'',''],
	['PAGE','166601',jdecode('Planung+und+Statik'),jdecode(''), jdecode('%2F166601.html'), 'false',[],'',''],
	['PAGE','333401',jdecode('Baugutachter+Bayern'),jdecode(''), jdecode('%2F333401.html'), 'false',[],'',''],
	['PAGE','68301',jdecode('Honorar+%2F+Preise'),jdecode(''), jdecode('%2F68301.html'), 'false',[],'',''],
	['PAGE','93701',jdecode('Festpreis-Kaufberatung'),jdecode(''), jdecode('%2F93701.html'), 'false',[],'',''],
	['PAGE','78501',jdecode('Info.+Spanien'),jdecode(''), jdecode('%2F78501.html'), 'false',[],'',''],
	['PAGE','117201',jdecode('Wohnfl%C3%A4che+%2F+Aufmass'),jdecode(''), jdecode('%2F117201.html'), 'false',[],'',''],
	['PAGE','68322',jdecode('Stellenangebote'),jdecode(''), jdecode('%2F68322.html'), 'false',[],'',''],
	['PAGE','122001',jdecode('Partner+-+Seiten'),jdecode(''), jdecode('%2F122001.html'), 'false',[],'',''],
	['PAGE','382101',jdecode('Hausverwaltungen'),jdecode(''), jdecode('%2F382101.html'), 'false',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Boston';
theSitetree.paletteFamily='832A2A';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11066';
theSitetree.graphicsetId='11840';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='A34242';
var localeDef={
  language: 'de',
  country: 'DE'
};
var prodDef={
  wl_name: 'alfahosting',
  product: 'WSCSYSSSSLY0XWJH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Boston',
				paletteFamily: 	'832A2A',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11066',
				graphicsetId: 	'11840',
				contentColor: 	'FFFFFF',
				contentBGColor: 'A34242',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '166601',
internalId:  '',
customField: '20110924-113942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20110923-194034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20110520-165020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4622',
internalId:  '',
customField: '20110924-091330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4643',
internalId:  '',
customField: '20110515-105501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8722',
internalId:  '',
customField: '20110924-101755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24701',
internalId:  '',
customField: '20110929-131024'
};
webappMappings['7008']=webappMappings['7008-4912']={
webappId:    '7008',
documentId:  '24701',
internalId:  '4912',
customField: 'language:de;country:DE;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68301',
internalId:  '',
customField: '20110924-100945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68322',
internalId:  '',
customField: '20110515-105916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68401',
internalId:  '',
customField: '20110924-113840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71801',
internalId:  '',
customField: '20110924-042101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77401',
internalId:  '',
customField: '20110924-094822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78501',
internalId:  '',
customField: '20110515-105851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93701',
internalId:  '',
customField: '20110924-094749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117201',
internalId:  '',
customField: '20110515-105630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '307801',
internalId:  '',
customField: '20110515-105214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122001',
internalId:  '',
customField: '20110519-174435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '278001',
internalId:  '',
customField: '20110515-105359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '333401',
internalId:  '',
customField: '20110515-105948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '403101',
internalId:  '',
customField: '20110930-091034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '382101',
internalId:  '',
customField: '20110520-104300'
};
var webAppHostname = 'cgi-wsc.alfahosting.de:80';
var canonHostname = 'wsc.alfahosting.de';
var accountId     = 'AAHS10IN2C0F';
var companyName   = 'Baugutachter+f%C3%BCr+Sch%C3%A4den+an+Geb%C3%A4uden+in+Bayern+';
var htmlTitle	  = 'Bauen+%26+Immobilien+-+Ihr+Bausachverst%C3%A4ndiger+in+Bayern';
var metaKeywords  = 'Immobilien%2C+Erlangen%2C+Architekt%2C+Bauen%2C+Immobilien%2C+Baugutachter%2C+Immobilienmakler%2C+Beweissicherung%2C+Baumaengel%2C+immobilienkaufberatung%2C+N%C3%BCrnberg%2C+Immobilien%2C+W%C3%BCrzburg%2C+Immobilienkaufberatung%2C+Gewerbeimmobilien%2C+Neubau%2C+Umbau.';
var metaContents  = 'Als+Sachverst%C3%A4ndige+reduzieren+wir+Ihre+Kosten%2C+sch%C3%BCtzen+Sie+vor+Pfusch+am+Bau+und+vor+Kauf+von+mangelhaften+Immobilien+in+Bayern.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A';
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();
};

