/* [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','4452',jdecode('Startseite+Blue+Bay'),jdecode(''),'/4452.html','true',[],'',''],
	['PAGE','157755',jdecode('Grotte+Bar'),jdecode(''),'/157755.html','true',[],'',''],
	['PAGE','157764',jdecode('Dancing+Blue+Bay'),jdecode(''),'/157764.html','true',[],'',''],
	['PAGE','157773',jdecode('Gallery+im+2+Stock+'),jdecode(''),'/157773.html','true',[],'',''],
	['PAGE','157782',jdecode('Landgasthof+Sternen'),jdecode(''),'/157782.html','true',[],'',''],
	['PAGE','9663',jdecode('Kontakt'),jdecode(''),'/9663/index.html','true',[ 
		['PAGE','13008',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/9663/13008.html','false',[],'','']
	],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='000099';
theSitetree.keyvisualId='9242';
theSitetree.keyvisualName='kv4.swf';
theSitetree.fontsetId='17363';
theSitetree.graphicsetId='12755';
theSitetree.contentColor='000099';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Transluszent',
				paletteFamily: 	'000099',
				keyvisualId: 	'9242',
				keyvisualName: 	'kv4.swf',
				fontsetId: 		'17363',
				graphicsetId: 	'12755',
				contentColor: 	'000099',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4452',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4452',
internalId:  '',
customField: '20100304-023955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157755',
internalId:  '',
customField: '20071117-223738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157764',
internalId:  '',
customField: '20071117-223626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157773',
internalId:  '',
customField: '20071117-223901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157782',
internalId:  '',
customField: '20081215-155825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9663',
internalId:  '',
customField: '20070603-121007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13008',
internalId:  '',
customField: '20040906-111150'
};
webappMappings['7008']=webappMappings['7008-3324']={
webappId:    '7008',
documentId:  '9663',
internalId:  '3324',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INX37R';
var companyName   = 'Dancing+Blue+Bay';
var htmlTitle	  = 'Winterthur+Dancing+Blue+Bay+Pfungen-Winterthur+%7C+Restaurant-Landgasthof+Sternen-Karaoke-Live+Musik-Tanzmusik-Karaoke-Metzgete-Pfungen+bei+Winterthur-Karaoke+bis+Live+Band';
var metaKeywords  = 'Dancing+Winterthur+Karaoke+Z%C3%BCrich+Karaoke+Winterthur+Karaoke+Pfungen+Karaoke+Frauenfeld+Karaoke+Schaffhaussen+Tanz+Tanzparty+Live+Musik+Live+Music+Event+Ausgang+Veranstaltung+Club+Dancing+Blue+Bay%2C+Grotte+Bar%2C+Landgasthof+Sternen%2C+Pfungen+bei+Winterthur+%2C+Jeden+Dienstag+Karaoke%2C+Live+Band+am+Donnerstag+und+Freitag%2C+Samstag+DJ%2C+Duo%2C+Trio%2C+Unterhaltung%2C+Partylokal%2C+Tanzen%2C+Essen%2C+Trinken%2C+Disco';
var metaContents  = 'Karaoke+jeden+Mittwoch+%2C+Live+Musik+immer+Donnerstag+%28+mit+Rosentanz+%29+bis+Samstag+Tanzmusik+mit+Partybands+-+Ihr+Tanzlokal+im+Kanton+Z%C3%BCrich+n%C3%A4he+Winterthur+-+Schaffhausen+-+Frauenfeld';
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();
};
