/* [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','4558',jdecode('Home'),jdecode(''),'/4558.html','true',[],'',''],
	['PAGE','4615',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/4615/index.html','true',[ 
		['PAGE','4696',jdecode('Mitarbeiter%2Finnen'),jdecode(''),'/4615/4696.html','true',[],'','']
	],'',''],
	['PAGE','4723',jdecode('Produkte'),jdecode(''),'/4723/index.html','true',[ 
		['PAGE','4750',jdecode('Malu+Wilz+Beauty+'),jdecode(''),'/4723/4750.html','true',[],'',''],
		['PAGE','4777',jdecode('Malu+Wilz+Skin+Care'),jdecode(''),'/4723/4777.html','true',[],'',''],
		['PAGE','4804',jdecode('Arabesque'),jdecode(''),'/4723/4804.html','true',[],'',''],
		['PAGE','4831',jdecode('Dr.+Grandel'),jdecode(''),'/4723/4831.html','true',[],'',''],
		['PAGE','4885',jdecode('Permanent+Profi+Liner'),jdecode(''),'/4723/4885.html','true',[],'',''],
		['PAGE','4912',jdecode('Wachs-+und+Zubeh%C3%B6r'),jdecode(''),'/4723/4912.html','true',[],'',''],
		['PAGE','56901',jdecode('O%26F+Aromatherapie+Linie'),jdecode(''),'/4723/56901.html','true',[],'','']
	],'',''],
	['PAGE','4939',jdecode('Neuheiten'),jdecode(''),'/4939/index.html','true',[ 
		['PAGE','4966',jdecode('Malu+Wilz+Beauty+'),jdecode(''),'/4939/4966.html','true',[],'',''],
		['PAGE','8801',jdecode('Malu+Wilz+Skin+Care'),jdecode(''),'/4939/8801.html','true',[],'',''],
		['PAGE','8822',jdecode('Arabesque'),jdecode(''),'/4939/8822.html','true',[],'',''],
		['PAGE','8843',jdecode('Dr.+Grandel'),jdecode(''),'/4939/8843.html','true',[],'',''],
		['PAGE','5047',jdecode('Diverse+Infos'),jdecode(''),'/4939/5047.html','true',[],'','']
	],'',''],
	['PAGE','7011',jdecode('Seminare'),jdecode(''),'/7011.html','true',[],'',''],
	['PAGE','5074',jdecode('Kontakt'),jdecode(''),'/5074/index.html','true',[ 
		['PAGE','5101',jdecode('Adresse%2C+Telefon'),jdecode(''),'/5074/5101.html','true',[],'','']
	],'',''],
	['PAGE','5502',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/5502.html','true',[],'',''],
	['PAGE','5532',jdecode('Anfahrt'),jdecode(''),'/5532.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Coiffeur';
theSitetree.paletteFamily='D7B4CF';
theSitetree.keyvisualId='11611';
theSitetree.keyvisualName='kv_11611.jpg';
theSitetree.fontsetId='32922';
theSitetree.graphicsetId='13985';
theSitetree.contentColor='553d52';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Coiffeur',
				paletteFamily: 	'D7B4CF',
				keyvisualId: 	'11611',
				keyvisualName: 	'kv_11611.jpg',
				fontsetId: 		'32922',
				graphicsetId: 	'13985',
				contentColor: 	'553d52',
				contentBGColor: 'FFFFFF',
				a_color: 		'B573A5',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '5502',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5532',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-1722191']={
webappId:    '1501',
documentId:  '4558',
internalId:  '1722191',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-1038']={
webappId:    '7008',
documentId:  '5074',
internalId:  '1038',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4558',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4558',
internalId:  '',
customField: '20100406-161744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4615',
internalId:  '',
customField: '20091119-114437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4696',
internalId:  '',
customField: '20100406-145941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4723',
internalId:  '',
customField: '20060714-150706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4750',
internalId:  '',
customField: '20090203-144247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4777',
internalId:  '',
customField: '20090203-102613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4804',
internalId:  '',
customField: '20090203-102657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4831',
internalId:  '',
customField: '20070809-094135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56901',
internalId:  '',
customField: '20090203-144237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4885',
internalId:  '',
customField: '20090203-102722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4912',
internalId:  '',
customField: '20090203-102214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4939',
internalId:  '',
customField: '20100609-153550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4966',
internalId:  '',
customField: '20100412-152049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8801',
internalId:  '',
customField: '20100412-144339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8822',
internalId:  '',
customField: '20100412-140127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8843',
internalId:  '',
customField: '20100412-135136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5047',
internalId:  '',
customField: '20090203-115940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7011',
internalId:  '',
customField: '20100628-110746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5074',
internalId:  '',
customField: '20100609-152757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20100609-152420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5502',
internalId:  '',
customField: '20060601-143327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5532',
internalId:  '',
customField: '20060601-143532'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXEFW';
var companyName   = 'MUSCULUS+COSMETICS+AG';
var htmlTitle	  = 'Musculus+Cosmetics';
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();
};
