/* [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','1901',jdecode('Home'),jdecode(''),'/1901/index.html','true',[ 
		['PAGE','6101',jdecode('Suche'),jdecode(''),'/1901/6101.html','true',[],'','']
	],'',''],
	['PAGE','1952',jdecode('Spirit+Still'),jdecode(''),'/1952.html','true',[],'',''],
	['PAGE','1973',jdecode('Sonderaktionen'),jdecode(''),'/1973.html','true',[],'',''],
	['PAGE','1994',jdecode('Veranstaltungen+und+Termine'),jdecode(''),'/1994/index.html','true',[ 
		['PAGE','4401',jdecode('Whiskyschiff+Z%C3%BCrich'),jdecode(''),'/1994/4401.html','true',[],'',''],
		['PAGE','4422',jdecode('Tastings+und+Degustationen'),jdecode(''),'/1994/4422.html','true',[],'','']
	],'',''],
	['PAGE','20301',jdecode('Whiskyreisen'),jdecode(''),'/20301/index.html','true',[ 
		['PAGE','21222',jdecode('Reise+Inseln+September+2010'),jdecode(''),'/20301/21222.html','true',[],'','']
	],'',''],
	['PAGE','11101',jdecode('Migros+Klubschule'),jdecode(''),'/11101/index.html','true',[ 
		['PAGE','11301',jdecode('Wann+und+wo%3F'),jdecode(''),'/11101/11301.html','true',[],'','']
	],'',''],
	['PAGE','11901',jdecode('G%C3%A4stebuch'),jdecode(''),'/11901.html','true',[],'',''],
	['PAGE','2015',jdecode('Online-Shop'),jdecode(''),'/2015.html','true',[],'',''],
	['PAGE','2036',jdecode('Kontakt'),jdecode(''),'/2036.html','true',[],'',''],
	['PAGE','2057',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/2057/index.html','true',[ 
		['PAGE','10501',jdecode('Unsere+%C3%96ffnungszeiten'),jdecode(''),'/2057/10501.html','true',[],'',''],
		['PAGE','2078',jdecode('Unser+Team'),jdecode(''),'/2057/2078.html','true',[],'',''],
		['PAGE','2099',jdecode('So+finden+Sie+uns'),jdecode(''),'/2057/2099.html','true',[],'','']
	],'',''],
	['PAGE','2120',jdecode('AGB%C2%B4s'),jdecode(''),'/2120.html','true',[],'',''],
	['PAGE','2141',jdecode('Impressum'),jdecode(''),'/2141.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Odd';
theSitetree.paletteFamily='F5E7C2';
theSitetree.keyvisualId='12123';
theSitetree.keyvisualName='kv_12123.jpg';
theSitetree.fontsetId='33321';
theSitetree.graphicsetId='14194';
theSitetree.contentColor='333333';
theSitetree.contentBGColor='F5E7C2';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Odd',
				paletteFamily: 	'F5E7C2',
				keyvisualId: 	'12123',
				keyvisualName: 	'kv_12123.jpg',
				fontsetId: 		'33321',
				graphicsetId: 	'14194',
				contentColor: 	'333333',
				contentBGColor: 'F5E7C2',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Palatino Linotype, Book Antiqua, Palatino, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20100203-110155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1952',
internalId:  '',
customField: '20090902-160953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2015',
internalId:  '',
customField: '20091027-121459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2036',
internalId:  '',
customField: '20090730-223531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2057',
internalId:  '',
customField: '20090730-214026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2099',
internalId:  '',
customField: '20090903-160733'
};
webappMappings['4001']=webappMappings['4001-29877113']={
webappId:    '4001',
documentId:  '2015',
internalId:  '29877113',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-6773']={
webappId:    '7008',
documentId:  '2036',
internalId:  '6773',
customField: 'language:de;country:CH;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '2099',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-29877144']={
webappId:    '1501',
documentId:  '1901',
internalId:  '29877144',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2078',
internalId:  '',
customField: '20090730-224015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2120',
internalId:  '',
customField: '20091008-093727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2141',
internalId:  '',
customField: '20090730-220650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1994',
internalId:  '',
customField: '20090730-223417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20100903-121256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4422',
internalId:  '',
customField: '20100331-115559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1973',
internalId:  '',
customField: '20100327-102435'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '6101',
internalId:  'search',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20090814-083030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20100903-114921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20090917-145154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20090912-151901'
};
webappMappings['1002']=webappMappings['1002-11901abw330ine8rw']={
webappId:    '1002',
documentId:  '11901',
internalId:  '11901abw330ine8rw',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20090930-120954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20301',
internalId:  '',
customField: '20100707-114141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21222',
internalId:  '',
customField: '20100331-112504'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INE8RW';
var companyName   = 'Spirit+Still';
var htmlTitle	  = 'http%3A%2F%2Fwww.spiritstill.ch%2Fgoogledd341995f91ad7c7.html';
var metaKeywords  = 'Whisky%2C+Zug%2C+Single+Malt%2C+Spirituosen%2C+Wein%2C+Rum%2C+Grappa%2C+Shop%2C+spirit+still%2C+Spirit+Still%2C+Whiskey%2C+Whiskyshop%2C+Whisky+Zug%2C+Whisky+Schweiz%2C+Bertrams';
var metaContents  = 'Der+Spezialist+f%C3%BCr+Single+Malt+Whisky+und+andere+Spirituosen+in+der+Zeughausgasse+17+in+6300+Zug%2C+Schweiz.+%C3%9Cber+400+verschiedene+Single+Malt+Whiskys%2C+weitere+100+Whiskies+aus+dem+Rest+der+Welt+und+eine+grosse+Auswahl+an+Grappas%2C+Rums+und+anderen+Edelspirituosen+erwarten+Sie.+';
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();
};
