/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','352',jdecode('Contact'),jdecode(''),'/352.html','true',[],'',''],
	['PAGE','20601',jdecode('Why+Use+A+Limo%3F'),jdecode(''),'/20601.html','true',[],'',''],
	['PAGE','436',jdecode('Take+A+Limo+To'),jdecode(''),'/436/index.html','true',[ 
		['PAGE','12301',jdecode('Dinner+At'),jdecode(''),'/436/12301.html','true',[],'',''],
		['PAGE','457',jdecode('A+Concert%2FShow'),jdecode(''),'/436/457.html','true',[],'',''],
		['PAGE','13101',jdecode('Places+To+Go'),jdecode(''),'/436/13101.html','true',[],'','']
	],'',''],
	['PAGE','7001',jdecode('Photos'),jdecode(''),'/7001.html','true',[],'',''],
	['PAGE','6701',jdecode('Links'),jdecode(''),'/6701.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Vegas';
theSitetree.paletteFamily='686868';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16929';
theSitetree.graphicsetId='12333';
theSitetree.contentColor='FEF943';
theSitetree.contentBGColor='686868';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'true',
				name: 			'Vegas',
				paletteFamily: 	'686868',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16929',
				graphicsetId: 	'12333',
				contentColor: 	'FEF943',
				contentBGColor: '686868',
				a_color: 		'686868',
				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['7060']=webappMappings['7060-9f121b838c0ad37ce4a0626178d90d15']={
webappId:    '7060',
documentId:  '7001',
internalId:  '9f121b838c0ad37ce4a0626178d90d15',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100718-055209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '436',
internalId:  '',
customField: '20100126-170744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20081215-202816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '457',
internalId:  '',
customField: '20081215-201804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20081215-202701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '352',
internalId:  '',
customField: '20100126-170111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20100201-044428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20100224-200013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20091012-052758'
};
webappMappings['7008']=webappMappings['7008-11957']={
webappId:    '7008',
documentId:  '352',
internalId:  '11957',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-15922209']={
webappId:    '1501',
documentId:  '301',
internalId:  '15922209',
customField: '1501'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPUOR';
var companyName   = 'Absolute+Limousine';
var htmlTitle	  = 'Limo+Hire%2CWellington%2Cwairarapa%2CManawatu';
var metaKeywords  = 'Absolute+Limousine+Wedding+hen+party+free+Cabs+Taxi+Shutties+Wine+trail+Theatre+Concert+Casino+Rugby+Cricket+Golf+Races+Dinner+drink+enjoy+tours+Private+Professional+Chauffeured+Wairarapa+Masterton+Martinborough+Greytown+Carterton+Wellington+uniformed+Chauffeur+Corporate+Functions+airport+Hotel+Motel+Rail+Ferry+Transfers+wine+Trails+Tours+Shows+Balls+Special+Occasions+Anniversarys+Birthday+Dinner';
var metaContents  = 'Absolute+Limousine+Wedding+hen+party+free+Cabs+Taxi+Shutties+Wine+trail+Theatre+Concert+Casino+Rugby+Cricket+Golf+Races+Dinner+drink+enjoy+tours+Private+Professional+Chauffeured+Wairarapa+Masterton+Martinborough+Greytown+Carterton+Wellington+uniformed+Chauffeur+Corporate+Functions+airport+Hotel+Motel+Rail+Ferry+Transfers+wine+Trails+Tours+Shows+Balls+Special+Occasions+Anniversarys+Birthday+Dinner';
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();
};
