/* [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','4606',jdecode('Home'),jdecode(''),'/4606.html','true',[],'',''],
	['PAGE','4717',jdecode('Our+Service'),jdecode(''),'/4717.html','true',[],'',''],
	['PAGE','5095',jdecode('About+us'),jdecode(''),'/5095.html','true',[],'',''],
	['PAGE','4663',jdecode('The+Cars'),jdecode(''),'/4663/index.html','true',[ 
		['PAGE','5782',jdecode('Porsche+911'),jdecode(''),'/4663/5782.html','true',[],'',''],
		['PAGE','5755',jdecode('Triumph+TR6'),jdecode(''),'/4663/5755.html','true',[],'',''],
		['PAGE','22103',jdecode('Austin-Healey+Sprite'),jdecode(''),'/4663/22103.html','true',[],'',''],
		['PAGE','5728',jdecode('Arriving+Soon'),jdecode(''),'/4663/5728.html','true',[],'','']
	],'',''],
	['PAGE','146572',jdecode('Chauffeured+Service'),jdecode(''),'/146572.html','true',[],'',''],
	['PAGE','143486',jdecode('Bridal+Service'),jdecode(''),'/143486.html','true',[],'',''],
	['PAGE','4690',jdecode('Classic+Itineraries'),jdecode(''),'/4690/index.html','true',[ 
		['PAGE','5809',jdecode('3.Kaikoura+By+Coast'),jdecode(''),'/4690/5809.html','true',[],'',''],
		['PAGE','5836',jdecode('1.Akaroa+Escape+'),jdecode(''),'/4690/5836.html','true',[],'',''],
		['PAGE','5863',jdecode('2.Hamner+Alpine+Retreat'),jdecode(''),'/4690/5863.html','true',[],'','']
	],'',''],
	['PAGE','4771',jdecode('Our+Gift+Service'),jdecode(''),'/4771.html','true',[],'',''],
	['PAGE','146367',jdecode('Contact+us'),jdecode(''),'/146367.html','true',[],'',''],
	['PAGE','4744',jdecode('Price+List'),jdecode(''),'/4744.html','true',[],'',''],
	['PAGE','146237',jdecode('Terms+%26+Conditions'),jdecode(''),'/146237.html','true',[],'',''],
	['PAGE','145421',jdecode('Feedback'),jdecode(''),'/145421.html','true',[],'',''],
	['PAGE','119419',jdecode('Photo+Album'),jdecode(''),'/119419.html','true',[],'',''],
	['PAGE','144537',jdecode('Partner+Companies'),jdecode(''),'/144537.html','true',[],'',''],
	['PAGE','133240',jdecode('Links'),jdecode(''),'/133240.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='1D6C89';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='421';
theSitetree.graphicsetId='470';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='1D6C89';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Logg',
				paletteFamily: 	'1D6C89',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'421',
				graphicsetId: 	'470',
				contentColor: 	'DDDDDD',
				contentBGColor: '1D6C89',
				a_color: 		'1D6C89',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-841318']={
webappId:    '1501',
documentId:  '4606',
internalId:  '841318',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4606',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146237',
internalId:  '',
customField: '20090730-052950'
};
webappMappings['7060']=webappMappings['7060-5bc2752384103cc592864965cc84745f']={
webappId:    '7060',
documentId:  '119419',
internalId:  '5bc2752384103cc592864965cc84745f',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-9791']={
webappId:    '7008',
documentId:  '146367',
internalId:  '9791',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4606',
internalId:  '',
customField: '20100713-024653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146367',
internalId:  '',
customField: '20090825-194620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4717',
internalId:  '',
customField: '20100506-042817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5095',
internalId:  '',
customField: '20061026-140804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4663',
internalId:  '',
customField: '20100713-032550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5782',
internalId:  '',
customField: '20100604-032543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5755',
internalId:  '',
customField: '20080115-141529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5728',
internalId:  '',
customField: '20100729-151848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22103',
internalId:  '',
customField: '20070615-031129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143486',
internalId:  '',
customField: '20100408-052852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4690',
internalId:  '',
customField: '20070917-014907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5809',
internalId:  '',
customField: '20070917-014350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5836',
internalId:  '',
customField: '20080319-131619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5863',
internalId:  '',
customField: '20070917-014506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4771',
internalId:  '',
customField: '20091217-044031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4744',
internalId:  '',
customField: '20100713-032153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '145421',
internalId:  '',
customField: '20090330-142550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119419',
internalId:  '',
customField: '20060928-143600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144537',
internalId:  '',
customField: '20100408-050218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133240',
internalId:  '',
customField: '20100813-150036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146572',
internalId:  '',
customField: '20100507-025209'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2GV0';
var companyName   = 'Classic+Car+Experience+Ltd.';
var htmlTitle	  = 'Classic+Car+Hire++New+Zealand';
var metaKeywords  = 'classic+convertible+car+hire+hire+a+convertible+roadster+cabriolet+car+vehicle+experience+hire+rent+rental+rentals+wedding+bridal+scenic+tours+tour+chauffeured+Christchurch+New+Zealand+Triumph+TR6+Porsche+911+Austin+Healey+Sprite++Hanmer+Kaikoura+Akaroa+classic+car+hire+new+zealand+classic+car+rental+new+zealand+classic+car+hire+christchurch+classic+car+hire+nz+convertible+car+hire+roadster+car+hire+Bug+Frog+south+island+sports+car+hire+vintage+hire+a+sports+car+sports+car+hire+';
var metaContents  = 'Classic+rental+cars+NZ.+Hire+a+Porsche+911+cabriolet%2C+TR6+convertible%2C+or+Healey+Bug+Eyed+Sprite+for+the+ultimate+sports+car+hire+experience%21+';
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();
};
