/* [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','2858',jdecode('Home'),jdecode(''), jdecode('%2F2858.html'), 'true',[],'',''],
	['PAGE','32123',jdecode('Jam+am+Sonntag'),jdecode(''), jdecode('%2F32123.html'), 'true',[],'',''],
	['PAGE','12812',jdecode('New%28s%29%21'),jdecode(''), jdecode('%2F12812.html'), 'true',[],'',''],
	['PAGE','4012',jdecode('Bands'),jdecode(''), jdecode('%2F4012%2Findex.html'), 'true',[ 
		['PAGE','32923',jdecode('Emmerican+Highway'),jdecode(''), jdecode('%2F4012%2F32923.html'), 'true',[],'',''],
		['PAGE','4033',jdecode('Hot+Rock+Devils'),jdecode(''), jdecode('%2F4012%2F4033.html'), 'true',[],'',''],
		['PAGE','4054',jdecode('No+Inner+Limits'),jdecode(''), jdecode('%2F4012%2F4054.html'), 'true',[],'',''],
		['PAGE','4075',jdecode('KingPin'),jdecode(''), jdecode('%2F4012%2F4075.html'), 'true',[],'',''],
		['PAGE','4096',jdecode('Gene%40Work'),jdecode(''), jdecode('%2F4012%2F4096.html'), 'true',[],'','']
	],'',''],
	['PAGE','12212',jdecode('Festival'),jdecode(''), jdecode('%2F12212%2Findex.html'), 'true',[ 
		['PAGE','19212',jdecode('Verlosung+E-Gitarre'),jdecode(''), jdecode('%2F12212%2F19212.html'), 'true',[],'',''],
		['PAGE','9912',jdecode('Musiker'),jdecode(''), jdecode('%2F12212%2F9912.html'), 'true',[],'',''],
		['PAGE','9933',jdecode('Publikum'),jdecode(''), jdecode('%2F12212%2F9933.html'), 'true',[],'','']
	],'',''],
	['PAGE','4117',jdecode('Route'),jdecode(''), jdecode('%2F4117.html'), 'true',[],'',''],
	['PAGE','2984',jdecode('Kontakt'),jdecode(''), jdecode('%2F2984.html'), 'true',[],'',''],
	['PAGE','9233',jdecode('Sponsoren'),jdecode(''), jdecode('%2F9233.html'), 'true',[],'',''],
	['PAGE','2942',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F2942.html'), 'true',[],'',''],
	['PAGE','13812',jdecode('Links'),jdecode(''), jdecode('%2F13812.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Fraternity';
theSitetree.paletteFamily='264B70';
theSitetree.keyvisualId='10335';
theSitetree.keyvisualName='kv_10335.jpg';
theSitetree.fontsetId='21255';
theSitetree.graphicsetId='13332';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='9B2B2A';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'gate',
  product: 'WSCSYSSSSLY0XFEL'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Fraternity',
				paletteFamily: 	'264B70',
				keyvisualId: 	'10335',
				keyvisualName: 	'kv_10335.jpg',
				fontsetId: 		'21255',
				graphicsetId: 	'13332',
				contentColor: 	'FFFFFF',
				contentBGColor: '9B2B2A',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4033',
internalId:  '',
customField: '20090902-100928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4054',
internalId:  '',
customField: '20090831-090916'
};
webappMappings['7002']=webappMappings['7002-205']={
webappId:    '7002',
documentId:  '2942',
internalId:  '205',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4096',
internalId:  '',
customField: '20090906-065437'
};
webappMappings['7008']=webappMappings['7008-1744']={
webappId:    '7008',
documentId:  '2984',
internalId:  '1744',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2858',
internalId:  '',
customField: '20110530-063831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9912',
internalId:  '',
customField: '20090330-130438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9933',
internalId:  '',
customField: '20090606-054746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4117',
internalId:  '',
customField: '20090205-062528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2942',
internalId:  '',
customField: '20090205-081026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4075',
internalId:  '',
customField: '20090902-102651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2984',
internalId:  '',
customField: '20090205-090331'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '4117',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2858',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4012',
internalId:  '',
customField: '20110119-022814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32923',
internalId:  '',
customField: '20110119-031929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9233',
internalId:  '',
customField: '20090605-073510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12212',
internalId:  '',
customField: '20110118-160155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12812',
internalId:  '',
customField: '20110530-065823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13812',
internalId:  '',
customField: '20090326-165206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19212',
internalId:  '',
customField: '20090829-041111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32123',
internalId:  '',
customField: '20110602-053614'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INVZOO';
var companyName   = 'LiveMusic-Emmerich+';
var htmlTitle	  = 'LiveMusic-Emmerich+';
var metaKeywords  = 'Live+Musik+Emmerich%2C+Live+Musik+NRW%2C+Live+band%2C+Jam+am+Sonntag+in+Emmerich%2C+Jam+session+Emmerich%2C++Band+suchen%2C++Band+buchen%2C+Musiker%2C+Rockband%2C+Tanzband%2C+Musik+Stadsfest%2C+Emmerican+Highwayk%2C+Gene%40Work%2C+KingPin%2C+No+Inner+Limits%2C+Hot+Rock+Devils%2C+Metal+Band+buchen%2C+Live+Musiker+buchen+NRW%2C+Musik+fest%2C+Live+Musiker+buchen%2C+Live+Musik+Festival%2C+Gitarrenunterricht+Emmerich';
var metaContents  = 'Sie+suchen+nach+eine+Live+Band+f%C3%BCr+Ihre+Veranstaltung%2C+Zum+Beispiel+f%C3%BCr+ein+Betriebsfeier%2C+Stra%C3%9Fenfest%2C+Hochzeit%2C+Stadsfest%2C+Geburtstag+oder+etwas+anderes%3F+%0D%0A%0D%0A%0D%0A%0D%0ALiveMusic-Emmerich+hat+das+Ziel%2C+Musik+und+Bands+aus+Emmerich+zu+f%C3%B6rdern+und+zu+promoten.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A';
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();
};

