/* [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','8101',jdecode('Welcome'),jdecode(''), jdecode('%2F8101.html'), 'true',[],'',''],
	['PAGE','16901',jdecode('Band'),jdecode(''), jdecode('%2F16901.html'), 'true',[],'',''],
	['PAGE','15222',jdecode('Gigs'),jdecode(''), jdecode('%2F15222.html'), 'true',[],'',''],
	['PAGE','17301',jdecode('News+%26+History'),jdecode(''), jdecode('%2F17301.html'), 'true',[],'',''],
	['PAGE','17322',jdecode('Songs+%26+Links'),jdecode(''), jdecode('%2F17322.html'), 'true',[],'',''],
	['PAGE','15201',jdecode('Pictures'),jdecode(''), jdecode('%2F15201.html'), 'true',[],'',''],
	['PAGE','15243',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F15243.html'), 'true',[],'',''],
	['PAGE','15264',jdecode('Contact+%26+FAQ'),jdecode(''), jdecode('%2F15264.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Displace';
theSitetree.paletteFamily='2E2E2E';
theSitetree.keyvisualId='11075';
theSitetree.keyvisualName='kv_11075.jpg';
theSitetree.fontsetId='31958';
theSitetree.graphicsetId='13798';
theSitetree.contentColor='D8D8D5';
theSitetree.contentBGColor='2E2E2E';
var localeDef={
  language: 'de',
  country: 'DE'
};
var prodDef={
  wl_name: 'alfahosting',
  product: 'WSCSYSSSSLY0XNIF'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Displace',
				paletteFamily: 	'2E2E2E',
				keyvisualId: 	'11075',
				keyvisualName: 	'kv_11075.jpg',
				fontsetId: 		'31958',
				graphicsetId: 	'13798',
				contentColor: 	'D8D8D5',
				contentBGColor: '2E2E2E',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8101',
internalId:  '',
customField: '20111211-161210'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '8101',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-3976099']={
webappId:    '1501',
documentId:  '8101',
internalId:  '3976099',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '15222',
internalId:  'location',
customField: 'language:de;country:DE;isIncluded:true;'
};
webappMappings['7060']=webappMappings['7060-3cac48581829a0093ac849d945002627']={
webappId:    '7060',
documentId:  '15201',
internalId:  '3cac48581829a0093ac849d945002627',
customField: 'language:de;country:DE;'
};
webappMappings['7002']=webappMappings['7002-2413']={
webappId:    '7002',
documentId:  '15243',
internalId:  '2413',
customField: 'language:de;country:DE;'
};
webappMappings['7008']=webappMappings['7008-3145']={
webappId:    '7008',
documentId:  '15264',
internalId:  '3145',
customField: 'language:de;country:DE;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20111009-160252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15222',
internalId:  '',
customField: '20111211-160941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15243',
internalId:  '',
customField: '20100508-174051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15264',
internalId:  '',
customField: '20111009-160405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20100508-164334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17301',
internalId:  '',
customField: '20111009-154933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17322',
internalId:  '',
customField: '20111127-130221'
};
var webAppHostname = 'cgi-wsc.alfahosting.de:80';
var canonHostname = 'wsc.alfahosting.de';
var accountId     = 'AAHS10IN2910';
var companyName   = '6+Pack+-+Coverrock+vom+Feinsten';
var htmlTitle	  = '6pack+-+Coverrock+vom+Feinsten+';
var metaKeywords  = '6pack%2C+6-pack%2C+sixpack%2C+six-pack%2C+m%C3%BCnchen%2C+munic%2C+musik%2C+music%2C+Bayern%2C+Bavaria%2C+Rock%2C+Rockmusik%2C+Cover%2C+Coverrock%2C+Live%2C+Livemusik%2C+Livemusic%2C+jacek%2C+cheesy%2C+rudi%2C+hansi%2C+ronny%2C+kai%2C+Band%2C+Rockband';
var metaContents  = '6pack+ist+eine+Coverrockband+aus+dem+M%C3%BCnchner+Raum.+Sie+unterhalten+mit+Songs+die+nicht+jeder+spielt+und+sind+Garant+f%C3%BCr+einen+sch%C3%B6nen+Abend.+Es+handelt+sich+aber+nicht+um+eine+Hochzeitsband+oder+%C3%A4hnliches.+Sie+h%C3%B6ren+Songs+von+Queen%2C+Huey+Lewis%2C+Bon+Jovi+etc.+-+Einfach+alles+was+in+die+Beine+geht+und+gute+Laune+macht.';
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();
};

