/* [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','522',jdecode('Home'),jdecode(''),'/522.html','true',[],'',''],
	['PAGE','573',jdecode('Aktuelles'),jdecode(''),'/573/index.html','true',[ 
		['PAGE','615',jdecode('Programm'),jdecode(''),'/573/615.html','true',[],'',''],
		['PAGE','27701',jdecode('Angebote'),jdecode(''),'/573/27701.html','true',[],'',''],
		['PAGE','24701',jdecode('Kalender+2010%2F2011'),jdecode(''),'/573/24701.html','true',[],'','']
	],'',''],
	['PAGE','594',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/594/index.html','true',[ 
		['PAGE','16801',jdecode('Kontakt'),jdecode(''),'/594/16801.html','true',[],'',''],
		['PAGE','17801',jdecode('Partner'),jdecode(''),'/594/17801.html','true',[],'',''],
		['PAGE','699',jdecode('Links'),jdecode(''),'/594/699.html','true',[],'','']
	],'',''],
	['PAGE','54701',jdecode('Bilder'),jdecode(''),'/54701/index.html','true',[ 
		['PAGE','22001',jdecode('Bilder+2006'),jdecode(''),'/54701/22001.html','true',[],'',''],
		['PAGE','501',jdecode('Bilder+2007'),jdecode(''),'/54701/501.html','true',[],'',''],
		['PAGE','54901',jdecode('Bilder+2008'),jdecode(''),'/54701/54901.html','true',[],'',''],
		['PAGE','54922',jdecode('Bilder+2009'),jdecode(''),'/54701/54922.html','true',[],'',''],
		['PAGE','37901',jdecode('Bilder+2010'),jdecode(''),'/54701/37901.html','true',[],'','']
	],'',''],
	['PAGE','10101',jdecode('Anfahrt'),jdecode(''),'/10101.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Craft';
theSitetree.paletteFamily='565EBF';
theSitetree.keyvisualId='5723';
theSitetree.keyvisualName='kv_5723.jpg';
theSitetree.fontsetId='11049';
theSitetree.graphicsetId='11809';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Craft',
				paletteFamily: 	'565EBF',
				keyvisualId: 	'5723',
				keyvisualName: 	'kv_5723.jpg',
				fontsetId: 		'11049',
				graphicsetId: 	'11809',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'565EBF',
				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['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '10101',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-22218794']={
webappId:    '1501',
documentId:  '522',
internalId:  '22218794',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '522',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '522',
internalId:  '',
customField: '20110628-142054'
};
webappMappings['7008']=webappMappings['7008-5529']={
webappId:    '7008',
documentId:  '16801',
internalId:  '5529',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20100802-123219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20100728-211618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20100802-123831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27701',
internalId:  '',
customField: '20090512-131854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20080415-125140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22001',
internalId:  '',
customField: '20110319-154137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24701',
internalId:  '',
customField: '20110318-111707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20090513-141312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20080416-142136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20110318-111804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20090722-180645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37901',
internalId:  '',
customField: '20090512-145845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54901',
internalId:  '',
customField: '20110318-103445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54701',
internalId:  '',
customField: '20110318-084007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54922',
internalId:  '',
customField: '20110319-153429'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INE533';
var companyName   = 'Oldtimer-Traktorentreffen+Jaunpass';
var htmlTitle	  = '';
var metaKeywords  = 'Oldtimertreffen%2C+Traktor%2C+Oldie%2C+Jaunpass%2C+Th%EF%BF%BDni%2C+Bulldog%2C+Bucher%2C+H%EF%BF%BDrlimann%2C+Porsche%2C+Schilter%2C+Lanz%2C+Bachofner++';
var metaContents  = 'Oldtimertreffen%2C+Jaunpass+26.+und+27.+Juli+2008%2C+Traktor%2C+Oldtimertraktor%2C+Oldtimer%2C+Boltigen%2C+Rossberg%2C+th%EF%BF%BDni%2C+Bucher%2C+Lanz%2C+Lanz-Bulldog%2C+H%EF%BF%BDrlimann%2C+Jaun%2C+Bachofner+';
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();
};

