/* [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','1101',jdecode('Home+%2B+News'),jdecode(''), jdecode('%2F1101.html'), 'true',[],'',''],
	['PAGE','13901',jdecode('%C3%BCber+Uns'),jdecode(''), jdecode('%2F13901.html'), 'true',[],'',''],
	['PAGE','2843',jdecode('Dienste+%2B+Preise'),jdecode(''), jdecode('%2F2843%2Findex.html'), 'true',[ 
		['PAGE','2864',jdecode('Erkl%C3%A4rungen%2FTipps'),jdecode(''), jdecode('%2F2843%2F2864.html'), 'true',[],'','']
	],'',''],
	['PAGE','2906',jdecode('IPL+Dauerhafte-Haarentfernung'),jdecode(''), jdecode('%2F2906.html'), 'true',[],'',''],
	['PAGE','2885',jdecode('Galerie+Nail%26%23x27%3Bs'),jdecode(''), jdecode('%2F2885.html'), 'true',[],'',''],
	['PAGE','2801',jdecode('Kontakt+%2B+Termine'),jdecode(''), jdecode('%2F2801.html'), 'true',[],'',''],
	['PAGE','58556',jdecode('**'),jdecode(''), jdecode('%2F58556.html'), 'false',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Case';
theSitetree.paletteFamily='82C1DC';
theSitetree.keyvisualId='11061';
theSitetree.keyvisualName='kv_11061.jpg';
theSitetree.fontsetId='31938';
theSitetree.graphicsetId='13781';
theSitetree.contentColor='34454C';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'genotec',
  product: 'WSCSYSSSSLYTCP0K'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Case',
				paletteFamily: 	'82C1DC',
				keyvisualId: 	'11061',
				keyvisualName: 	'kv_11061.jpg',
				fontsetId: 		'31938',
				graphicsetId: 	'13781',
				contentColor: 	'34454C',
				contentBGColor: 'F6FBFE',
				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:  '58556',
internalId:  '',
customField: '20111219-101735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20120127-114511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20111125-074525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20120110-113712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2843',
internalId:  '',
customField: '20120127-114341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2885',
internalId:  '',
customField: '20111219-105503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2864',
internalId:  '',
customField: '20120110-115256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2906',
internalId:  '',
customField: '20120110-113326'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1101',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'cgi.wsc.genotec.ch:80';
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010IN20PX';
var companyName   = 'Fantasy+Nail%27s+%26+Beauty';
var htmlTitle	  = 'Fantasy+Nail%27s+%26+Hair%27s';
var metaKeywords  = 'Nail%2C+Kosmetik%2C+Wimpern%2C+Enthaarung%2C+Warmwachs%2C+Naturnagelverst%C3%A4rkung%2C+Wimpernextensions%2C+Haarentfernung%2C+Nailstudio%2C+Beauty%2C+H%C3%A4nde%2C+F%C3%BCsse%2C+Augenbrauern%2C+Hand%2C+Fingernagel%2C+Gel%2C+Duralash%2C+LCN%2C+You%2C+Cecars%2C+Ausbildung%2C+Egg%2C+Einsiedeln%2C+Gel-Set%2C+Auff%C3%BCllen%2C+Entfernen%2C+Neu%2C+profesionell%2C+Studio%2C+Beine%2C+Fuss%2C+pflege%2C+Visitenkarte%2C+E-mail%2C+Tel.%2C+Termin%2C+Zeit%2C+IPL%2C+dauerhafte+Haarentfernung%2C+Haarfrei%2C+Haarweg%2C+';
var metaContents  = 'Beauty-+und+Nagelstudio%2C+f%C3%BCr+Hand-%2C++Nagel-+und+K%C3%B6rperpflege.+Fingern%C3%A4gel+und+mehr.+Neu+dauerhafte+Haarentferung+mit+IPL.++Haarentfernung+mit+Warmwachs.+Wimper+und+Augenbrauen+f%C3%A4rben.';
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();
};

