/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','5101',jdecode('Location'),jdecode(''),'/5101.html','true',[],'',''],
	['PAGE','6901',jdecode('Your+lodge'),jdecode(''),'/6901.html','true',[],'',''],
	['PAGE','33201',jdecode('At+a+glance'),jdecode(''),'/33201.html','true',[],'',''],
	['PAGE','5227',jdecode('Our+neighbourhood'),jdecode(''),'/5227.html','true',[],'',''],
	['PAGE','5269',jdecode('Tariff+and+conditions'),jdecode(''),'/5269.html','true',[],'',''],
	['PAGE','50985',jdecode('Specials%21'),jdecode(''),'/50985.html','true',[],'',''],
	['PAGE','43085',jdecode('Allow+me+to+drive%21'),jdecode(''),'/43085.html','true',[],'',''],
	['PAGE','5311',jdecode('Bookings'),jdecode(''),'/5311.html','true',[],'',''],
	['PAGE','7501',jdecode('How+to+find+us'),jdecode(''),'/7501.html','true',[],'',''],
	['PAGE','31801',jdecode('Ohariu+Lodge+images'),jdecode(''),'/31801.html','true',[],'',''],
	['PAGE','14401',jdecode('Wellington+images'),jdecode(''),'/14401.html','true',[],'',''],
	['PAGE','41185',jdecode('Guest+comments'),jdecode(''),'/41185.html','true',[],'',''],
	['PAGE','5248',jdecode('Wellington+and+NZ+links'),jdecode(''),'/5248.html','true',[],'',''],
	['PAGE','5374',jdecode('Contact+us'),jdecode(''),'/5374.html','true',[],'',''],
	['PAGE','28901',jdecode('Other+good+places+to+stay'),jdecode(''),'/28901.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Clean';
theSitetree.paletteFamily='B5B5B5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33270';
theSitetree.graphicsetId='14153';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Clean',
				paletteFamily: 	'B5B5B5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33270',
				graphicsetId: 	'14153',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'787878',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-2e57aee99bc2d8f2db23a2dd982c50ee']={
webappId:    '7060',
documentId:  '14401',
internalId:  '2e57aee99bc2d8f2db23a2dd982c50ee',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-8143876']={
webappId:    '1501',
documentId:  '501',
internalId:  '8143876',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-b3bea1837146f4674de3c6e625924bda']={
webappId:    '7060',
documentId:  '31801',
internalId:  'b3bea1837146f4674de3c6e625924bda',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100525-170201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31801',
internalId:  '',
customField: '20080303-164216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20080303-172119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20090429-061825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20091207-215455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33201',
internalId:  '',
customField: '20100214-152520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5227',
internalId:  '',
customField: '20100214-152418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5269',
internalId:  '',
customField: '20100527-212832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5311',
internalId:  '',
customField: '20090828-003618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20100225-210558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5248',
internalId:  '',
customField: '20080328-184745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5374',
internalId:  '',
customField: '20100525-172003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28901',
internalId:  '',
customField: '20080331-183851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41185',
internalId:  '',
customField: '20090305-175650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43085',
internalId:  '',
customField: '20100614-210524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50985',
internalId:  '',
customField: '20100525-163746'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZJF3';
var companyName   = 'OHARIU+LODGE%2C+Wellington%2C+New+Zealand';
var htmlTitle	  = 'Ohariu+Lodge%2C+Wellington%2C+New+Zealand';
var metaKeywords  = 'wellington+accommodation%2C+new+zealand%2C+luxury+lodge%2C+homestay%2C+unique%2C+quaint%2C+private%2C+pretty%2C+peaceful%2C+descriptions%2C+photos%2C+images%2C+information%2C+tariffs%2C+conditions%2C+features%2C+accommodation+options%2C+quality%2C+countryside%2C+near+city%2C+meta+name%3Ddescription+content%3D+an+exclusive%2C+unique+venue+for+conferences%2C+incentives%2C+client+entertainment%2C+weddings+and+other+special+events%2C+Wellington%2C+New+Zealand%2C+NZ%2C+nz%2C+wellington%2C+keywords+content%3DBoomrock%2C+Wellington%2C+New+Zealand%2C+North+Island%2C+country+lodge%2C+tourism%2C+private+function%2C+special+occasions%2C+outdoor+activities%2C+unique+location%2C++Wellington+Accomodation+-+bed+and+breakfast%2C+rural%2C+lifestyle%2C+ohariu+valley%2C+wellington%2C+quiet%2C+farm%2C+animals%2C+boutique%2Cmeta+name%3Ddescription+content%2C+stream%2C+horses%2C+birds%2C+lawn%2C+petanque%2C+southern+hemisphere+sky%2C+sleeping%2C+beds%2C+bedrooms%2C+attractions%2C+things+to+do%2C+ohariu+lodge%2C+private%2C';
var metaContents  = 'descriptions%2C+photos%2C+images%2C+information%2C+tariffs%2C+conditions%2C+features%2C+accommodation+options%2C+ohariu+lodge%2C+self-catering%2C+apartment%2C+Wellington%2C+New+Zealand+accommodation+options.+lodges%2C+resorts%2C+apartments%2C+stream%2C+horses%2C+birds%2C+lawn%2C+petanque%2C+southern+hemisphere+sky%2C+sleeping%2C+beds%2C+bedrooms%2C+attractions%2C+things+to+do%2C+private%2C';
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();
};
