/* [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','1801',jdecode('Home'),jdecode(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','69701',jdecode('Neu+und+aktuell'),jdecode(''), jdecode('%2F69701.html'), 'true',[],'',''],
	['PAGE','83123',jdecode('Agenda'),jdecode(''), jdecode('%2F83123.html'), 'true',[],'',''],
	['PAGE','1852',jdecode('Angebote'),jdecode(''), jdecode('%2F1852%2Findex.html'), 'true',[ 
		['PAGE','65001',jdecode('Messungen+und+Analysen'),jdecode(''), jdecode('%2F1852%2F65001.html'), 'true',[],'',''],
		['PAGE','65043',jdecode('Beratung+und+Therapien'),jdecode(''), jdecode('%2F1852%2F65043.html'), 'true',[],'',''],
		['PAGE','65064',jdecode('Mietartikel'),jdecode(''), jdecode('%2F1852%2F65064.html'), 'true',[],'','']
	],'',''],
	['PAGE','73801',jdecode('Ratgeber'),jdecode(''), jdecode('%2F73801.html'), 'true',[],'',''],
	['PAGE','1873',jdecode('Hauslieferservice'),jdecode(''), jdecode('%2F1873.html'), 'true',[],'',''],
	['PAGE','65085',jdecode('Im+Notfall'),jdecode(''), jdecode('%2F65085.html'), 'true',[],'',''],
	['PAGE','1957',jdecode('%C3%9Cber+uns'),jdecode(''), jdecode('%2F1957%2Findex.html'), 'true',[ 
		['PAGE','1999',jdecode('Unser+Team'),jdecode(''), jdecode('%2F1957%2F1999.html'), 'true',[],'',''],
		['PAGE','1978',jdecode('Leitbild'),jdecode(''), jdecode('%2F1957%2F1978.html'), 'true',[],'',''],
		['PAGE','65106',jdecode('Standort'),jdecode(''), jdecode('%2F1957%2F65106.html'), 'true',[],'','']
	],'',''],
	['PAGE','2041',jdecode('Kontakt'),jdecode(''), jdecode('%2F2041.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Valiant';
theSitetree.paletteFamily='25882F';
theSitetree.keyvisualId='9820';
theSitetree.keyvisualName='kv_9820.jpg';
theSitetree.fontsetId='17626';
theSitetree.graphicsetId='13033';
theSitetree.contentColor='646464';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Valiant',
				paletteFamily: 	'25882F',
				keyvisualId: 	'9820',
				keyvisualName: 	'kv_9820.jpg',
				fontsetId: 		'17626',
				graphicsetId: 	'13033',
				contentColor: 	'646464',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20120202-211055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20110221-154933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1957',
internalId:  '',
customField: '20120128-100938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1999',
internalId:  '',
customField: '20110817-072750'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20101105-205248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65085',
internalId:  '',
customField: '20101105-133845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65001',
internalId:  '',
customField: '20110727-150610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1978',
internalId:  '',
customField: '20101105-133916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83123',
internalId:  '',
customField: '20120106-152454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2041',
internalId:  '',
customField: '20101105-133950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65043',
internalId:  '',
customField: '20110220-225935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65064',
internalId:  '',
customField: '20101105-133806'
};
webappMappings['7008']=webappMappings['7008-10896']={
webappId:    '7008',
documentId:  '2041',
internalId:  '10896',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65106',
internalId:  '',
customField: '20101105-133929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69701',
internalId:  '',
customField: '20120114-093730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73801',
internalId:  '',
customField: '20120127-131217'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INESNB';
var companyName   = 'Aadorf+Apotheke+Drogerie';
var htmlTitle	  = 'Aadorf+Apotheke+Drogerie';
var metaKeywords  = 'Aadorf+Apotheke+Drogerie+Schurr+Nigg+Gesundheitszentrum+';
var metaContents  = 'Aadorf+Apotheke+Drogerie+-+Das+Gesundheitszentrum+im+Herzen+von+Aadorf';
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();
};

