/* [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','1401',jdecode('Home'),jdecode(''),'/1401.html','true',[],'',''],
	['PAGE','2801',jdecode('About+us'),jdecode(''),'/2801.html','true',[],'',''],
	['PAGE','2822',jdecode('Where+Are+We+%3F'),jdecode(''),'/2822.html','true',[],'',''],
	['PAGE','27615',jdecode('Feedback'),jdecode(''),'/27615.html','true',[],'',''],
	['PAGE','31815',jdecode('GIFT+VOUCHERS'),jdecode(''),'/31815.html','true',[],'',''],
	['PAGE','2843',jdecode('Guided+Tours'),jdecode(''),'/2843.html','true',[],'',''],
	['PAGE','2864',jdecode('Whale+Island+Kayaking'),jdecode(''),'/2864.html','true',[],'',''],
	['PAGE','2885',jdecode('Kayak+Hire'),jdecode(''),'/2885.html','true',[],'',''],
	['PAGE','2906',jdecode('Moonlight+Kayaking'),jdecode(''),'/2906.html','true',[],'',''],
	['PAGE','2948',jdecode('School+Programmes'),jdecode(''),'/2948.html','true',[],'',''],
	['PAGE','2969',jdecode('Team+Activities'),jdecode(''),'/2969.html','true',[],'',''],
	['PAGE','2990',jdecode('Introduction+to+Kayaking'),jdecode(''),'/2990.html','true',[],'',''],
	['PAGE','3011',jdecode('A+Place+to+Stay%3F'),jdecode(''),'/3011.html','true',[],'',''],
	['PAGE','3032',jdecode('Multisport+Training'),jdecode(''),'/3032.html','true',[],'',''],
	['PAGE','3053',jdecode('Terra+Firma+Activities'),jdecode(''),'/3053.html','true',[],'',''],
	['PAGE','27636',jdecode('Child+minding+service'),jdecode(''),'/27636.html','true',[],'',''],
	['PAGE','3074',jdecode('Links+'),jdecode(''),'/3074.html','true',[],'',''],
	['PAGE','31836',jdecode('Media+album'),jdecode(''),'/31836.html','true',[],'',''],
	['PAGE','3095',jdecode('Prices'),jdecode(''),'/3095.html','true',[],'',''],
	['PAGE','3116',jdecode('Contact+Us'),jdecode(''),'/3116.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Sober';
theSitetree.paletteFamily='EFD30E';
theSitetree.keyvisualId='3492';
theSitetree.keyvisualName='kv_3492.jpg';
theSitetree.fontsetId='10435';
theSitetree.graphicsetId='10786';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F1FECE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Sober',
				paletteFamily: 	'EFD30E',
				keyvisualId: 	'3492',
				keyvisualName: 	'kv_3492.jpg',
				fontsetId: 		'10435',
				graphicsetId: 	'10786',
				contentColor: 	'000000',
				contentBGColor: 'F1FECE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'EFD30E',
				e_color: 		'707070',
				f_color: 		'979696',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1401',
internalId:  '',
customField: '20100325-061539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2864',
internalId:  '',
customField: '20090804-062239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20091115-045931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2822',
internalId:  '',
customField: '20091001-232507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2843',
internalId:  '',
customField: '20091217-041437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2885',
internalId:  '',
customField: '20091213-034746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2906',
internalId:  '',
customField: '20090602-000722'
};
webappMappings['1002']=webappMappings['1002-27615avfl30inhdaw']={
webappId:    '1002',
documentId:  '27615',
internalId:  '27615avfl30inhdaw',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2948',
internalId:  '',
customField: '20091012-053951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2969',
internalId:  '',
customField: '20090602-001101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2990',
internalId:  '',
customField: '20091005-063500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3011',
internalId:  '',
customField: '20091012-052454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3032',
internalId:  '',
customField: '20090506-015932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3053',
internalId:  '',
customField: '20090506-020149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3074',
internalId:  '',
customField: '20091213-033812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3095',
internalId:  '',
customField: '20100311-192535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3116',
internalId:  '',
customField: '20090616-000338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27615',
internalId:  '',
customField: '20091117-034958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27636',
internalId:  '',
customField: '20091129-231513'
};
webappMappings['7060']=webappMappings['7060-d25651f0dd7ba56c1c761949a8e465be']={
webappId:    '7060',
documentId:  '31836',
internalId:  'd25651f0dd7ba56c1c761949a8e465be',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31815',
internalId:  '',
customField: '20100205-180734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31836',
internalId:  '',
customField: '20091213-035947'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHDAW';
var companyName   = '+Bay+of+Plenty++++++++++New+Zealand';
var htmlTitle	  = 'KG+Kayaks%2C+Ohope+Beach%2C+Whakatane%2C+Bay+of+Plenty%2C+New+Zealand';
var metaKeywords  = 'kayaks%2C+ohope+beach%2C+whakatane%2C+kayak+hire%2C+kayak+tours%2C+guided+tours';
var metaContents  = 'KG+Kayaks+Ohope+Beach+Whakatane+New+Zealand';
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();
};
