/* [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','11906',jdecode('Home'),jdecode(''),'/11906.html','true',[],'',''],
	['PAGE','6601',jdecode('Online-Shop'),jdecode(''),'/6601.html','true',[],'',''],
	['PAGE','59701',jdecode('L%C3%A4den'),jdecode(''),'/59701.html','true',[],'',''],
	['PAGE','9243',jdecode('Produkte%2C+Leistungen'),jdecode(''),'/9243/index.html','true',[ 
		['PAGE','65701',jdecode('Aktuell'),jdecode(''),'/9243/65701.html','true',[],'',''],
		['PAGE','9264',jdecode('Give-aways'),jdecode(''),'/9243/9264.html','true',[],'',''],
		['PAGE','48701',jdecode('Spickmaschine+f%C3%BCr+Feste'),jdecode(''),'/9243/48701.html','true',[],'',''],
		['PAGE','37801',jdecode('Gastronomie'),jdecode(''),'/9243/37801.html','true',[],'',''],
		['PAGE','38801',jdecode('REWI-Minis+als+Friandises'),jdecode(''),'/9243/38801.html','true',[],'',''],
		['PAGE','9285',jdecode('Kundengeschenke'),jdecode(''),'/9243/9285.html','true',[],'','']
	],'',''],
	['PAGE','65101',jdecode('Specials'),jdecode(''),'/65101.html','true',[],'',''],
	['PAGE','9348',jdecode('Messen'),jdecode(''),'/9348.html','true',[],'',''],
	['PAGE','11822',jdecode('Geschenkideen'),jdecode(''),'/11822.html','true',[],'',''],
	['PAGE','60501',jdecode('Flyer'),jdecode(''),'/60501.html','true',[],'',''],
	['PAGE','5701',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/5701/index.html','true',[ 
		['PAGE','21701',jdecode('Einige+Bilder'),jdecode(''),'/5701/21701.html','true',[],'','']
	],'',''],
	['PAGE','6901',jdecode('Ihr+Weg+zu+Spar+Mattenbach+'),jdecode(''),'/6901.html','true',[],'',''],
	['PAGE','9453',jdecode('Kontakt'),jdecode(''),'/9453.html','true',[],'',''],
	['PAGE','49906',jdecode('G%C3%A4stebuch'),jdecode(''),'/49906/index.html','true',[ 
		['PAGE','49901',jdecode('Eintr%C3%A4ge'),jdecode(''),'/49906/49901.html','false',[],'','']
	],'',''],
	['PAGE','53401',jdecode('Referenzen'),jdecode(''),'/53401.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Favor';
theSitetree.paletteFamily='D2BD84';
theSitetree.keyvisualId='7355';
theSitetree.keyvisualName='kv_7355.jpg';
theSitetree.fontsetId='16469';
theSitetree.graphicsetId='12160';
theSitetree.contentColor='323232';
theSitetree.contentBGColor='F1EEDB';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Favor',
				paletteFamily: 	'D2BD84',
				keyvisualId: 	'7355',
				keyvisualName: 	'kv_7355.jpg',
				fontsetId: 		'16469',
				graphicsetId: 	'12160',
				contentColor: 	'323232',
				contentBGColor: 'F1EEDB',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['4001']=webappMappings['4001-16334617']={
webappId:    '4001',
documentId:  '6601',
internalId:  '16334617',
customField: 'language:de;country:CH;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '6901',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['1002']=webappMappings['1002-49906ahopt0in3e6l']={
webappId:    '1002',
documentId:  '49906',
internalId:  '49906ahopt0in3e6l',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11906',
internalId:  '',
customField: '20100216-152148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20081104-074012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9243',
internalId:  '',
customField: '20090824-215357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9264',
internalId:  '',
customField: '20100216-152230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48701',
internalId:  '',
customField: '20090824-215423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37801',
internalId:  '',
customField: '20100216-152329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38801',
internalId:  '',
customField: '20090211-143328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9285',
internalId:  '',
customField: '20100204-182321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9348',
internalId:  '',
customField: '20100122-135102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11822',
internalId:  '',
customField: '20100216-152605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53401',
internalId:  '',
customField: '20100205-155441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100216-152954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21701',
internalId:  '',
customField: '20090824-110239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20091028-054937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9453',
internalId:  '',
customField: '20090824-110426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49906',
internalId:  '',
customField: '20090609-114648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49901',
internalId:  '',
customField: '20090609-114648'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '11906',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59701',
internalId:  '',
customField: '20091029-061325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60501',
internalId:  '',
customField: '20100122-134730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65101',
internalId:  '',
customField: '20100222-102457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65701',
internalId:  '',
customField: '20100222-102244'
};
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHOPT0IN3E6L';
var companyName   = 'Confiserie+K.+Reinhard';
var htmlTitle	  = 'Reinhard+Confiserie';
var metaKeywords  = 'Kirschstengel+ohne+Zuckerkruste%2C+Baileysstengel%2C+REWI-Mohrenk%C3%B6pfe%2C+Reinhard+WinterthurConfiserie+Versand%2C+krustenlose+Kirsch-%2C+Williams-+und+Baileysstenge';
var metaContents  = 'Confisierie+Spezialit%C3%A4ten%2C+Confiserie+Versand%2C+Confiserie+Winterthur';
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();
};
