/* [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','401',jdecode('news'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','452',jdecode('work'),jdecode(''),'/452.html','true',[],'',''],
	['PAGE','56401',jdecode('biografie'),jdecode(''),'/56401.html','true',[],'',''],
	['PAGE','56422',jdecode('awards+%26+festivals'),jdecode(''),'/56422.html','true',[],'',''],
	['PAGE','8401',jdecode('kunden'),jdecode(''),'/8401.html','true',[],'',''],
	['PAGE','7322',jdecode('kontakt'),jdecode(''),'/7322.html','true',[],'','']];
var siteelementCount=6;
theSitetree.topTemplateName='Neon';
theSitetree.paletteFamily='6699CC';
theSitetree.keyvisualId='901';
theSitetree.keyvisualName='auge.jpg';
theSitetree.fontsetId='160';
theSitetree.graphicsetId='186';
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: 			'Neon',
				paletteFamily: 	'6699CC',
				keyvisualId: 	'901',
				keyvisualName: 	'auge.jpg',
				fontsetId: 		'160',
				graphicsetId: 	'186',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'6699CC',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20100428-083434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100529-104237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56401',
internalId:  '',
customField: '20100529-104034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56422',
internalId:  '',
customField: '20100216-131801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20100419-150913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7322',
internalId:  '',
customField: '20100216-135850'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN27ZS';
var companyName   = 'sam+flueckiger+-+director+%26+producer';
var htmlTitle	  = '';
var metaKeywords  = 'Samuel+Fl%C3%BCckiger%2C+S%C3%A4mi+Fl%C3%BCckiger%2C+Schweiz%2C+Switzerland%2C+Director%2C+Editor%2C+Producer%2C+Dschoint+Ventschr%2C+Video%2C+Clips%2C+Videoclips%2C+Musikvideo%2C+Film%2C+Schnitt%2C+Regie%2C+Produktion%2C+Stress%2C+Seven%2C+Sad+%2C+Dada+Ante+Portas%2C+Brandh%C3%A4rd%2C+Mamoney%2C+Bensch%2C+Abart%2C+Sorry%2C+Energieschub%2C+Noochbrand%2C+Clubhanger%2C+Meme+Sang%2C+Made+in+Mind%2C+Traene+in+de+Auge%2C+Taking+Your+Love%2C+Dada+Ante+Portas%2C+Red%2C+Redcam%2C+Redone%2C+Rain%2C+Slangnacht%2C+Awards%2C+Samurai%2C+Bandit';
var metaContents  = 'Sam+Flueckiger+-+Director+%26+Producer+%2F%2F+www.sam-flueckiger.ch+%2F%2F+Music+Videos+%26+Corporate+Films+%2F%2F+News+%2B%2B%2B+Brandneuer+Samurai+feat.+Bandit+Videoclip+%C2%ABPlastikmeitli%C2%BB+ab+24.04.+auf+MTV+%2B%2B%2B+Neuer+Brandh%C3%A4rdvideo+in+den+Startl%C3%B6chern+-+Premiere+auf+20Min.ch+%2B%2B%2B+Snook+feat.+Andri+Music+Video+ready+to+release+%2B%2B%2B+Psoriasis-Kampagne+mit+Christina+Surer+in+der+Pipeline+%2B%2B%2B+Sam+Flueckiger+%26+Crew+mal+wieder+im+Talentscreen+Finale+%2B%2B%2B+Nominationen+f%C3%BCr+SAD+feat.+Seven++Stress+-+Rain%3A+EDI+-+der+Schweizer+Auftragsfilmpreis+in+der+Kategorie+Clips+und+Trailers%3B+Solothurner+Filmtage+in+der+Kategorie+Sound++Stories+%2B%2B+Gewinner+Slangnacht+Award+Best+Swiss+Hiphop+Music+Video+2008+%2B%2B%2B+Nominiert+f%C3%BCr+das+beste+Schweizer+Rapvideo+an+der+Slangnacht+2008.+Online+Voting+auf+www.slangnacht.ch%21+%2B%2B+SAD+feat.+Seven++Stress+Clip+out+now%21+%2B%2B%2B+Samuel+Flueckiger+Visuals+goes+RED.+Neues+Projekt+in+Zusammenarbeit+mit+Tim+L%C3%BCdin+in+der+Pipeline.+Stay+tuned...+%2B%2B++Neuer+Dada+Ante+Portas+Video+Taking+Your+Love+Premiere+am+21%2F12%2F07+auf+20min.ch+%2B%2B+Videoclips+Energieschub+und+Sorry+an+den+43.+Solothurner+Filmtagen+in+der+Kategorie+Schweizer+Video+nominiert+%2F%2F+Neuer+Brandh%C3%A4rdclip+Tr%C3%A4ne+in+de+Auge+im+Anmarsch+%28Release%3A+Dezember+07%29+%2F%2F+Clips+Sorry+und+Meme+Sang+an+der+Slang+Nacht+07+nominiert+als+bestes+Schweizer+Rap+Video+%2F%2F+Neuer+Videclip+Energieschub+von+Brandh%C3%A4rd+f%C3%BCr+das+neue+Album+Brandrenalin+am+Start%21+';
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();
};
