/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','6901',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F6901%2Findex.html'), 'true',[ 
		['PAGE','6922',jdecode('Unser+Team'),jdecode(''), jdecode('%2F6901%2F6922.html'), 'true',[],'',''],
		['PAGE','7174',jdecode('So+finden+Sie+uns'),jdecode(''), jdecode('%2F6901%2F7174.html'), 'true',[],'','']
	],'',''],
	['PAGE','6964',jdecode('Sortiment+%2F+Produkte'),jdecode(''), jdecode('%2F6964%2Findex.html'), 'true',[ 
		['PAGE','44901',jdecode('Kaffeemaschinen'),jdecode(''), jdecode('%2F6964%2F44901.html'), 'true',[],'',''],
		['PAGE','113101',jdecode('...+Zubeh%C3%B6r'),jdecode(''), jdecode('%2F6964%2F113101.html'), 'true',[],'',''],
		['PAGE','46601',jdecode('Kaffeebohnen%2C+-+Pods'),jdecode(''), jdecode('%2F6964%2F46601.html'), 'true',[],'',''],
		['PAGE','44922',jdecode('Gourmet-Produkte'),jdecode(''), jdecode('%2F6964%2F44922.html'), 'true',[],'',''],
		['PAGE','44943',jdecode('Accessoires'),jdecode(''), jdecode('%2F6964%2F44943.html'), 'true',[],'',''],
		['PAGE','44964',jdecode('Wein+und+mehr...'),jdecode(''), jdecode('%2F6964%2F44964.html'), 'true',[],'','']
	],'',''],
	['PAGE','7069',jdecode('Geschenksideen'),jdecode(''), jdecode('%2F7069.html'), 'true',[],'',''],
	['PAGE','49301',jdecode('News'),jdecode(''), jdecode('%2F49301%2Findex.html'), 'true',[ 
		['PAGE','109701',jdecode('Gabis+Fotokarten'),jdecode(''), jdecode('%2F49301%2F109701.html'), 'true',[],'',''],
		['PAGE','108301',jdecode('Weinsuppe'),jdecode(''), jdecode('%2F49301%2F108301.html'), 'true',[],'',''],
		['PAGE','105801',jdecode('Bachhalm+%28%3F%29'),jdecode(''), jdecode('%2F49301%2F105801.html'), 'true',[],'',''],
		['PAGE','102001',jdecode('Pesto+-Pesto-Pesto'),jdecode(''), jdecode('%2F49301%2F102001.html'), 'true',[],'',''],
		['PAGE','78622',jdecode('Chili-Variationen'),jdecode(''), jdecode('%2F49301%2F78622.html'), 'true',[],'',''],
		['PAGE','78601',jdecode('BIO+Chili'),jdecode(''), jdecode('%2F49301%2F78601.html'), 'true',[],'',''],
		['PAGE','57601',jdecode('Senf+mit+Grappa'),jdecode(''), jdecode('%2F49301%2F57601.html'), 'true',[],'',''],
		['PAGE','103401',jdecode('...+noch+mehr+Senf'),jdecode(''), jdecode('%2F49301%2F103401.html'), 'true',[],'',''],
		['PAGE','63801',jdecode('Tr%C3%BCffel%C3%B6l%2FTr%C3%BCffelsalz'),jdecode(''), jdecode('%2F49301%2F63801.html'), 'true',[],'',''],
		['PAGE','86501',jdecode('glutenfrei+%21'),jdecode(''), jdecode('%2F49301%2F86501.html'), 'true',[],'','']
	],'',''],
	['PAGE','65001',jdecode('Wechselausstellung'),jdecode(''), jdecode('%2F65001.html'), 'true',[],'',''],
	['PAGE','7153',jdecode('Kontakt'),jdecode(''), jdecode('%2F7153.html'), 'true',[],'',''],
	['PAGE','16006',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F16006%2Findex.html'), 'true',[ 
		['PAGE','16001',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F16006%2F16001.html'), 'false',[],'','']
	],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='Dispose';
theSitetree.paletteFamily='E99C2E';
theSitetree.keyvisualId='9719';
theSitetree.keyvisualName='kv_9719.gif';
theSitetree.fontsetId='10658';
theSitetree.graphicsetId='11182';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CCCACA';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Dispose',
				paletteFamily: 	'E99C2E',
				keyvisualId: 	'9719',
				keyvisualName: 	'kv_9719.gif',
				fontsetId: 		'10658',
				graphicsetId: 	'11182',
				contentColor: 	'000000',
				contentBGColor: 'CCCACA',
				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['1002']=webappMappings['1002-16006abw0x0ine9mp']={
webappId:    '1002',
documentId:  '16006',
internalId:  '16006abw0x0ine9mp',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20120107-151055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20120120-120237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6922',
internalId:  '',
customField: '20110705-163826'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7174',
internalId:  '',
customField: '20081205-112907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6964',
internalId:  '',
customField: '20110305-172804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78622',
internalId:  '',
customField: '20100129-120208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16006',
internalId:  '',
customField: '20111126-134218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7153',
internalId:  '',
customField: '20110705-163245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7069',
internalId:  '',
customField: '20120120-113458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105801',
internalId:  '',
customField: '20110919-125021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20080409-103432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44901',
internalId:  '',
customField: '20120120-112326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44922',
internalId:  '',
customField: '20120120-113352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44943',
internalId:  '',
customField: '20120120-120111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44964',
internalId:  '',
customField: '20110705-160642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46601',
internalId:  '',
customField: '20120120-113043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78601',
internalId:  '',
customField: '20110705-163136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49301',
internalId:  '',
customField: '20120107-151310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57601',
internalId:  '',
customField: '20110705-154652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102001',
internalId:  '',
customField: '20110705-154310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103401',
internalId:  '',
customField: '20110705-155214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63801',
internalId:  '',
customField: '20110213-125600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65001',
internalId:  '',
customField: '20120120-113740'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '113101',
internalId:  '-',
customField: '20120120-112741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86501',
internalId:  '',
customField: '20100909-164834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108301',
internalId:  '',
customField: '20111016-164056'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '109701',
internalId:  '-',
customField: '20111103-130653'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INE9MP';
var companyName   = 'Gourmet+-+Tr%C3%BCckli++9450+Altst%C3%A4tten+';
var htmlTitle	  = 'Gourmet-+Tr%C3%BCckli';
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();
};

