/* [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','4555',jdecode('HOME'),jdecode(''),'/4555.html','true',[],'',''],
	['PAGE','42489',jdecode('ABOUT+US'),jdecode(''),'/42489.html','true',[],'',''],
	['PAGE','42114',jdecode('CONTACT+US'),jdecode(''),'/42114.html','true',[],'',''],
	['PAGE','5602',jdecode('ROBBIES+NZ+TOURS'),jdecode(''),'/5602.html','true',[],'',''],
	['PAGE','5656',jdecode('ROBBIES+FUN+BUS'),jdecode(''),'/5656.html','true',[],'',''],
	['PAGE','41855',jdecode('Christmas+Options'),jdecode(''),'/41855.html','true',[],'',''],
	['PAGE','5764',jdecode('FUNCTIONS'),jdecode(''),'/5764/index.html','true',[ 
		['PAGE','19932',jdecode('Tavern-Crawl'),jdecode(''),'/5764/19932.html','true',[],'',''],
		['PAGE','19959',jdecode('Vineyard+Tours'),jdecode(''),'/5764/19959.html','true',[],'',''],
		['PAGE','19986',jdecode('Progressive+Dinner'),jdecode(''),'/5764/19986.html','true',[],'',''],
		['PAGE','20013',jdecode('Murder+Mystery+Buffet'),jdecode(''),'/5764/20013.html','true',[],'',''],
		['PAGE','21034',jdecode('Tiki+Tour'),jdecode(''),'/5764/21034.html','true',[],'',''],
		['PAGE','21061',jdecode('Comedy+Evening'),jdecode(''),'/5764/21061.html','true',[],'',''],
		['PAGE','21088',jdecode('Bowling+Nights'),jdecode(''),'/5764/21088.html','true',[],'',''],
		['PAGE','41864',jdecode('Spookers'),jdecode(''),'/5764/41864.html','true',[],'','']
	],'',''],
	['PAGE','21732',jdecode('WEDDINGS'),jdecode(''),'/21732.html','true',[],'',''],
	['PAGE','26197',jdecode('WAIHEKE'),jdecode(''),'/26197.html','true',[],'',''],
	['PAGE','51723',jdecode('WAIHEKE+EVENTS+2010'),jdecode(''),'/51723.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Trend';
theSitetree.paletteFamily='3F70CF';
theSitetree.keyvisualId='7928';
theSitetree.keyvisualName='kv_7928.jpg';
theSitetree.fontsetId='16910';
theSitetree.graphicsetId='12323';
theSitetree.contentColor='163D88';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Trend',
				paletteFamily: 	'3F70CF',
				keyvisualId: 	'7928',
				keyvisualName: 	'kv_7928.jpg',
				fontsetId: 		'16910',
				graphicsetId: 	'12323',
				contentColor: 	'163D88',
				contentBGColor: 'FFFFFF',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4555',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4555',
internalId:  '',
customField: '20091124-235521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5602',
internalId:  '',
customField: '20091203-172645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5656',
internalId:  '',
customField: '20091203-170938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5764',
internalId:  '',
customField: '20090922-164533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19932',
internalId:  '',
customField: '20091203-171906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19959',
internalId:  '',
customField: '20090823-203907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19986',
internalId:  '',
customField: '20090823-204019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20013',
internalId:  '',
customField: '20090823-204121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21034',
internalId:  '',
customField: '20090823-204243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21061',
internalId:  '',
customField: '20090823-204525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21732',
internalId:  '',
customField: '20091203-172441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26197',
internalId:  '',
customField: '20091102-202530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42489',
internalId:  '',
customField: '20091104-180409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51723',
internalId:  '',
customField: '20100130-145033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21088',
internalId:  '',
customField: '20090823-204616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41855',
internalId:  '',
customField: '20091104-181252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41864',
internalId:  '',
customField: '20090823-212933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42114',
internalId:  '',
customField: '20091104-180512'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN28YU';
var companyName   = 'Robbies+Double+Decker+Travel';
var htmlTitle	  = 'www.robbiesfunbus.co.nz';
var metaKeywords  = 'Fun+bus%2C+coach+tours%2C+coaches%2C+party+bus%2C+charter+buses%2C+auckland%2C+new+zealand%2C+rotorua%2C+bay+of+islands%2C+north+island%2C+waiheke+island%2C+sight+seeing%2C+transport%2C+transfers%2C+stag%2C+hen%2C+weddings%2C+unique%2C+travel%2C+transport%2C+fun%2C+wine+tours%2C+progressive+dinners%2C+spookers%2C+coach%2C+pub+crawls%2C+conference%2C+corporate%2C+school+tours%2C+safe%2C+children%2C+birthday+parties%2C+kiwi%2C+hire%2C+new+zealand+bus+tours%2C+new+zealand+bus+services%2C+bus+and+coach%2C+new+zealand+buses%2C+bus+and+coach+services%2C+travel%2C+touring%2C+transport%2C+rentals%2C+new+zealand%2C+coach+transport%2C+intercity%2C+hire%2C+new+zealand+tourism%2C+tour%2C+shuttle+service%2C+tours%2C+nz+tour%2C+nz+bus+company%2C+nz+rental%2C+auckland%2C+wellington%2C+bus+companies%2C+tour+company%2C+travel+destination%2C+auckland+bus+services%2C+new+zealand+bus+service%2C+nz+bus+and+coach+transport%2C+auckland+bus+transport%2C+nz+coach+transport%2C+new+zealand+bus+transport%2C+new+zealand+coach+transport%2C+new+zealand+holiday+transport%2C+new+zealand+holiday+tours%2C+red+London+double+decker+bus%2C+soft+top+double+decker+bus%2C+red+London%2C+soft+top%2C+bus+tours+auckland%2C+auckland+transfers%2C+airport+transfers%2C+robbies%2C+show+transfers%2C+event+organisers%2C+event%2C+christmas+functions%2C+school+transport%2C+school+camps%2C+double+decker%2C+double+decker+bus';
var metaContents  = 'Robbies+Double+DeckerTravel+offers+a+unique+range+of+double+decker+buses+and+coaches+with+the+only+red+London+and+soft+top+double+decker+bus+in+Aucikland.+Robbies+organises+fabulous+events+and+transfers+for+Corporates%2C+Conferences%2C+Schools+and+Weddings+as+well+as+tours+in+the+North+Island.';
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();
};
