/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','552',jdecode('%C3%96pis+%C3%BCber+mi+%2F+Familiabilder'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','573',jdecode('Mini+Fr%C3%BCnda'),jdecode(''),'/573.html','true',[],'',''],
	['PAGE','594',jdecode('Links'),jdecode(''),'/594.html','true',[],'',''],
	['PAGE','636',jdecode('Events%2C+Reisen%2C+Feschter+'),jdecode(''),'/636.html','true',[],'',''],
	['PAGE','657',jdecode('Motorradbilder+1'),jdecode(''),'/657.html','true',[],'',''],
	['PAGE','70485',jdecode('Motorradbilder+2'),jdecode(''),'/70485.html','true',[],'',''],
	['PAGE','70422',jdecode('Motorradbilder+3'),jdecode(''),'/70422.html','true',[],'',''],
	['PAGE','70401',jdecode('Motorr%C3%A4der+von+gixxer.ch'),jdecode(''),'/70401.html','true',[],'',''],
	['PAGE','70443',jdecode('Umbauta+mini+Gixxer'),jdecode(''),'/70443.html','true',[],'',''],
	['PAGE','70464',jdecode('Bikes+Sam+vs.Jimmy+vs.Jacky'),jdecode(''),'/70464.html','true',[],'',''],
	['PAGE','70506',jdecode('Diverses+Z%C3%BCg%2Fmis+Auto'),jdecode(''),'/70506.html','true',[],'',''],
	['PAGE','70527',jdecode('D%2C+Frauenfelder'),jdecode(''),'/70527.html','true',[],'',''],
	['PAGE','6038',jdecode('G%C3%A4stebuch'),jdecode(''),'/6038/index.html','true',[ 
		['PAGE','6033',jdecode('Eintr%C3%A4ge'),jdecode(''),'/6038/6033.html','false',[],'','']
	],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1753';
theSitetree.keyvisualName='industrie.jpg';
theSitetree.fontsetId='291';
theSitetree.graphicsetId='355';
theSitetree.contentColor='A3AFD5';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1753',
				keyvisualName: 	'industrie.jpg',
				fontsetId: 		'291',
				graphicsetId: 	'355',
				contentColor: 	'A3AFD5',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-6038abw0x0in235v']={
webappId:    '1002',
documentId:  '6038',
internalId:  '6038abw0x0in235v',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20091006-055948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20091006-164141'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20081015-084814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20081015-084459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20091217-054434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20080325-181148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70485',
internalId:  '',
customField: '20091218-065131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70422',
internalId:  '',
customField: '20091217-053021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70401',
internalId:  '',
customField: '20081008-125441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70443',
internalId:  '',
customField: '20081008-131145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70464',
internalId:  '',
customField: '20090126-175252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70506',
internalId:  '',
customField: '20090428-202140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70527',
internalId:  '',
customField: '20081008-142356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6038',
internalId:  '',
customField: '20080424-051937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6033',
internalId:  '',
customField: '20070511-135658'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN235V';
var companyName   = 'Jimmy+the+gixxer';
var htmlTitle	  = 'Jimmy+the+Gixxer';
var metaKeywords  = 'suzuki+Gixxer+GSXR+Streetfighter+GSX-R';
var metaContents  = 'Jimmy66+Suzuki+GSX-R1000+K6+GSXR+Streetfighter+Gixxer+GSX-R+Suzuki+';
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();
};

