/* [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','1001',jdecode('Home'),jdecode(''), jdecode('%2F1001.html'), 'true',[],'',''],
	['PAGE','1136',jdecode('Kurse'),jdecode(''), jdecode('%2F1136%2Findex.html'), 'true',[ 
		['PAGE','149912',jdecode('Kursdaten'),jdecode(''), jdecode('%2F1136%2F149912.html'), 'true',[],'',''],
		['PAGE','149933',jdecode('Allgemeine+Infos'),jdecode(''), jdecode('%2F1136%2F149933.html'), 'true',[],'',''],
		['PAGE','161412',jdecode('Fitnessbeitrag'),jdecode(''), jdecode('%2F1136%2F161412.html'), 'true',[],'','']
	],'',''],
	['PAGE','8001',jdecode('T%C3%A4nze'),jdecode(''), jdecode('%2F8001.html'), 'true',[],'',''],
	['PAGE','153912',jdecode('News'),jdecode(''), jdecode('%2F153912.html'), 'true',[],'',''],
	['PAGE','55001',jdecode('Dance+Floor+Etiquette'),jdecode(''), jdecode('%2F55001.html'), 'true',[],'',''],
	['PAGE','45801',jdecode('Line+Dance+History'),jdecode(''), jdecode('%2F45801.html'), 'true',[],'',''],
	['PAGE','1157',jdecode('Fotos'),jdecode(''), jdecode('%2F1157%2Findex.html'), 'true',[ 
		['PAGE','101001',jdecode('Auftritte+Showgruppe+2009%2F2010+'),jdecode(''), jdecode('%2F1157%2F101001.html'), 'true',[],'',''],
		['PAGE','126512',jdecode('SCWDA+Dance+Party+2010'),jdecode(''), jdecode('%2F1157%2F126512.html'), 'true',[],'',''],
		['PAGE','36201',jdecode('Wetzikon+Nov.+2008'),jdecode(''), jdecode('%2F1157%2F36201.html'), 'true',[],'','']
	],'',''],
	['PAGE','1094',jdecode('Links'),jdecode(''), jdecode('%2F1094%2Findex.html'), 'true',[ 
		['PAGE','23022',jdecode('Verband'),jdecode(''), jdecode('%2F1094%2F23022.html'), 'true',[],'',''],
		['PAGE','23064',jdecode('Clubs+%26+Saloons'),jdecode(''), jdecode('%2F1094%2F23064.html'), 'true',[],'',''],
		['PAGE','23043',jdecode('Stepsheets'),jdecode(''), jdecode('%2F1094%2F23043.html'), 'true',[],'',''],
		['PAGE','66201',jdecode('Events'),jdecode(''), jdecode('%2F1094%2F66201.html'), 'true',[],'',''],
		['PAGE','23085',jdecode('Artists'),jdecode(''), jdecode('%2F1094%2F23085.html'), 'true',[],'',''],
		['PAGE','59401',jdecode('Diverses%2FShopping'),jdecode(''), jdecode('%2F1094%2F59401.html'), 'true',[],'','']
	],'',''],
	['PAGE','52106',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F52106%2Findex.html'), 'true',[ 
		['PAGE','52101',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F52106%2F52101.html'), 'false',[],'','']
	],'',''],
	['PAGE','1115',jdecode('Kontakt'),jdecode(''), jdecode('%2F1115.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Bigcity_NYC';
theSitetree.paletteFamily='4A352C';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17891';
theSitetree.graphicsetId='13162';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='4A352C';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21F'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Bigcity_NYC',
				paletteFamily: 	'4A352C',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17891',
				graphicsetId: 	'13162',
				contentColor: 	'FFFFFF',
				contentBGColor: '4A352C',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1001',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-195b30e80341a8fa69fd3481d1a78881']={
webappId:    '7060',
documentId:  '36201',
internalId:  '195b30e80341a8fa69fd3481d1a78881',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-3b09f86c849080718f404b3bf498faa6']={
webappId:    '7060',
documentId:  '101001',
internalId:  '3b09f86c849080718f404b3bf498faa6',
customField: 'language:de;country:CH;'
};
webappMappings['1002']=webappMappings['1002-52106ahopt0in3phm']={
webappId:    '1002',
documentId:  '52106',
internalId:  '52106ahopt0in3phm',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-57ac946c69a9e3f5eeca6605e8c235fe']={
webappId:    '7060',
documentId:  '126512',
internalId:  '57ac946c69a9e3f5eeca6605e8c235fe',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1001',
internalId:  '',
customField: '20110815-163211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1136',
internalId:  '',
customField: '20120128-172237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149912',
internalId:  '',
customField: '20120122-141608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149933',
internalId:  '',
customField: '20111115-074243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20120128-171618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45801',
internalId:  '',
customField: '20110127-103052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55001',
internalId:  '',
customField: '20110313-210341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1157',
internalId:  '',
customField: '20110615-145430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101001',
internalId:  '',
customField: '20101101-072535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126512',
internalId:  '',
customField: '20101101-072555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '153912',
internalId:  '',
customField: '20110731-212218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161412',
internalId:  '',
customField: '20110313-210152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20101101-072644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1094',
internalId:  '',
customField: '20110710-093119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23022',
internalId:  '',
customField: '20101101-072812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23043',
internalId:  '',
customField: '20110121-110916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23064',
internalId:  '',
customField: '20111008-190621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66201',
internalId:  '',
customField: '20101101-072912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23085',
internalId:  '',
customField: '20110615-151423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59401',
internalId:  '',
customField: '20111008-191016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52106',
internalId:  '',
customField: '20111008-191059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52101',
internalId:  '',
customField: '20081231-192357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1115',
internalId:  '',
customField: '20101218-135237'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHOPT0IN3PHM';
var companyName   = 'BEAT%27N%27BOOT+DANCERS';
var htmlTitle	  = 'BeatnBoot+Dancers';
var metaKeywords  = 'Country+Line+Dance+Country+Western+Dance+BeatnBoot+Dancers+Kanton+Bern+Showteam+Marlis+Gurtner';
var metaContents  = 'Country+Line+Dance+Showgruppe+Line+Dance';
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();
};

