/* [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','4394',jdecode('Karaoke'),jdecode(''),'/4394/index.html','true',[ 
		['PAGE','1087384',jdecode('UZWIL+KARAOKE+ST.GALLEN+-+KARAOKE+TABASCO+BAR+FREITAG+1.OKTOBER+2010+-+KARAOKE+1.10.2010'),jdecode(''),'/4394/1087384.html','false',[],'',''],
		['PAGE','1087340',jdecode('KARAOKE+ISLIKON-WINTERTHUR-FRAUENFELD-SCHAFFHAUSEN'),jdecode(''),'/4394/1087340.html','false',[],'',''],
		['PAGE','1086727',jdecode('Karaoke+Uzwil+-+St.Gallen'),jdecode(''),'/4394/1086727.html','false',[],'',''],
		['PAGE','1086706',jdecode('Karaoke+am+Donnerstag'),jdecode(''),'/4394/1086706.html','false',[],'',''],
		['PAGE','1086890',jdecode('BILDER+KARAOKE+ISLANDPFERDE+WM'),jdecode(''),'/4394/1086890.html','false',[],'',''],
		['PAGE','1087182',jdecode('BILDER+KARAOKE+WATTWIL+-+TOGGENBURG+-+ALEX+WILD+SCHWEIZ'),jdecode(''),'/4394/1087182.html','false',[],'','']
	],'',''],
	['PAGE','1086756',jdecode('Events'),jdecode(''),'/1086756/index.html','true',[ 
		['PAGE','948427',jdecode('E-Mail'),jdecode(''),'/1086756/948427.html','false',[],'',''],
		['PAGE','948699',jdecode('Newsletter+%28Form+followup+page%29'),jdecode(''),'/1086756/948699.html','false',[],'',''],
		['PAGE','776043',jdecode('Anmeldung+%28Form+followup+page%29'),jdecode(''),'/1086756/776043.html','false',[],'','']
	],'',''],
	['PAGE','1086860',jdecode('E-Mail'),jdecode(''),'/1086860/index.html','true',[ 
		['PAGE','1087017',jdecode('Maskenball+Karaoke+Horgen'),jdecode(''),'/1086860/1087017.html','false',[],'','']
	],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Stripe';
theSitetree.paletteFamily='99D2F3';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10773';
theSitetree.graphicsetId='10902';
theSitetree.contentColor='4180A5';
theSitetree.contentBGColor='F2FAFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stripe',
				paletteFamily: 	'99D2F3',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10773',
				graphicsetId: 	'10902',
				contentColor: 	'4180A5',
				contentBGColor: 'F2FAFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'4180A5',
				e_color: 		'68AFD6',
				f_color: 		'68AFD6',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4394',
internalId:  '1006',
customField: '1006'
};
webappMappings['1009']=webappMappings['1009-6738911']={
webappId:    '1009',
documentId:  '948427',
internalId:  '6738911',
customField: 'isFollowupPage:true;documentId:948360;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4394',
internalId:  '',
customField: '20100615-073726'
};
webappMappings['1009']=webappMappings['1009-5847407']={
webappId:    '1009',
documentId:  '948699',
internalId:  '5847407',
customField: 'isFollowupPage:true;documentId:948667;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '948427',
internalId:  '',
customField: '20060627-164402'
};
webappMappings['1009']=webappMappings['1009-6317129']={
webappId:    '1009',
documentId:  '776043',
internalId:  '6317129',
customField: 'isFollowupPage:true;documentId:774886;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '948699',
internalId:  '',
customField: '20060627-170313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '776043',
internalId:  '',
customField: '20060216-031934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1087182',
internalId:  '',
customField: '20100520-150953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1087340',
internalId:  '',
customField: '20100601-013009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1087384',
internalId:  '',
customField: '20100615-073428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1087017',
internalId:  '',
customField: '20100518-161906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1086706',
internalId:  '',
customField: '20100510-000940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1086727',
internalId:  '',
customField: '20100510-002351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1086756',
internalId:  '',
customField: '20100601-005202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1086860',
internalId:  '',
customField: '20100513-152723'
};
webappMappings['7008']=webappMappings['7008-9757']={
webappId:    '7008',
documentId:  '1086860',
internalId:  '9757',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1086890',
internalId:  '',
customField: '20100517-082916'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXSY7';
var companyName   = 'Alex+Wild+-+www.wildmusic.ch';
var htmlTitle	  = 'Karaoke-Winterthur-Z%C3%BCrich-Aargau-Luzern-St.Gallen-Zug-Basel+Event-Anlass-Party-Geburtstag-Firmenfest-Feier-Fest-Hochzeit';
var metaKeywords  = 'Karaoke+%2C+Attraktion+%2C+Show+%2C+Musik+%2C+Music+%2C+Fest+%2C+Feier+%2C+Event+%2C+Anlass+%2C+Geburtstag+%2C+Hochzeit+%2C+Disco+%2C+Dancing+%2C+Club+%2C+Lounge+%2C+Bar+%2C+Restaurant+%2C+Hotel+%2C+Party+%2C+Firmenevent+%2C+Mitarbeiterfest+%2C+Firmenjubilaeum+%2C+Jubilaeum+%2C+Ausstellung+%2C+Messe+%2C+Promotion+%2C+Personalabend+%2C+Weihnachtsessen+%2C+Festzeltanlass+%2C+Privatfest+%2C+Privatanlass+%2C+Firma+%2C+Personalanlass+%2C+Firmenanlass';
var metaContents  = 'Karaoke-Show+Schweiz+f%C3%BCr+Ihren+Event+mit+Alexs+Karaoke-Show++Personalfest+%2C+Firmenevent+%2C+Geburtstag+%2C+Vereinsanlass+%2C+Club+%2C+Dancing+%2C+Disco+%2C+Bar+%2C+Lounge+%2C+Stadtfest+%2C+Hochzeit';
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();
};
