/* [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','10701',jdecode('Home'),jdecode(''), jdecode('%2F10701.html'), 'true',[],'',''],
	['PAGE','55912',jdecode('SPECIALS'),jdecode(''), jdecode('%2F55912.html'), 'true',[],'',''],
	['PAGE','3752',jdecode('Products'),jdecode(''), jdecode('%2F3752.html'), 'true',[],'',''],
	['PAGE','3773',jdecode('Contact+%26+Hrs+Open'),jdecode(''), jdecode('%2F3773.html'), 'true',[],'',''],
	['PAGE','57512',jdecode('Gardening+Courses'),jdecode(''), jdecode('%2F57512.html'), 'true',[],'',''],
	['PAGE','59312',jdecode('Melb+Water+Stage+1'),jdecode(''), jdecode('%2F59312.html'), 'true',[],'',''],
	['PAGE','11401',jdecode('Instant+Lawns+%28Pre-Grown%29'),jdecode(''), jdecode('%2F11401.html'), 'true',[],'',''],
	['PAGE','31001',jdecode('Artificial+Grass'),jdecode(''), jdecode('%2F31001.html'), 'true',[],'',''],
	['PAGE','21001',jdecode('Build+Raised+Veggie+Garden'),jdecode(''), jdecode('%2F21001.html'), 'true',[],'',''],
	['PAGE','10815',jdecode('Raised+Veggie+Garden+Pics'),jdecode(''), jdecode('%2F10815.html'), 'true',[],'',''],
	['PAGE','10878',jdecode('Veggie+Seed+Planting+Guide'),jdecode(''), jdecode('%2F10878.html'), 'true',[],'',''],
	['PAGE','10857',jdecode('Companion+Planting+%26+Guide'),jdecode(''), jdecode('%2F10857%2Findex.html'), 'true',[ 
		['PAGE','35201',jdecode('Tomatoes+%26+Asparagus'),jdecode(''), jdecode('%2F10857%2F35201.html'), 'true',[],'','']
	],'',''],
	['PAGE','10836',jdecode('Crop+Rotation'),jdecode(''), jdecode('%2F10836.html'), 'true',[],'',''],
	['PAGE','11422',jdecode('Mulching'),jdecode(''), jdecode('%2F11422.html'), 'true',[],'',''],
	['PAGE','3701',jdecode('Sustainable+Firewood'),jdecode(''), jdecode('%2F3701.html'), 'true',[],'',''],
	['PAGE','32901',jdecode('Calculators+-Soil-Mulch+etc'),jdecode(''), jdecode('%2F32901.html'), 'true',[],'',''],
	['PAGE','49212',jdecode('Gardening+with+a+Disability'),jdecode(''), jdecode('%2F49212.html'), 'true',[],'',''],
	['PAGE','10899',jdecode('Kids+Gardening'),jdecode(''), jdecode('%2F10899%2Findex.html'), 'true',[ 
		['PAGE','42701',jdecode('How+to+make+Scarecrow'),jdecode(''), jdecode('%2F10899%2F42701.html'), 'true',[],'',''],
		['PAGE','44601',jdecode('Kids+Garden+Projects'),jdecode(''), jdecode('%2F10899%2F44601.html'), 'true',[],'',''],
		['PAGE','45701',jdecode('Kids+Fun+Garden+Pics'),jdecode(''), jdecode('%2F10899%2F45701.html'), 'true',[],'','']
	],'',''],
	['PAGE','10920',jdecode('Privacy+Policy'),jdecode(''), jdecode('%2F10920.html'), 'true',[],'',''],
	['PAGE','62212',jdecode('Pogs+Forum'),jdecode(''), jdecode('%2F62212.html'), 'true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Trade';
theSitetree.paletteFamily='6E6E6E';
theSitetree.keyvisualId='12121';
theSitetree.keyvisualName='kv_12121.jpg';
theSitetree.fontsetId='33302';
theSitetree.graphicsetId='14171';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'wl_enom',
  product: 'WSCENOSSSLYTC21T'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Trade',
				paletteFamily: 	'6E6E6E',
				keyvisualId: 	'12121',
				keyvisualName: 	'kv_12121.jpg',
				fontsetId: 		'33302',
				graphicsetId: 	'14171',
				contentColor: 	'666666',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3701',
internalId:  '',
customField: '20111010-055428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3752',
internalId:  '',
customField: '20111112-233849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3773',
internalId:  '',
customField: '20111002-100353'
};
webappMappings['7008']=webappMappings['7008-4885']={
webappId:    '7008',
documentId:  '3773',
internalId:  '4885',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10920',
internalId:  '',
customField: '20111002-101322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20111113-001141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31001',
internalId:  '',
customField: '20111113-001422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32901',
internalId:  '',
customField: '20111010-045740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20111008-051245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20111008-045650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10815',
internalId:  '',
customField: '20111113-001555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10899',
internalId:  '',
customField: '20111113-015300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10836',
internalId:  '',
customField: '20111010-045045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10857',
internalId:  '',
customField: '20111006-083541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10878',
internalId:  '',
customField: '20111002-100915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11422',
internalId:  '',
customField: '20111010-020900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35201',
internalId:  '',
customField: '20111006-091738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42701',
internalId:  '',
customField: '20111008-085647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44601',
internalId:  '',
customField: '20111113-020028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45701',
internalId:  '',
customField: '20111007-072617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49212',
internalId:  '',
customField: '20111008-082441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55912',
internalId:  '',
customField: '20111113-000441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57512',
internalId:  '',
customField: '20111124-141201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59312',
internalId:  '',
customField: '20111130-220931'
};
webappMappings['1003']=webappMappings['1003-aen340inpop2133f902656a']={
webappId:    '1003',
documentId:  '62212',
internalId:  'aen340inpop2133f902656a',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62212',
internalId:  '',
customField: '20111201-014403'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN340INPOP2';
var companyName   = 'Park+Orchards+Garden+%26+Building+Supplies';
var htmlTitle	  = 'PARK+ORCHARDS+GARDEN+%26+BUILDING+SUPPLIES+-+OPEN+7+days+Ph%3A+%2803%29+9876-1751';
var metaKeywords  = '';
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();
};

