/* [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','1701',jdecode('Home'),jdecode(''), jdecode('%2F1701.html'), 'true',[],'',''],
	['PAGE','7001',jdecode('The+Farm'),jdecode(''), jdecode('%2F7001.html'), 'true',[],'',''],
	['PAGE','7022',jdecode('Our+Services'),jdecode(''), jdecode('%2F7022.html'), 'true',[],'',''],
	['PAGE','7043',jdecode('4H+Projects'),jdecode(''), jdecode('%2F7043.html'), 'true',[],'',''],
	['PAGE','2401',jdecode('Care+for+Goats'),jdecode(''), jdecode('%2F2401.html'), 'true',[],'',''],
	['PAGE','7801',jdecode('Open+Discussion'),jdecode(''), jdecode('%2F7801.html'), 'false',[],'',''],
	['PAGE','61601',jdecode('Of+Intrest'),jdecode(''), jdecode('%2F61601.html'), 'true',[],'',''],
	['PAGE','7822',jdecode('For+Sale'),jdecode(''), jdecode('%2F7822.html'), 'true',[],'',''],
	['PAGE','18401',jdecode('Pictures'),jdecode(''), jdecode('%2F18401.html'), 'true',[],'',''],
	['PAGE','20901',jdecode('Contact+Us'),jdecode(''), jdecode('%2F20901.html'), 'true',[],'',''],
	['PAGE','22401',jdecode('Various+Pictures'),jdecode(''), jdecode('%2F22401.html'), 'false',[],'',''],
	['PAGE','18601',jdecode('Kids'),jdecode(''), jdecode('%2F18601.html'), 'false',[],'',''],
	['PAGE','18901',jdecode('4H'),jdecode(''), jdecode('%2F18901.html'), 'false',[],'',''],
	['PAGE','20101',jdecode('Bucks+and+Does'),jdecode(''), jdecode('%2F20101.html'), 'false',[],'',''],
	['PAGE','24201',jdecode('Habitat'),jdecode(''), jdecode('%2F24201.html'), 'false',[],'',''],
	['PAGE','24222',jdecode('Feeding'),jdecode(''), jdecode('%2F24222.html'), 'false',[],'',''],
	['PAGE','24243',jdecode('Birthing'),jdecode(''), jdecode('%2F24243.html'), 'false',[],'',''],
	['PAGE','24264',jdecode('Health+Care'),jdecode(''), jdecode('%2F24264.html'), 'false',[],'',''],
	['PAGE','23501',jdecode('Hoof+Trimming'),jdecode(''), jdecode('%2F23501.html'), 'false',[],'',''],
	['PAGE','27601',jdecode('Bloat'),jdecode(''), jdecode('%2F27601.html'), 'false',[],'',''],
	['PAGE','45601',jdecode('Solar+Power'),jdecode(''), jdecode('%2F45601.html'), 'false',[],'',''],
	['PAGE','62201',jdecode('Polled'),jdecode(''), jdecode('%2F62201.html'), 'false',[],'',''],
	['PAGE','64701',jdecode('Helping+others'),jdecode(''), jdecode('%2F64701.html'), 'false',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Flowers';
theSitetree.paletteFamily='FCFAA4';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10485';
theSitetree.graphicsetId='11028';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FBFAD0';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Flowers',
				paletteFamily: 	'FCFAA4',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10485',
				graphicsetId: 	'11028',
				contentColor: 	'000000',
				contentBGColor: 'FBFAD0',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'807015',
				e_color: 		'807015',
				f_color: 		'807015',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20111126-141455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20100531-232236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7043',
internalId:  '',
customField: '20091227-194301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20111126-141710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7022',
internalId:  '',
customField: '20110717-000438'
};
webappMappings['7050']=webappMappings['7050-12692']={
webappId:    '7050',
documentId:  '7801',
internalId:  '12692',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20091127-184549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7822',
internalId:  '',
customField: '20111226-201100'
};
webappMappings['7060']=webappMappings['7060-b496118efd3bab1529a4481476dd4a13']={
webappId:    '7060',
documentId:  '20101',
internalId:  'b496118efd3bab1529a4481476dd4a13',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18401',
internalId:  '',
customField: '20111126-144616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20091127-223519'
};
webappMappings['7060']=webappMappings['7060-086238a9f1c80027c3817f375844e314']={
webappId:    '7060',
documentId:  '18601',
internalId:  '086238a9f1c80027c3817f375844e314',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-6021852b45ea28119d3bca8ff0d511ad']={
webappId:    '7060',
documentId:  '18901',
internalId:  '6021852b45ea28119d3bca8ff0d511ad',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20091127-223645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20101',
internalId:  '',
customField: '20091127-223430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22401',
internalId:  '',
customField: '20110221-191656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23501',
internalId:  '',
customField: '20100724-173223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20101004-154144'
};
webappMappings['7008']=webappMappings['7008-23561']={
webappId:    '7008',
documentId:  '20901',
internalId:  '23561',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24201',
internalId:  '',
customField: '20091227-202040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24222',
internalId:  '',
customField: '20091227-210508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24243',
internalId:  '',
customField: '20091128-150352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24264',
internalId:  '',
customField: '20100531-232726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27601',
internalId:  '',
customField: '20100531-232833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64701',
internalId:  '',
customField: '20111226-203325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45601',
internalId:  '',
customField: '20111126-143446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61601',
internalId:  '',
customField: '20111226-201752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62201',
internalId:  '',
customField: '20110717-132733'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INVDXS';
var companyName   = 'Boulder+Creek+Goat+Farm';
var htmlTitle	  = 'Boulder+Creek+Goat+Farm';
var metaKeywords  = 'Goats%2C+dairy+goat+stud+service%2C+goat+care%2C+goats+for+sale%2C+sable+goat%2C+sable+saanen%2C+saanen%2C+ADGA%2C+dairy+goat%2C+milk+goats%2C+goat+milk%2C+goat%27s+milk%2C+goat+doe%2C+goat+buck%2C+4-H%2C+farm+tour%2C+tours%2C+exotic+livestock%2C+rare+breed+goats';
var metaContents  = 'Boulder+Creek+Goat+Farm+breeds+goats%2C+offers+farm+services%2C+tours+and+advice.+We+are+proud+to+provide+high+quality+rare+livestock+and+are+active+participants+in+4-H.';
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();
};

