/* [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','2501',jdecode('Home'),jdecode(''), jdecode('%2F2501.html'), 'true',[],'',''],
	['PAGE','2552',jdecode('Scholarship+Program'),jdecode(''), jdecode('%2F2552.html'), 'true',[],'',''],
	['PAGE','2573',jdecode('Golf+Tournament'),jdecode(''), jdecode('%2F2573.html'), 'true',[],'',''],
	['PAGE','2594',jdecode('School+Calendar'),jdecode(''), jdecode('%2F2594%2Findex.html'), 'true',[ 
		['PAGE','23901',jdecode('September+-+Apples'),jdecode(''), jdecode('%2F2594%2F23901.html'), 'true',[],'',''],
		['PAGE','42901',jdecode('October+-+Poultry'),jdecode(''), jdecode('%2F2594%2F42901.html'), 'true',[],'',''],
		['PAGE','36001',jdecode('November+-+Nutrition'),jdecode(''), jdecode('%2F2594%2F36001.html'), 'true',[],'',''],
		['PAGE','33401',jdecode('December+-+Forestry'),jdecode(''), jdecode('%2F2594%2F33401.html'), 'true',[],'',''],
		['PAGE','62400',jdecode('January+-+Beef'),jdecode(''), jdecode('%2F2594%2F62400.html'), 'true',[],'',''],
		['PAGE','37901',jdecode('February+-+Maple'),jdecode(''), jdecode('%2F2594%2F37901.html'), 'true',[],'',''],
		['PAGE','40801',jdecode('March+-+Aquaculture'),jdecode(''), jdecode('%2F2594%2F40801.html'), 'true',[],'',''],
		['PAGE','42401',jdecode('April+-+Green+Industry'),jdecode(''), jdecode('%2F2594%2F42401.html'), 'true',[],'',''],
		['PAGE','59620',jdecode('May+-+Honey'),jdecode(''), jdecode('%2F2594%2F59620.html'), 'true',[],'',''],
		['PAGE','42922',jdecode('June+-+Dairy'),jdecode(''), jdecode('%2F2594%2F42922.html'), 'true',[],'',''],
		['PAGE','62409',jdecode('July+-+Vegetables'),jdecode(''), jdecode('%2F2594%2F62409.html'), 'true',[],'',''],
		['PAGE','59638',jdecode('August+-+Agritourism'),jdecode(''), jdecode('%2F2594%2F59638.html'), 'true',[],'',''],
		['PAGE','32001',jdecode('Equine'),jdecode(''), jdecode('%2F2594%2F32001.html'), 'true',[],'',''],
		['PAGE','59629',jdecode('Berries'),jdecode(''), jdecode('%2F2594%2F59629.html'), 'true',[],'',''],
		['PAGE','59611',jdecode('+Alpaca'),jdecode(''), jdecode('%2F2594%2F59611.html'), 'true',[],'',''],
		['PAGE','59602',jdecode('+Farm+Link'),jdecode(''), jdecode('%2F2594%2F59602.html'), 'true',[],'',''],
		['PAGE','60780',jdecode('Dairy+Goats'),jdecode(''), jdecode('%2F2594%2F60780.html'), 'true',[],'',''],
		['PAGE','21401',jdecode('Corn%2FBeans%2FSquash'),jdecode(''), jdecode('%2F2594%2F21401.html'), 'true',[],'','']
	],'',''],
	['PAGE','2615',jdecode('CT+Farm+City+'),jdecode(''), jdecode('%2F2615.html'), 'true',[],'',''],
	['PAGE','2636',jdecode('Ag+In+the+Classroom'),jdecode(''), jdecode('%2F2636%2Findex.html'), 'true',[ 
		['PAGE','48301',jdecode('Interested+in+Volunteering%3F'),jdecode(''), jdecode('%2F2636%2F48301.html'), 'false',[],'',''],
		['PAGE','63001',jdecode('Education+and+Development+Classes'),jdecode(''), jdecode('%2F2636%2F63001.html'), 'false',[],'','']
	],'',''],
	['PAGE','62740',jdecode('Young+Farmer'),jdecode(''), jdecode('%2F62740%2Findex.html'), 'true',[ 
		['PAGE','63206',jdecode('2011+Young+Farmer'),jdecode(''), jdecode('%2F62740%2F63206.html'), 'false',[],'','']
	],'',''],
	['PAGE','63314',jdecode('CT+Ag+Journalism+Award'),jdecode(''), jdecode('%2F63314.html'), 'true',[],'',''],
	['PAGE','2657',jdecode('Teacher+of+The+Year'),jdecode(''), jdecode('%2F2657%2Findex.html'), 'false',[ 
		['PAGE','60443',jdecode('2008+Winners'),jdecode(''), jdecode('%2F2657%2F60443.html'), 'false',[],'',''],
		['PAGE','54201',jdecode('2006+Winner'),jdecode(''), jdecode('%2F2657%2F54201.html'), 'false',[],'','']
	],'',''],
	['PAGE','2678',jdecode('Links'),jdecode(''), jdecode('%2F2678.html'), 'true',[],'',''],
	['PAGE','62418',jdecode('Sponsors'),jdecode(''), jdecode('%2F62418.html'), 'true',[],'',''],
	['PAGE','2699',jdecode('Donate+to+CTAEF'),jdecode(''), jdecode('%2F2699.html'), 'true',[],'',''],
	['PAGE','9201',jdecode('About+Us'),jdecode(''), jdecode('%2F9201.html'), 'true',[],'','']];
var siteelementCount=36;
theSitetree.topTemplateName='Billy';
theSitetree.paletteFamily='8D7C50';
theSitetree.keyvisualId='7078';
theSitetree.keyvisualName='kv_7078.jpg';
theSitetree.fontsetId='16379';
theSitetree.graphicsetId='12126';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='8D7C50';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Billy',
				paletteFamily: 	'8D7C50',
				keyvisualId: 	'7078',
				keyvisualName: 	'kv_7078.jpg',
				fontsetId: 		'16379',
				graphicsetId: 	'12126',
				contentColor: 	'FFFFFF',
				contentBGColor: '8D7C50',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20120130-143736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2657',
internalId:  '',
customField: '20091117-153302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2594',
internalId:  '',
customField: '20111202-131414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32001',
internalId:  '',
customField: '20081116-124031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42901',
internalId:  '',
customField: '20100913-090727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33401',
internalId:  '',
customField: '20090325-170417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59602',
internalId:  '',
customField: '20090831-135022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59611',
internalId:  '',
customField: '20090831-135004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36001',
internalId:  '',
customField: '20090831-134631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42401',
internalId:  '',
customField: '20071204-155237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2552',
internalId:  '',
customField: '20120130-143856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2573',
internalId:  '',
customField: '20110728-144522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21401',
internalId:  '',
customField: '20090831-133747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23901',
internalId:  '',
customField: '20111012-142729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59620',
internalId:  '',
customField: '20100913-090848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42922',
internalId:  '',
customField: '20090102-103503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59629',
internalId:  '',
customField: '20100913-090938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59638',
internalId:  '',
customField: '20090102-121917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40801',
internalId:  '',
customField: '20090831-134831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37901',
internalId:  '',
customField: '20090831-134813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2615',
internalId:  '',
customField: '20120117-144410'
};
webappMappings['1501']=webappMappings['1501-5969297']={
webappId:    '1501',
documentId:  '2501',
internalId:  '5969297',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62409',
internalId:  '',
customField: '20101126-145215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2636',
internalId:  '',
customField: '20111212-150227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48301',
internalId:  '',
customField: '20120117-145429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54201',
internalId:  '',
customField: '20080206-183355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2678',
internalId:  '',
customField: '20100503-062050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2699',
internalId:  '',
customField: '20101104-145418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20110727-162624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62400',
internalId:  '',
customField: '20101126-143414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60443',
internalId:  '',
customField: '20090216-123333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62418',
internalId:  '',
customField: '20120117-151230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60780',
internalId:  '',
customField: '20100913-091015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62740',
internalId:  '',
customField: '20120112-073524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63001',
internalId:  '',
customField: '20111130-151535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63206',
internalId:  '',
customField: '20111212-144146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63314',
internalId:  '',
customField: '20120130-141406'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INEAED';
var companyName   = 'Connecticut+Agricultural+Education+Foundation';
var htmlTitle	  = 'The+Official+Homepage+of+the+Connecticut+Agricultural+Education+Foundation';
var metaKeywords  = 'ctaef%3B+caef%3B+ct+agriculture%3B+ct+ag+education%2C+ct+agricultural+education%3B+ct+agricultural+facts';
var metaContents  = 'ctaef%3B+caef%3B+ct+agriculture%3B+ct+ag+education%2C+ct+agricultural+education%3B+ct+agricultural+facts';
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();
};

