/* [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 theSitetree=[ 
	['PAGE','44001',jdecode('Home'),jdecode(''),'/44001.html','true',[],''],
	['PAGE','2822',jdecode('Introduction'),jdecode(''),'/2822.html','true',[],''],
	['PAGE','28701',jdecode('Red+Palm+Weevil'),jdecode(''),'/28701.html','true',[],''],
	['PAGE','601',jdecode('Novelties'),jdecode(''),'/601.html','true',[],''],
	['PAGE','2864',jdecode('Projects'),jdecode(''),'/2864.html','true',[],''],
	['PAGE','2885',jdecode('Garden+Centre'),jdecode(''),'/2885.html','true',[],''],
	['PAGE','13601',jdecode('Order+Flowers+Online'),jdecode(''),'/13601.html','true',[],''],
	['PAGE','13622',jdecode('Plant+Database'),jdecode(''),'/13622.html','true',[],''],
	['PAGE','2801',jdecode('Long+Flowering+Gardens'),jdecode(''),'/2801.html','true',[],''],
	['PAGE','57001',jdecode('Shrubs+and+climbers+for+colour'),jdecode(''),'/57001.html','true',[],''],
	['PAGE','55501',jdecode('Roof+Gardens'),jdecode(''),'/55501.html','true',[],''],
	['PAGE','59001',jdecode('Landscaping+a+courtyard'),jdecode(''),'/59001.html','true',[],''],
	['PAGE','60201',jdecode('Health+benefits+of+office+plants'),jdecode(''),'/60201.html','true',[],''],
	['PAGE','3401',jdecode('ELC'),jdecode(''),'/3401.html','true',[],''],
	['PAGE','2969',jdecode('Contact'),jdecode(''),'/2969.html','true',[],''],
	['PAGE','2606',jdecode('Guestbook'),jdecode(''),'/2606/index.html','true',[ 
		['PAGE','2601',jdecode('Read+Guestbook'),jdecode(''),'/2606/2601.html','false',[],'']
	],''],
	['PAGE','55901',jdecode('How+to+find+us'),jdecode(''),'/55901.html','true',[],''],
	['PAGE','47201',jdecode('News'),jdecode(''),'/47201.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Mazy';
theSitetree.paletteFamily='934644';
theSitetree.keyvisualId='11099';
theSitetree.keyvisualName='kv_11099.jpg';
theSitetree.fontsetId='31988';
theSitetree.graphicsetId='13822';
theSitetree.contentColor='3C3D3C';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Mazy',
				paletteFamily: 	'934644',
				keyvisualId: 	'11099',
				keyvisualName: 	'kv_11099.jpg',
				fontsetId: 		'31988',
				graphicsetId: 	'13822',
				contentColor: 	'3C3D3C',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44001',
internalId:  '',
customField: '20100511-022657'
};
webappMappings['1002']=webappMappings['1002-2606aendu0inxx2h']={
webappId:    '1002',
documentId:  '2606',
internalId:  '2606aendu0inxx2h',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55901',
internalId:  '',
customField: '20100505-024615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57001',
internalId:  '',
customField: '20100505-075610'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '44001',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2822',
internalId:  '',
customField: '20090423-060643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2969',
internalId:  '',
customField: '20080314-102250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28701',
internalId:  '',
customField: '20071027-120744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20090428-091949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20100505-080044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2864',
internalId:  '',
customField: '20071012-031431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2885',
internalId:  '',
customField: '20071012-030837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13601',
internalId:  '',
customField: '20071009-033453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13622',
internalId:  '',
customField: '20091110-021142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20100203-161333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2606',
internalId:  '',
customField: '20070903-062458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20070903-062458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55501',
internalId:  '',
customField: '20100504-093543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47201',
internalId:  '',
customField: '20091021-055050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59001',
internalId:  '',
customField: '20100505-082907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60201',
internalId:  '',
customField: '20100519-091247'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INXX2H';
var companyName   = 'Calamatta+Landscapes+Ltd';
var htmlTitle	  = 'Calamatta+Landscapes+Ltd';
var metaKeywords  = 'calamatta+malta+tree+landscaping+carlos+herman+scifo+florian+palm+flower+flowers+garden+peter+calamattalandscapes+elc+consortium+bush+shrub+annual+seasonal';
var metaContents  = '';
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();
};
