/* [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','10301',jdecode('Home'),jdecode(''), jdecode('%2F10301.html'), 'true',[],'',''],
	['PAGE','11101',jdecode('Sonderaktionen'),jdecode(''), jdecode('%2F11101.html'), 'true',[],'',''],
	['PAGE','11701',jdecode('Preislisten'),jdecode(''), jdecode('%2F11701%2Findex.html'), 'true',[ 
		['PAGE','11801',jdecode('WEISSWEINE'),jdecode(''), jdecode('%2F11701%2F11801.html'), 'true',[],'',''],
		['PAGE','12001',jdecode('ROS%C3%89WEINE'),jdecode(''), jdecode('%2F11701%2F12001.html'), 'true',[],'',''],
		['PAGE','12022',jdecode('Rotw.+SCHWEIZ'),jdecode(''), jdecode('%2F11701%2F12022.html'), 'true',[],'',''],
		['PAGE','20901',jdecode('Rotw.+%C3%96STERREICH'),jdecode(''), jdecode('%2F11701%2F20901.html'), 'true',[],'',''],
		['PAGE','20922',jdecode('Rotw.+FRANKREICH'),jdecode(''), jdecode('%2F11701%2F20922.html'), 'true',[],'',''],
		['PAGE','20943',jdecode('Rotw.+ITALIEN'),jdecode(''), jdecode('%2F11701%2F20943.html'), 'true',[],'',''],
		['PAGE','20964',jdecode('Rotw.+SPANIEN'),jdecode(''), jdecode('%2F11701%2F20964.html'), 'true',[],'',''],
		['PAGE','20985',jdecode('Rotw.+PORTUGAL'),jdecode(''), jdecode('%2F11701%2F20985.html'), 'true',[],'',''],
		['PAGE','21006',jdecode('Rotw.+KALIFORNIEN'),jdecode(''), jdecode('%2F11701%2F21006.html'), 'true',[],'',''],
		['PAGE','21027',jdecode('Rotw.+CHILE'),jdecode(''), jdecode('%2F11701%2F21027.html'), 'true',[],'',''],
		['PAGE','21048',jdecode('Rotw.+ARGENTINIEN'),jdecode(''), jdecode('%2F11701%2F21048.html'), 'true',[],'',''],
		['PAGE','21069',jdecode('SCHAUMWEINE'),jdecode(''), jdecode('%2F11701%2F21069.html'), 'true',[],'',''],
		['PAGE','20201',jdecode('GRAPPA+%2F+Spirituosen'),jdecode(''), jdecode('%2F11701%2F20201.html'), 'true',[],'','']
	],'',''],
	['PAGE','36201',jdecode('Online-Bestellung'),jdecode(''), jdecode('%2F36201.html'), 'true',[],'',''],
	['PAGE','15901',jdecode('Spezielles%2FGeschenke'),jdecode(''), jdecode('%2F15901.html'), 'true',[],'',''],
	['PAGE','41401',jdecode('Versand'),jdecode(''), jdecode('%2F41401.html'), 'true',[],'',''],
	['PAGE','13401',jdecode('Ausstellungen'),jdecode(''), jdecode('%2F13401.html'), 'true',[],'',''],
	['PAGE','12301',jdecode('%C3%96ffnungszeiten'),jdecode(''), jdecode('%2F12301.html'), 'true',[],'',''],
	['PAGE','31543',jdecode('So+finden+Sie+uns'),jdecode(''), jdecode('%2F31543.html'), 'true',[],'',''],
	['PAGE','11227',jdecode('Kontakt'),jdecode(''), jdecode('%2F11227.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Unity';
theSitetree.paletteFamily='922C36';
theSitetree.keyvisualId='11820';
theSitetree.keyvisualName='kv_11820.jpg';
theSitetree.fontsetId='33133';
theSitetree.graphicsetId='14075';
theSitetree.contentColor='922C36';
theSitetree.contentBGColor='FFFFFF';
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: 			'Unity',
				paletteFamily: 	'922C36',
				keyvisualId: 	'11820',
				keyvisualName: 	'kv_11820.jpg',
				fontsetId: 		'33133',
				graphicsetId: 	'14075',
				contentColor: 	'922C36',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20111011-180531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20111011-172215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11701',
internalId:  '',
customField: '20110312-103822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20120218-112723'
};
webappMappings['7008']=webappMappings['7008-11803']={
webappId:    '7008',
documentId:  '36201',
internalId:  '11803',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31543',
internalId:  '',
customField: '20110302-171301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11227',
internalId:  '',
customField: '20110312-094420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20111012-171121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20111012-171326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20110225-173329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12022',
internalId:  '',
customField: '20111012-172308'
};
webappMappings['1501']=webappMappings['1501-32732934']={
webappId:    '1501',
documentId:  '10301',
internalId:  '32732934',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20110225-173811'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20201',
internalId:  '',
customField: '20110224-170611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21006',
internalId:  '',
customField: '20111014-110820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20111013-083318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20922',
internalId:  '',
customField: '20111013-085754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20943',
internalId:  '',
customField: '20111014-104855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20964',
internalId:  '',
customField: '20111013-094514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20985',
internalId:  '',
customField: '20111013-100308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21027',
internalId:  '',
customField: '20111014-110947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21048',
internalId:  '',
customField: '20111014-111036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21069',
internalId:  '',
customField: '20111014-111237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20111014-162925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41401',
internalId:  '',
customField: '20110316-114316'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '31543',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW330INE2YP';
var companyName   = 'WY+-+HUUS++GLAUS++GmbH';
var htmlTitle	  = '';
var metaKeywords  = 'Weinkellerei%2C+Wy-Huus%2C+Getr%C3%A4nke%2C+Wyhuus%2C+Wyhus%2C+Wy%2C+Wein%2CWeine%2CGrappa%2CSpirituosen%2CItal.Spezialit%C3%A4ten%2CWeinetiketten%2CGeschenke%2CGeschenkk%C3%B6rbe%2C+Weissweine%2CRos%C3%A9weine%2CRotweine%2C';
var metaContents  = 'Wein%2C+Weine%2C+Weinkellerei%2C+Wy-Huus%2C+Wyhuus%2C+Wyhus%2C+Wy%2C+Getr%C3%A4nke%2C+Weine+aus+der+Schweiz%2C+Weine+aus+Italien%2C+Weine+aus+Frankreich%2C+Weine+aus+Spanien%2C+Weine+aus+Portugal%2C+Weine+aus+%C3%96sterreich%2C+Weine+aus+Chile%2C+Weine+aus+Kalifornien%2C+Weine+aus+Argentinien';
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();
};

