/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','652',jdecode('Bio'),jdecode(''),'/652.html','true',[],'',''],
	['PAGE','673',jdecode('Radio'),jdecode(''),'/673/index.html','true',[ 
		['PAGE','89412',jdecode('DSDS'),jdecode(''),'/673/89412.html','true',[],'','']
	],'',''],
	['PAGE','715',jdecode('Video'),jdecode(''),'/715.html','true',[],'',''],
	['PAGE','736',jdecode('Bilder'),jdecode(''),'/736/index.html','true',[ 
		['PAGE','21501',jdecode('B%C3%BCsser+und+die+VIP%26%23x27%3Bs'),jdecode(''),'/736/21501.html','true',[],'',''],
		['PAGE','51701',jdecode('Streetparade+2008+mit+Gina+Lisa'),jdecode(''),'/736/51701.html','true',[],'',''],
		['PAGE','23001',jdecode('B%C3%BCsser+in+Los+Angeles'),jdecode(''),'/736/23001.html','true',[],'',''],
		['PAGE','24901',jdecode('B%C3%BCsser+im+Radio'),jdecode(''),'/736/24901.html','true',[],'',''],
		['PAGE','29501',jdecode('Promo'),jdecode(''),'/736/29501.html','true',[],'','']
	],'',''],
	['PAGE','11501',jdecode('Agenda'),jdecode(''),'/11501/index.html','true',[ 
		['PAGE','25901',jdecode('On+Air'),jdecode(''),'/11501/25901.html','true',[],'',''],
		['PAGE','25922',jdecode('Events'),jdecode(''),'/11501/25922.html','true',[],'','']
	],'',''],
	['PAGE','757',jdecode('Kontakt'),jdecode(''),'/757.html','true',[],'',''],
	['PAGE','25964',jdecode('Links'),jdecode(''),'/25964.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Metal';
theSitetree.paletteFamily='A3CAFE';
theSitetree.keyvisualId='729';
theSitetree.keyvisualName='mischpult.jpg';
theSitetree.fontsetId='144';
theSitetree.graphicsetId='161';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Metal',
				paletteFamily: 	'A3CAFE',
				keyvisualId: 	'729',
				keyvisualName: 	'mischpult.jpg',
				fontsetId: 		'144',
				graphicsetId: 	'161',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'A3CAFE',
				b_color: 		'87A7D2',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-c082df29b6a838c8e94b86868a447929']={
webappId:    '7060',
documentId:  '21501',
internalId:  'c082df29b6a838c8e94b86868a447929',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20101002-141353'
};
webappMappings['7060']=webappMappings['7060-afc3369c746b659247886013a4081024']={
webappId:    '7060',
documentId:  '23001',
internalId:  'afc3369c746b659247886013a4081024',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-9a733f0707a9ba1152daf4143a1cab5d']={
webappId:    '7060',
documentId:  '24901',
internalId:  '9a733f0707a9ba1152daf4143a1cab5d',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-1a33757d388a647e7c7f7018c3c07b28']={
webappId:    '7060',
documentId:  '29501',
internalId:  '1a33757d388a647e7c7f7018c3c07b28',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-77a4baa3f6e1d4661a1791da117a6c32']={
webappId:    '7060',
documentId:  '51701',
internalId:  '77a4baa3f6e1d4661a1791da117a6c32',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-199']={
webappId:    '7008',
documentId:  '757',
internalId:  '199',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20100825-061539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20100825-061400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20100811-163700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20080615-173241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20080224-134248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51701',
internalId:  '',
customField: '20080816-105702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23001',
internalId:  '',
customField: '20080224-152422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24901',
internalId:  '',
customField: '20080224-161211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29501',
internalId:  '',
customField: '20080301-160244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20090331-214757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25901',
internalId:  '',
customField: '20101002-135706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25922',
internalId:  '',
customField: '20101002-135848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89412',
internalId:  '',
customField: '20100416-052830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20080217-184305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25964',
internalId:  '',
customField: '20090702-064710'
};
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHOPT0IN38BG';
var companyName   = 'Stefan+B%C3%BCsser';
var htmlTitle	  = '';
var metaKeywords  = 'Stefan+B%C3%BCsser+Stefan+B%C3%BCsser+Stefan+B%C3%BCsser+Radio+Comedian+Comedy+Audio+Video+Blog+DJ+Moderation+Moderator+TV+Events+Anl%C3%A4sse+Promis+Paris+Hilton+Will+Smith+Eva+Mendes+Mariah+Carey+';
var metaContents  = 'Alle+Infos+zu+Radiomoderator+und+Comedian+Stefan+B%C3%BCsser.+Mit+AudioVideo-Files%2C+Blog+und+vielem+mehr.';
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();
};

