/* [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','1801',jdecode('Home'),jdecode(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','3301',jdecode('Schoko-Laden'),jdecode(''), jdecode('%2F3301%2Findex.html'), 'true',[ 
		['PAGE','9901',jdecode('Dunkel'),jdecode(''), jdecode('%2F3301%2F9901.html'), 'true',[],'',''],
		['PAGE','9922',jdecode('Vollmilch'),jdecode(''), jdecode('%2F3301%2F9922.html'), 'true',[],'',''],
		['PAGE','65812',jdecode('mit+Motto%2F+Spruch'),jdecode(''), jdecode('%2F3301%2F65812.html'), 'true',[],'',''],
		['PAGE','9943',jdecode('ohne+Kuh'),jdecode(''), jdecode('%2F3301%2F9943.html'), 'true',[],'',''],
		['PAGE','48622',jdecode('ohne+Zucker'),jdecode(''), jdecode('%2F3301%2F48622.html'), 'false',[],'',''],
		['PAGE','9964',jdecode('Weiss'),jdecode(''), jdecode('%2F3301%2F9964.html'), 'true',[],'',''],
		['PAGE','48601',jdecode('Pralinen'),jdecode(''), jdecode('%2F3301%2F48601.html'), 'true',[],'',''],
		['PAGE','10027',jdecode('Trinkschoggi'),jdecode(''), jdecode('%2F3301%2F10027.html'), 'true',[],'',''],
		['PAGE','10006',jdecode('Gutscheine'),jdecode(''), jdecode('%2F3301%2F10006.html'), 'true',[],'','']
	],'',''],
	['PAGE','1894',jdecode('E-Shop'),jdecode(''), jdecode('%2F1894.html'), 'true',[],'',''],
	['PAGE','3322',jdecode('Caf%C3%A9'),jdecode(''), jdecode('%2F3322%2Findex.html'), 'true',[ 
		['PAGE','8801',jdecode('Trinken'),jdecode(''), jdecode('%2F3322%2F8801.html'), 'true',[],'','']
	],'',''],
	['PAGE','3364',jdecode('Firmen+%26+Feiern'),jdecode(''), jdecode('%2F3364%2Findex.html'), 'true',[ 
		['PAGE','70812',jdecode('Anl%C3%A4sse'),jdecode(''), jdecode('%2F3364%2F70812.html'), 'true',[],'',''],
		['PAGE','69412',jdecode('Firmengeschenke'),jdecode(''), jdecode('%2F3364%2F69412.html'), 'true',[],'','']
	],'',''],
	['PAGE','1936',jdecode('Kontakt'),jdecode(''), jdecode('%2F1936.html'), 'true',[],'',''],
	['PAGE','4301',jdecode('So+finden+Sie+uns+'),jdecode(''), jdecode('%2F4301.html'), 'true',[],'',''],
	['PAGE','1915',jdecode('AGB%C2%B4s'),jdecode(''), jdecode('%2F1915.html'), 'false',[],'',''],
	['PAGE','49101',jdecode('Impressum'),jdecode(''), jdecode('%2F49101.html'), 'true',[],'',''],
	['PAGE','74312',jdecode('Links'),jdecode(''), jdecode('%2F74312.html'), 'true',[],'',''],
	['PAGE','82112',jdecode('Neu'),jdecode(''), jdecode('%2F82112.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Daily';
theSitetree.paletteFamily='D9BD9D';
theSitetree.keyvisualId='7297';
theSitetree.keyvisualName='kv_7297.jpg';
theSitetree.fontsetId='16457';
theSitetree.graphicsetId='12155';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21F'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Daily',
				paletteFamily: 	'D9BD9D',
				keyvisualId: 	'7297',
				keyvisualName: 	'kv_7297.jpg',
				fontsetId: 		'16457',
				graphicsetId: 	'12155',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20110920-141713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8801',
internalId:  '',
customField: '20110908-165435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20110805-160224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1894',
internalId:  '',
customField: '20110301-145749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1915',
internalId:  '',
customField: '20100208-120036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1936',
internalId:  '',
customField: '20100216-161858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10006',
internalId:  '',
customField: '20100217-163904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4301',
internalId:  '',
customField: '20100226-150655'
};
webappMappings['4001']=webappMappings['4001-23020643']={
webappId:    '4001',
documentId:  '1894',
internalId:  '23020643',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3322',
internalId:  '',
customField: '20110908-162329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3364',
internalId:  '',
customField: '20100827-133920'
};
webappMappings['7008']=webappMappings['7008-2558']={
webappId:    '7008',
documentId:  '1936',
internalId:  '2558',
customField: 'language:de;country:CH;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '4301',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20110913-105557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9922',
internalId:  '',
customField: '20110913-105620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9943',
internalId:  '',
customField: '20110408-153453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9964',
internalId:  '',
customField: '20110908-154846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10027',
internalId:  '',
customField: '20110408-153646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48601',
internalId:  '',
customField: '20110913-110024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48622',
internalId:  '',
customField: '20100217-164703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49101',
internalId:  '',
customField: '20110513-131352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65812',
internalId:  '',
customField: '20111017-130050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69412',
internalId:  '',
customField: '20110923-105012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70812',
internalId:  '',
customField: '20110805-165019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74312',
internalId:  '',
customField: '20110811-130613'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82112',
internalId:  '',
customField: '20110527-131408'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHP340INVQXW';
var companyName   = '';
var htmlTitle	  = 'Chocomotion.+Schokolade+erleben.';
var metaKeywords  = 'Schokolade%2C+chocolate%2C+Pralinen%2C+Truffes%2C+Absinth%2C+Chocomotion%2C+Niederdorf%2C+Z%C3%BCrich%2C+Zurich%2C+chocolat%2C+Switzerland%2C+Kakao%2C+heisse+Schoggi';
var metaContents  = 'Lieben+Sie+Schokolade+oder+jemanden%2C+der+Schokolade+liebt%3F+%0D%0ADas+kleine+Chocomotion+im+Niederdorf+erstaunt+regelm%C3%A4ssig+selbst+Stammkunden+mit+originellen+und+exquisiten+Schokoladefundst%C3%BCcken.+Hier+gibt+es+edle+Kreationen+der+besten+und+einfallsreichsten+Chocolatiers+Europas%3A+Grand-Cru-Schokoladen%2C+zum+Beispiel+von+Reichmuth+von+Reding+aus+der+Schweiz%2C+unconchierte+Tafeln+des+innovativen+Italieners+Claudio+Corallo+und+spezielle+Mischungen%2C+etwa+mit+Sesam+oder+Bergk%C3%A4se+und+Spr%C3%BCchen+f%C3%BCr+Verliebte%2C+Traurige+oder+Gestresste%2C+und+allerlei+sch%C3%B6n+verpackte+s%C3%BCsse+Kunstwerke+wie+k%C3%B6stliches+Body+Painting+oder+exotisches+Schoggi+Sushi.%0D%0AAuch+hochwertige+Kakaokosmetik%2C+etwa+Gourmet-Lippenbalsam+oder+Seifen+mit+echter+Schokolade%2C+kann+die+Liebhaberin+hier+entdecken.+Ausserdem+finden+Sie+B%C3%BCcher+und+Musik+rund+um+den+Kakao.%0D%0AIm+winzigen+Caf%C3%A9+gibt%E2%80%99+s+allerlei+Feines+zum+Trinken+und+Essen+%E2%80%93+probieren+Sie+mal+die+heisse+Schokolade+mit+Matcha%2C+ein+Shanghai+Lily+Sandwich+und+einen+Kuchen+oder+Glac%C3%A9+mit+Rosen%21';
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();
};

