/* [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','601',jdecode('Willkommen'),jdecode(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','652',jdecode('Gesunde+Hautpflege'),jdecode(''), jdecode('%2F652%2Findex.html'), 'true',[ 
		['PAGE','59001',jdecode('Erkenntnisse'),jdecode(''), jdecode('%2F652%2F59001.html'), 'true',[],'',''],
		['PAGE','59022',jdecode('Behandlungen'),jdecode(''), jdecode('%2F652%2F59022.html'), 'true',[],'',''],
		['PAGE','48301',jdecode('DR.+BAUMANN'),jdecode(''), jdecode('%2F652%2F48301.html'), 'true',[],'','']
	],'',''],
	['PAGE','673',jdecode('Top+in+Form'),jdecode(''), jdecode('%2F673%2Findex.html'), 'true',[ 
		['PAGE','59043',jdecode('FitVibe+%2B+BodyVib'),jdecode(''), jdecode('%2F673%2F59043.html'), 'true',[],'','']
	],'',''],
	['PAGE','59064',jdecode('Cellulite'),jdecode(''), jdecode('%2F59064%2Findex.html'), 'true',[ 
		['PAGE','59085',jdecode('Behandlungen'),jdecode(''), jdecode('%2F59064%2F59085.html'), 'true',[],'','']
	],'',''],
	['PAGE','10001',jdecode('McBody+Kavitation'),jdecode(''), jdecode('%2F10001%2Findex.html'), 'true',[ 
		['PAGE','59106',jdecode('Behandlungen'),jdecode(''), jdecode('%2F10001%2F59106.html'), 'true',[],'','']
	],'',''],
	['PAGE','736',jdecode('Wellness'),jdecode(''), jdecode('%2F736.html'), 'true',[],'',''],
	['PAGE','59127',jdecode('Braut-Service'),jdecode(''), jdecode('%2F59127.html'), 'true',[],'',''],
	['PAGE','757',jdecode('News'),jdecode(''), jdecode('%2F757.html'), 'true',[],'',''],
	['PAGE','778',jdecode('Kontakt'),jdecode(''), jdecode('%2F778.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='FF9F21';
theSitetree.keyvisualId='2242';
theSitetree.keyvisualName='love3.jpg';
theSitetree.fontsetId='364';
theSitetree.graphicsetId='418';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='FF9F21';
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: 			'Enjoy',
				paletteFamily: 	'FF9F21',
				keyvisualId: 	'2242',
				keyvisualName: 	'love3.jpg',
				fontsetId: 		'364',
				graphicsetId: 	'418',
				contentColor: 	'A00000',
				contentBGColor: 'FF9F21',
				a_color: 		'FF9F21',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20120116-213651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20120116-213205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20110127-225643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20110131-222117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20110131-221153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20110131-192706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '778',
internalId:  '',
customField: '20110214-182712'
};
webappMappings['7008']=webappMappings['7008-10395']={
webappId:    '7008',
documentId:  '778',
internalId:  '10395',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48301',
internalId:  '',
customField: '20110131-190304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59064',
internalId:  '',
customField: '20110131-223008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59001',
internalId:  '',
customField: '20110131-221540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59022',
internalId:  '',
customField: '20110127-222446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59127',
internalId:  '',
customField: '20110127-225525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59043',
internalId:  '',
customField: '20110128-091340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59085',
internalId:  '',
customField: '20110322-231721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59106',
internalId:  '',
customField: '20110713-094706'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW1X0INEKRA';
var companyName   = 'Kosmetikstudio+Beauty-Fit';
var htmlTitle	  = 'Kosmetikstudio+mit+dem+pers%C3%B6nlichen+Ambiente';
var metaKeywords  = 'Kosmetik%2C+Kosmetikstudio%2C+Gesichtspflege%2C+Hautpflege%2C+Dr.+Baumann%2C+Gesundheit%2C+gesund%2C+Vertr%C3%A4glichkeit%2C+Top+in+Form%2C+Vibrationstraining%2C+FitVibe%2C+Cellulite%2C+Schlank%2C+Straff%2C+Vakuum-Massage%2C+Traumfigur%2C+Kavitation%2C+Ultraschall%2C+McBody%2C+BodyOptimizer%2C+Bodylift%2C+Hot-Stones%2C+Entspannung%2C+medizinische+Massageliege%2C+Braut%2C+Hochzeit%2C+Make-up%2C+BodyVib%2C+Vibrationshanteln%2C+ohne+Konservierungsstoffe%2C+ohne+Parf%C3%BCmstoffe%2C+ohne+Mineral%C3%B6le%2C+4142%2C+M%C3%BCnchenstein';
var metaContents  = 'pers%C3%B6nliches+Kosmetikstudio+mit+gesunder+Hautpflege%3B+Vibrationstraining+f%C3%BCr+Top+in+Form%3B+Schritt+f%C3%BCr+Schritt+zur+Traumfigur+mit+Kavitation%3B+Schlank+und+straff+-+die+Effektbehandlung+gegen+Cellulite%3B+Wellness+mit+Hot+Stones-Massage%3B+in+M%C3%BCnchenstein';
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();
};

