/* [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','1852',jdecode('About+Cape+Cottages'),jdecode(''), jdecode('%2F1852.html'), 'true',[],'',''],
	['PAGE','1957',jdecode('About+McGregor'),jdecode(''), jdecode('%2F1957.html'), 'true',[],'',''],
	['PAGE','1873',jdecode('Pear+Tree+Cottage'),jdecode(''), jdecode('%2F1873.html'), 'true',[],'',''],
	['PAGE','11701',jdecode('Willow+Cottage'),jdecode(''), jdecode('%2F11701.html'), 'true',[],'',''],
	['PAGE','1936',jdecode('Sunbird+Cottage'),jdecode(''), jdecode('%2F1936.html'), 'true',[],'',''],
	['PAGE','1915',jdecode('Hoopoe+Cottage'),jdecode(''), jdecode('%2F1915.html'), 'true',[],'',''],
	['PAGE','12322',jdecode('Rates+%26+Special+Offers'),jdecode(''), jdecode('%2F12322.html'), 'true',[],'',''],
	['PAGE','3801',jdecode('Booking+Form'),jdecode(''), jdecode('%2F3801.html'), 'true',[],'',''],
	['PAGE','53501',jdecode('Guest+Comments'),jdecode(''), jdecode('%2F53501.html'), 'true',[],'',''],
	['PAGE','13901',jdecode('Why+Live+in+McGregor%3F'),jdecode(''), jdecode('%2F13901.html'), 'true',[],'',''],
	['PAGE','76722',jdecode('Cottages+for+sale+in+McGregor'),jdecode(''), jdecode('%2F76722.html'), 'true',[],'',''],
	['PAGE','76701',jdecode('Business+for+sale+in+McGregor'),jdecode(''), jdecode('%2F76701.html'), 'true',[],'',''],
	['PAGE','12301',jdecode('Things+to+do+in+McGregor'),jdecode(''), jdecode('%2F12301%2Findex.html'), 'true',[ 
		['PAGE','31801',jdecode('Hiking'),jdecode(''), jdecode('%2F12301%2F31801.html'), 'true',[],'',''],
		['PAGE','38901',jdecode('Rhebokskraal+Olive+Estate'),jdecode(''), jdecode('%2F12301%2F38901.html'), 'true',[],'',''],
		['PAGE','21143',jdecode('Lords'),jdecode(''), jdecode('%2F12301%2F21143.html'), 'false',[],'',''],
		['PAGE','21122',jdecode('McGregor+Winery'),jdecode(''), jdecode('%2F12301%2F21122.html'), 'false',[],'',''],
		['PAGE','21101',jdecode('Tanagra'),jdecode(''), jdecode('%2F12301%2F21101.html'), 'false',[],'',''],
		['PAGE','21164',jdecode('Wolfdoring'),jdecode(''), jdecode('%2F12301%2F21164.html'), 'false',[],'',''],
		['PAGE','38922',jdecode('Kings+River+Estate'),jdecode(''), jdecode('%2F12301%2F38922.html'), 'false',[],'','']
	],'',''],
	['PAGE','76001',jdecode('Quirky+McGregor+Info%21'),jdecode(''), jdecode('%2F76001.html'), 'false',[],'',''],
	['PAGE','13301',jdecode('Forthcoming+Events'),jdecode(''), jdecode('%2F13301.html'), 'false',[],'',''],
	['PAGE','38943',jdecode('Temenos+Retreat'),jdecode(''), jdecode('%2F38943.html'), 'false',[],'',''],
	['PAGE','34401',jdecode('The+Edna+Fourie+Gallery'),jdecode(''), jdecode('%2F34401.html'), 'false',[],'',''],
	['PAGE','13222',jdecode('Wine+Tasting'),jdecode(''), jdecode('%2F13222.html'), 'false',[],'',''],
	['PAGE','1999',jdecode('Restaurants'),jdecode(''), jdecode('%2F1999%2Findex.html'), 'true',[ 
		['PAGE','36801',jdecode('Cafe+Tebaldi%26%23x27%3Bs+Restaurant'),jdecode(''), jdecode('%2F1999%2F36801.html'), 'true',[],'',''],
		['PAGE','58801',jdecode('Eseltjiesrus+Country+Kitchen'),jdecode(''), jdecode('%2F1999%2F58801.html'), 'true',[],'',''],
		['PAGE','68201',jdecode('Frangipani+Restaurant'),jdecode(''), jdecode('%2F1999%2F68201.html'), 'true',[],'',''],
		['PAGE','49001',jdecode('Kingsriver+Estate+Restaurant'),jdecode(''), jdecode('%2F1999%2F49001.html'), 'true',[],'',''],
		['PAGE','59701',jdecode('Green+Gables+Mill+House'),jdecode(''), jdecode('%2F1999%2F59701.html'), 'false',[],'','']
	],'',''],
	['PAGE','71201',jdecode('The+McGregor+Guesthouse'),jdecode(''), jdecode('%2F71201%2Findex.html'), 'false',[ 
		['PAGE','73101',jdecode('Restaurant+of+the+Month'),jdecode(''), jdecode('%2F71201%2F73101.html'), 'true',[],'','']
	],'',''],
	['PAGE','35401',jdecode('Restaurants+Close+By'),jdecode(''), jdecode('%2F35401.html'), 'false',[],'',''],
	['PAGE','21701',jdecode('Shops'),jdecode(''), jdecode('%2F21701.html'), 'true',[],'',''],
	['PAGE','20701',jdecode('McGregor+Donkey+Sanctuary'),jdecode(''), jdecode('%2F20701.html'), 'false',[],'',''],
	['PAGE','34422',jdecode('Cobbing'),jdecode(''), jdecode('%2F34422.html'), 'false',[],'',''],
	['PAGE','44601',jdecode('Special+Occasions'),jdecode(''), jdecode('%2F44601.html'), 'true',[],'',''],
	['PAGE','19501',jdecode('%22Win+a+Weekend%22'),jdecode(''), jdecode('%2F19501.html'), 'false',[],'',''],
	['PAGE','40401',jdecode('Travel+Links'),jdecode(''), jdecode('%2F40401.html'), 'true',[],'',''],
	['PAGE','54101',jdecode('Restaurant+of+the+Month'),jdecode(''), jdecode('%2F54101.html'), 'false',[],'',''],
	['PAGE','76401',jdecode('Photo+Album'),jdecode(''), jdecode('%2F76401.html'), 'true',[],'','']];
var siteelementCount=42;
theSitetree.topTemplateName='Gaudy';
theSitetree.paletteFamily='207247';
theSitetree.keyvisualId='5937';
theSitetree.keyvisualName='kv_5937.jpg';
theSitetree.fontsetId='11113';
theSitetree.graphicsetId='11906';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5CB184';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hetzner',
  product: 'WSCSYSSSSLY0XKDS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Gaudy',
				paletteFamily: 	'207247',
				keyvisualId: 	'5937',
				keyvisualName: 	'kv_5937.jpg',
				fontsetId: 		'11113',
				graphicsetId: 	'11906',
				contentColor: 	'FFFFFF',
				contentBGColor: '5CB184',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20120101-210340'
};
webappMappings['7008']=webappMappings['7008-478']={
webappId:    '7008',
documentId:  '3801',
internalId:  '478',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20120101-212334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20120101-210919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1957',
internalId:  '',
customField: '20120101-210647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1936',
internalId:  '',
customField: '20120101-211344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1999',
internalId:  '',
customField: '20120101-214307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1915',
internalId:  '',
customField: '20120101-211736'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1852',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11701',
internalId:  '',
customField: '20120101-211116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20120101-213629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12322',
internalId:  '',
customField: '20120101-212038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20090707-165114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13222',
internalId:  '',
customField: '20080704-161421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20120101-212704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20100225-203718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31801',
internalId:  '',
customField: '20090426-121946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34401',
internalId:  '',
customField: '20080730-213258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20080704-161538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21701',
internalId:  '',
customField: '20120101-214910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20080704-162230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21122',
internalId:  '',
customField: '20080704-162308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21143',
internalId:  '',
customField: '20080704-162343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21164',
internalId:  '',
customField: '20080704-162456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34422',
internalId:  '',
customField: '20080730-213258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35401',
internalId:  '',
customField: '20080820-222852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36801',
internalId:  '',
customField: '20120101-214533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38901',
internalId:  '',
customField: '20080804-162934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38922',
internalId:  '',
customField: '20080804-162934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38943',
internalId:  '',
customField: '20080804-162934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40401',
internalId:  '',
customField: '20080806-144234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44601',
internalId:  '',
customField: '20120101-201823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49001',
internalId:  '',
customField: '20100416-225738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53501',
internalId:  '',
customField: '20120101-212517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54101',
internalId:  '',
customField: '20081229-163943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58801',
internalId:  '',
customField: '20100416-225007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59701',
internalId:  '',
customField: '20090213-133435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68201',
internalId:  '',
customField: '20120101-201556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71201',
internalId:  '',
customField: '20090719-141703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73101',
internalId:  '',
customField: '20091012-112345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76001',
internalId:  '',
customField: '20091210-183922'
};
webappMappings['7060']=webappMappings['7060-3d48fc10d4c198839961f0fa17bd1d87']={
webappId:    '7060',
documentId:  '76401',
internalId:  '3d48fc10d4c198839961f0fa17bd1d87',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76701',
internalId:  '',
customField: '20120101-213155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76722',
internalId:  '',
customField: '20120101-213304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76401',
internalId:  '',
customField: '20091215-133154'
};
var webAppHostname = 'sitebuilder.host-h.net:80';
var canonHostname = 'sitebuilder1.jnb2.host-h.net';
var accountId     = 'AHTZ10INX3UH';
var companyName   = 'CAPE+COTTAGES+McGREGOR';
var htmlTitle	  = 'CAPE+COTTAGES+McGREGOR+-+Luxury+Country+Holiday+Cottages';
var metaKeywords  = 'McGregor+country+cottages%2C+holiday%2C+self+catering%2C+McGregor+accommodation%2C+Macgregor%2C+acomodation%2C+accomodation%2C+luxury%2C+luxurious%2C+upmarket+accommodation%2C+McGregor+restaurants%2C+eating%2C+coffe+shops%2C+things+to+do%2C+wine+tasting%2C+art%2C+wine%2C+pottery%2C+food%2C+hiking%2C+bird+watching';
var metaContents  = 'McGregor+Accommodation+-+Cape+Cottages+McGregor+upmarket+self+catering+holiday+cottages+for+couples';
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();
};

