/* [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','6001',jdecode('Home'),jdecode(''),'/6001.html','true',[],'',''],
	['PAGE','6052',jdecode('About+us'),jdecode(''),'/6052/index.html','true',[ 
		['PAGE','6601',jdecode('What+We+Do'),jdecode(''),'/6052/6601.html','true',[],'',''],
		['PAGE','6115',jdecode('The+Team'),jdecode(''),'/6052/6115.html','true',[],'',''],
		['PAGE','6094',jdecode('Contact+Details'),jdecode(''),'/6052/6094.html','true',[],'','']
	],'',''],
	['PAGE','8701',jdecode('Almac+427+SC+Replica'),jdecode(''),'/8701/index.html','true',[ 
		['PAGE','7101',jdecode('Kitset+Stages+%26+Costs'),jdecode(''),'/8701/7101.html','true',[],'',''],
		['PAGE','26401',jdecode('Component+Price+List'),jdecode(''),'/8701/26401.html','true',[],'',''],
		['PAGE','6622',jdecode('Specifications'),jdecode(''),'/8701/6622.html','true',[],'',''],
		['PAGE','13101',jdecode('Gallery'),jdecode(''),'/8701/13101.html','true',[],'',''],
		['PAGE','10501',jdecode('For+Sale'),jdecode(''),'/8701/10501.html','true',[],'','']
	],'',''],
	['PAGE','31801',jdecode('427+Parts+Catalogue'),jdecode(''),'/31801/index.html','true',[ 
		['PAGE','40101',jdecode('Bumpers'),jdecode(''),'/31801/40101.html','true',[],'',''],
		['PAGE','41001',jdecode('Chassis'),jdecode(''),'/31801/41001.html','true',[],'',''],
		['PAGE','35501',jdecode('Emblems+and+Accessories'),jdecode(''),'/31801/35501.html','true',[],'',''],
		['PAGE','41301',jdecode('Exhaust'),jdecode(''),'/31801/41301.html','true',[],'',''],
		['PAGE','41601',jdecode('Fuel+Tank'),jdecode(''),'/31801/41601.html','true',[],'',''],
		['PAGE','41622',jdecode('Lights'),jdecode(''),'/31801/41622.html','true',[],'',''],
		['PAGE','42601',jdecode('Windscreen'),jdecode(''),'/31801/42601.html','true',[],'','']
	],'',''],
	['PAGE','12401',jdecode('General+Parts'),jdecode(''),'/12401.html','true',[],'',''],
	['PAGE','6643',jdecode('Dragsters%2C+Rods%2C+Racecars'),jdecode(''),'/6643.html','true',[],'',''],
	['PAGE','14101',jdecode('Jet+Sprints'),jdecode(''),'/14101/index.html','true',[ 
		['PAGE','20801',jdecode('Whats+On'),jdecode(''),'/14101/20801.html','true',[],'','']
	],'',''],
	['PAGE','18201',jdecode('Cobra+Club+of+NZ'),jdecode(''),'/18201.html','true',[],'',''],
	['PAGE','6685',jdecode('Forum%2Fchat+room'),jdecode(''),'/6685.html','true',[],'',''],
	['PAGE','45457',jdecode('General+Gallery'),jdecode(''),'/45457.html','true',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Blades';
theSitetree.paletteFamily='686869';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='31705';
theSitetree.graphicsetId='13468';
theSitetree.contentColor='242424';
theSitetree.contentBGColor='767676';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blades',
				paletteFamily: 	'686869',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'31705',
				graphicsetId: 	'13468',
				contentColor: 	'242424',
				contentBGColor: '767676',
				a_color: 		'000000',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20100407-192755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6052',
internalId:  '',
customField: '20100407-165122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20100113-215522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6094',
internalId:  '',
customField: '20100214-195313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6115',
internalId:  '',
customField: '20100113-213522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20100113-213404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6622',
internalId:  '',
customField: '20100113-214451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6643',
internalId:  '',
customField: '20100113-215704'
};
webappMappings['1003']=webappMappings['1003-avfl30inpxgt1237df8449b']={
webappId:    '1003',
documentId:  '6685',
internalId:  'avfl30inpxgt1237df8449b',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6685',
internalId:  '',
customField: '20100113-220304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20100113-214304'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20100113-214146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31801',
internalId:  '',
customField: '20100113-214802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20100204-213908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20100113-214604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20100113-220102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20100113-220227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20801',
internalId:  '',
customField: '20100113-220147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26401',
internalId:  '',
customField: '20100113-214352'
};
webappMappings['7060']=webappMappings['7060-4c84caf811c992db2d7eb1abc086164e']={
webappId:    '7060',
documentId:  '45457',
internalId:  '4c84caf811c992db2d7eb1abc086164e',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35501',
internalId:  '',
customField: '20100113-214950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40101',
internalId:  '',
customField: '20100113-214838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41001',
internalId:  '',
customField: '20100113-214912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41301',
internalId:  '',
customField: '20100113-215027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41601',
internalId:  '',
customField: '20100113-215058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41622',
internalId:  '',
customField: '20100113-215200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42601',
internalId:  '',
customField: '20100113-215423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45457',
internalId:  '',
customField: '20100113-220422'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INPXGT';
var companyName   = 'KiwiRaceCars.com+Ltd.';
var htmlTitle	  = 'Almac+427+SC+Replica';
var metaKeywords  = '';
var metaContents  = '';
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();
};
