/* [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','4556',jdecode('Home'),jdecode(''),'/4556/index.html','true',[ 
		['PAGE','9063',jdecode('Wer+bin+Ich'),jdecode(''),'/4556/9063.html','true',[],'','']
	],'',''],
	['PAGE','12003',jdecode('Ihr+Anlass%3F'),jdecode(''),'/12003/index.html','true',[ 
		['PAGE','22915',jdecode('Equipment'),jdecode(''),'/12003/22915.html','true',[],'','']
	],'',''],
	['PAGE','9144',jdecode('Kontakt'),jdecode(''),'/9144.html','true',[],'',''],
	['PAGE','9171',jdecode('Interessante+Links'),jdecode(''),'/9171.html','true',[],'','']];
var siteelementCount=6;
theSitetree.topTemplateName='Neon';
theSitetree.paletteFamily='6699CC';
theSitetree.keyvisualId='874';
theSitetree.keyvisualName='cd_einlegen.jpg';
theSitetree.fontsetId='160';
theSitetree.graphicsetId='186';
theSitetree.contentColor='FF0000';
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: 	'874',
				keyvisualName: 	'cd_einlegen.jpg',
				fontsetId: 		'160',
				graphicsetId: 	'186',
				contentColor: 	'FF0000',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'6699CC',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4556',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4556',
internalId:  '',
customField: '20080124-181738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9063',
internalId:  '',
customField: '20071024-082045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12003',
internalId:  '',
customField: '20080124-184230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22915',
internalId:  '',
customField: '20090903-193416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9144',
internalId:  '',
customField: '20091216-103508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9171',
internalId:  '',
customField: '20090507-160853'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INX3P1';
var companyName   = 'DJ+-+%C3%9Cri';
var htmlTitle	  = 'DJ+-+%C3%9Cri+der+Hochzeit+und+Event+-+Allstyle+-+DJ+f%C3%BCr+Ihren+Anlass';
var metaKeywords  = 'Ritschard%2C+Urs%2C+%C3%BCri%2C+Hochzeit-DJ%2C+Party-DJ%2C+Event-DJ%2C+DJ%2C+Musik%2C+DJ-%C3%BCri%2C+Party%2C+Hochzeit%2C+Musik%2C+Disco%2C+deejay%2C+Schweiz%2C+Mobiler-DJ%2C+Mobile+Disco%2C+DJ-Urs%2C+DJ+-+Urs%2C+Beat%2C+Mr.Beat%2C+Beat++Mr-beat%2C+Allstyle%2C+Allstyle+DJ%2C+ueri%2C';
var metaContents  = 'DJ-%C3%BCri+der+Party+und+Event+DJ+f%C3%BCr+Ihren+Anlass+ob+Hochzeit%2C+oder+als+Ersatz-DJ%2C+ich+mache+Musik+f%C3%BCr+jeden+Anlass%21+Event-DJ%2C+Hochzeit-DJ%3B+Party-DJ%3B+in+der+Schweiz+wie+International%21+Mobile+Disco+und+Allstyle+-+DJ';
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();
};

