/* [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','4520',jdecode('Home'),jdecode(''),'/4520/index.html','true',[ 
		['PAGE','41016',jdecode('Home+%28Form+followup+page%29'),jdecode(''),'/4520/41016.html','false',[],'','']
	],'',''],
	['PAGE','4577',jdecode('Angebote+%26+Preise'),jdecode(''),'/4577/index.html','true',[ 
		['PAGE','4604',jdecode('Information+'),jdecode(''),'/4577/4604.html','true',[],'','']
	],'',''],
	['PAGE','19303',jdecode('Galerie'),jdecode(''),'/19303.html','true',[],'',''],
	['PAGE','154101',jdecode('vorher%2Fnachher'),jdecode(''),'/154101.html','true',[],'',''],
	['PAGE','62101',jdecode('Heidi+Henzen'),jdecode(''),'/62101.html','true',[],'',''],
	['PAGE','110001',jdecode('Galerie+2'),jdecode(''),'/110001.html','false',[],'',''],
	['PAGE','101640',jdecode('Kontakt'),jdecode(''),'/101640.html','true',[],'',''],
	['PAGE','42222',jdecode('Vorher%2FNachher'),jdecode(''),'/42222.html','false',[],'',''],
	['PAGE','31240',jdecode('Online-Shop'),jdecode(''),'/31240.html','true',[],'',''],
	['PAGE','4739',jdecode('Besuchte+Seminare'),jdecode(''),'/4739.html','false',[],'',''],
	['PAGE','18797',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/18797.html','false',[],'',''],
	['PAGE','12947',jdecode('G%C3%A4stebuch'),jdecode(''),'/12947/index.html','true',[ 
		['PAGE','12948',jdecode('Eintr%C3%A4ge'),jdecode(''),'/12947/12948.html','false',[],'','']
	],'',''],
	['PAGE','20403',jdecode('links'),jdecode(''),'/20403.html','false',[],'',''],
	['PAGE','44262',jdecode('LR+International'),jdecode(''),'/44262.html','false',[],'',''],
	['PAGE','4658',jdecode('Mail+an+hhenzen%40bluewin.ch'),jdecode(''),'/4658/index.html','false',[ 
		['PAGE','21601',jdecode('Kontakt+%28Form+followup+page%29'),jdecode(''),'/4658/21601.html','false',[],'','']
	],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Clearline';
theSitetree.paletteFamily='B71602';
theSitetree.keyvisualId='3288';
theSitetree.keyvisualName='kv_3288.jpg';
theSitetree.fontsetId='10421';
theSitetree.graphicsetId='10715';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Clearline',
				paletteFamily: 	'B71602',
				keyvisualId: 	'3288',
				keyvisualName: 	'kv_3288.jpg',
				fontsetId: 		'10421',
				graphicsetId: 	'10715',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'B71602',
				e_color: 		'989696',
				f_color: 		'989696',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4520',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41016',
internalId:  '',
customField: '20060611-143543'
};
webappMappings['1002']=webappMappings['1002-12947ABW0X0INXZ2Y']={
webappId:    '1002',
documentId:  '12947',
internalId:  '12947ABW0X0INXZ2Y',
customField: 'icq=false'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '101640',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '18797',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['1009']=webappMappings['1009-5471559']={
webappId:    '1009',
documentId:  '21601',
internalId:  '5471559',
customField: 'isFollowupPage:true;documentId:4658;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62101',
internalId:  '',
customField: '20090621-112114'
};
webappMappings['1009']=webappMappings['1009-5471559']={
webappId:    '1009',
documentId:  '41016',
internalId:  '5471559',
customField: 'isFollowupPage:true;documentId:4520;'
};
webappMappings['7008']=webappMappings['7008-1469']={
webappId:    '7008',
documentId:  '4658',
internalId:  '1469',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4520',
internalId:  '',
customField: '20091026-152217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4577',
internalId:  '',
customField: '20100203-144443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4604',
internalId:  '',
customField: '20080325-114459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19303',
internalId:  '',
customField: '20091026-150728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110001',
internalId:  '',
customField: '20090301-113505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '154101',
internalId:  '',
customField: '20091026-144409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42222',
internalId:  '',
customField: '20090210-140126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31240',
internalId:  '',
customField: '20060610-073548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4739',
internalId:  '',
customField: '20080201-185831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18797',
internalId:  '',
customField: '20050505-173819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12947',
internalId:  '',
customField: '20050505-160533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12948',
internalId:  '',
customField: '20050505-160533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20403',
internalId:  '',
customField: '20080609-212050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44262',
internalId:  '',
customField: '20080316-183545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101640',
internalId:  '',
customField: '20090621-112133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4658',
internalId:  '',
customField: '20080311-222922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21601',
internalId:  '',
customField: '20050516-180502'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXZ2Y';
var companyName   = 'Heidi%27s+Nagelstudio';
var htmlTitle	  = 'heidisnagelstudio';
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();
};
