/* [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/index.html','true',[ 
		['PAGE','573',jdecode('SPECIALS'),jdecode(''),'/501/573.html','false',[],'','']
	],'',''],
	['PAGE','74501',jdecode('Equipment'),jdecode(''),'/74501/index.html','false',[ 
		['PAGE','73801',jdecode('Enquiry+Form'),jdecode(''),'/74501/73801.html','true',[],'',''],
		['PAGE','13601',jdecode('FT+25+Series'),jdecode(''),'/74501/13601.html','false',[],'',''],
		['PAGE','66401',jdecode('FT40+Series'),jdecode(''),'/74501/66401.html','true',[],'',''],
		['PAGE','66422',jdecode('FT+60+Series'),jdecode(''),'/74501/66422.html','true',[],'',''],
		['PAGE','66443',jdecode('FT+80+Series'),jdecode(''),'/74501/66443.html','true',[],'',''],
		['PAGE','66485',jdecode('FT100+Series'),jdecode(''),'/74501/66485.html','false',[],'',''],
		['PAGE','81401',jdecode('Implements'),jdecode(''),'/74501/81401.html','true',[],'',''],
		['PAGE','66464',jdecode('Used+Equipment'),jdecode(''),'/74501/66464.html','true',[],'',''],
		['PAGE','71501',jdecode('Photo+Gallery'),jdecode(''),'/74501/71501.html','false',[],'','']
	],'',''],
	['PAGE','67801',jdecode('Parts+%26+Service'),jdecode(''),'/67801.html','false',[],'',''],
	['PAGE','66822',jdecode('References'),jdecode(''),'/66822/index.html','false',[ 
		['PAGE','66843',jdecode('Projects'),jdecode(''),'/66822/66843.html','true',[],'',''],
		['PAGE','66864',jdecode('Partners'),jdecode(''),'/66822/66864.html','true',[],'',''],
		['PAGE','66885',jdecode('Competitions'),jdecode(''),'/66822/66885.html','true',[],'','']
	],'',''],
	['PAGE','66801',jdecode('About+us'),jdecode(''),'/66801.html','false',[],'',''],
	['PAGE','66506',jdecode('Contact+Us'),jdecode(''),'/66506/index.html','true',[ 
		['PAGE','66527',jdecode('How+to+find+us'),jdecode(''),'/66506/66527.html','true',[],'',''],
		['PAGE','73822',jdecode('Contact+Form'),jdecode(''),'/66506/73822.html','true',[],'','']
	],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Animal';
theSitetree.paletteFamily='3468BD';
theSitetree.keyvisualId='4311';
theSitetree.keyvisualName='kv_4311.jpg';
theSitetree.fontsetId='10789';
theSitetree.graphicsetId='11209';
theSitetree.contentColor='313F73';
theSitetree.contentBGColor='D8E0ED';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Animal',
				paletteFamily: 	'3468BD',
				keyvisualId: 	'4311',
				keyvisualName: 	'kv_4311.jpg',
				fontsetId: 		'10789',
				graphicsetId: 	'11209',
				contentColor: 	'313F73',
				contentBGColor: 'D8E0ED',
				a_color: 		'3468BD',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-793']={
webappId:    '7008',
documentId:  '573',
internalId:  '793',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81401',
internalId:  '',
customField: '20090517-191109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66864',
internalId:  '',
customField: '20090209-185644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100406-044335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74501',
internalId:  '',
customField: '20100324-222416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13601',
internalId:  '',
customField: '20090517-190013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20100324-222358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66801',
internalId:  '',
customField: '20090518-131901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66401',
internalId:  '',
customField: '20090702-183116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66422',
internalId:  '',
customField: '20090809-075442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66443',
internalId:  '',
customField: '20090518-132051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66464',
internalId:  '',
customField: '20100324-222921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66485',
internalId:  '',
customField: '20090209-184647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66506',
internalId:  '',
customField: '20090407-130313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66527',
internalId:  '',
customField: '20090517-193536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67801',
internalId:  '',
customField: '20090423-061656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66822',
internalId:  '',
customField: '20090209-185644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66843',
internalId:  '',
customField: '20090209-185644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66885',
internalId:  '',
customField: '20090209-185644'
};
webappMappings['7060']=webappMappings['7060-819e9f0fe169ef72d680747ec1ea9b9b']={
webappId:    '7060',
documentId:  '71501',
internalId:  '819e9f0fe169ef72d680747ec1ea9b9b',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71501',
internalId:  '',
customField: '20090212-151829'
};
webappMappings['7008']=webappMappings['7008-253']={
webappId:    '7008',
documentId:  '73801',
internalId:  '253',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-254']={
webappId:    '7008',
documentId:  '73822',
internalId:  '254',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73801',
internalId:  '',
customField: '20090215-182212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73822',
internalId:  '',
customField: '20090215-181729'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INZKK9';
var companyName   = 'Davmac+Agencies';
var htmlTitle	  = 'Davmac+Agencies+for+Euroleopard+tractors';
var metaKeywords  = '+Tractors%2C+Euroleopard%2C+Agriboss+tractors%2C+Agriboss+Hunter+Valley%2C+davmac%2C+davmacagencies+davmacagencies.com.au%2C++Gary+Davey%2C+euroleopard+tractor%2C+small+farm%2C+acreage+tractors%2C+Tractors+sold+and+serviced+in+the+hunter+valley.+cheap+tractors%2C+chinese+tractors%2C+Also+slashers+and+post+hole+diggers+including+used+equipment+as+well.+Maitland%2C+Raymond+terrace%2C+Newcastle%2C+Duckenfield%2C+Finance+can+be+arranged+on+all+';
var metaContents  = '+euroleopard+tractor%2F++Agriboss+Tractors+sold+and+serviced+in+the+hunter+valley.+Also+slashers+and+post+hole+diggers+including+used+equipment+as+well%2C+small+farm+tractors+and+implements%2C+Finance+can+be+arranged+on+all+equipment%2C+Tractor%2C+euroleopard+tractors%2C+hunter+valley%2C+maitland%2C+newcastle%2C+raymond+terrace%2C+duckenfield%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();
};
