/* [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','801',jdecode('Home'),jdecode(''),'/801.html','true',[],'',''],
	['PAGE','71501',jdecode('Vespa'),jdecode(''),'/71501/index.html','true',[ 
		['PAGE','5364',jdecode('crankase'),jdecode(''),'/71501/5364.html','true',[],'',''],
		['PAGE','7001',jdecode('kit'),jdecode(''),'/71501/7001.html','true',[],'',''],
		['PAGE','7401',jdecode('gearing'),jdecode(''),'/71501/7401.html','true',[],'',''],
		['PAGE','7422',jdecode('exhaust'),jdecode(''),'/71501/7422.html','true',[],'',''],
		['PAGE','7701',jdecode('carb'),jdecode(''),'/71501/7701.html','true',[],'',''],
		['PAGE','7722',jdecode('reed+valves'),jdecode(''),'/71501/7722.html','true',[],'',''],
		['PAGE','16001',jdecode('cylinder+heads'),jdecode(''),'/71501/16001.html','true',[],'',''],
		['PAGE','16022',jdecode('crank'),jdecode(''),'/71501/16022.html','true',[],'',''],
		['PAGE','42501',jdecode('wombat+serie'),jdecode(''),'/71501/42501.html','true',[],'',''],
		['PAGE','60601',jdecode('double+intake'),jdecode(''),'/71501/60601.html','true',[],'',''],
		['PAGE','51601',jdecode('oldtimers'),jdecode(''),'/71501/51601.html','true',[],'',''],
		['PAGE','51622',jdecode('LC+proto'),jdecode(''),'/71501/51622.html','true',[],'',''],
		['PAGE','65501',jdecode('leak+down+test'),jdecode(''),'/71501/65501.html','true',[],'',''],
		['PAGE','47101',jdecode('gallery'),jdecode(''),'/71501/47101.html','true',[],'','']
	],'',''],
	['PAGE','61801',jdecode('HarleyDavidson'),jdecode(''),'/61801/index.html','true',[ 
		['PAGE','61822',jdecode('conversion'),jdecode(''),'/61801/61822.html','true',[],'',''],
		['PAGE','62401',jdecode('carb'),jdecode(''),'/61801/62401.html','true',[],'',''],
		['PAGE','62422',jdecode('clutch+'),jdecode(''),'/61801/62422.html','true',[],'',''],
		['PAGE','86601',jdecode('Heads'),jdecode(''),'/61801/86601.html','true',[],'',''],
		['PAGE','88701',jdecode('exhaust'),jdecode(''),'/61801/88701.html','true',[],'',''],
		['PAGE','91801',jdecode('restauration%2Ftuning'),jdecode(''),'/61801/91801.html','true',[],'','']
	],'',''],
	['PAGE','16043',jdecode('Contact'),jdecode(''),'/16043.html','true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='B1942D';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10587';
theSitetree.graphicsetId='10563';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Circulation',
				paletteFamily: 	'B1942D',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10587',
				graphicsetId: 	'10563',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20110520-135102'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88701',
internalId:  '',
customField: '20110519-164923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71501',
internalId:  '',
customField: '20110519-163813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5364',
internalId:  '',
customField: '20091117-155703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16022',
internalId:  '',
customField: '20110519-131022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61801',
internalId:  '',
customField: '20110519-164304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61822',
internalId:  '',
customField: '20110517-182144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20070408-024155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20061112-015949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7422',
internalId:  '',
customField: '20061224-170641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20061108-183902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7722',
internalId:  '',
customField: '20080122-152515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20061224-170717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42501',
internalId:  '',
customField: '20070411-195204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60601',
internalId:  '',
customField: '20080210-131534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51601',
internalId:  '',
customField: '20071219-232553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51622',
internalId:  '',
customField: '20080326-015738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65501',
internalId:  '',
customField: '20080122-215107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47101',
internalId:  '',
customField: '20070412-224013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62401',
internalId:  '',
customField: '20110517-205233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62422',
internalId:  '',
customField: '20110522-174856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86601',
internalId:  '',
customField: '20110518-175416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16043',
internalId:  '',
customField: '20110519-211110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91801',
internalId:  '',
customField: '20110522-175434'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2NTN';
var companyName   = '%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F';
var htmlTitle	  = 'http%3A%2F%2Fcurareracing.com%2F5364.html';
var metaKeywords  = 'vespa%2C+engines%2C+tuning%2C+curare%2C+largeframe%2C+smallframe%2C+scooter%2C+largeframes%2C+smallframes%2C+scooters%2C+racing%2C+piaggio%2C+motor%2C+motors%2C+race%2C+wombat%2C+power%2C+moto%2C+motos%2C+harley%2C+davidson%2C+harley-davidson%2C+bi-motor%2C+v+motor%2C+bicylinder%2C+gear%2C++kit%2C+carb%2C+exhaust%2C+crankase%2C++gears%2C++kits%2C+carbs%2C+exhausts%2C+crankases%2C+reed+valves%2C+cylinder+heads%2C+crank%2C+wombat+serie%2C+double+intake%2C+oldtimers%2C+LC+proto%2C+leak+down+test%2C+conversion%2C+carb%2C+clutch++++';
var metaContents  = 'power+for+engines+';
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();
};

