/* [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','9312',jdecode('Home'),jdecode(''),'/9312.html','true',[],''],
	['PAGE','801',jdecode('Conifer+Seedling+Prices'),jdecode(''),'/801.html','true',[],''],
	['PAGE','12212',jdecode('Seed+Prices'),jdecode(''),'/12212.html','true',[],''],
	['PAGE','12233',jdecode('Curlew+Forestry'),jdecode(''),'/12233.html','true',[],''],
	['PAGE','11512',jdecode('Order++Form'),jdecode(''),'/11512.html','true',[],''],
	['PAGE','11554',jdecode('Seed+Wanted+To+Buy'),jdecode(''),'/11554.html','true',[],''],
	['PAGE','11575',jdecode('News'),jdecode(''),'/11575.html','true',[],''],
	['PAGE','15912',jdecode('Curlew+Seed+Blog'),jdecode(''),'/15912.html','true',[],''],
	['PAGE','11596',jdecode('About+Us'),jdecode(''),'/11596.html','true',[],''],
	['PAGE','11533',jdecode('Contact'),jdecode(''),'/11533.html','true',[],''],
	['PAGE','12254',jdecode('Send+Question%2FComment'),jdecode(''),'/12254.html','true',[],''],
	['PAGE','11659',jdecode('Jobs'),jdecode(''),'/11659.html','true',[],''],
	['PAGE','14012',jdecode('How+to+Find+Us'),jdecode(''),'/14012.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Boston';
theSitetree.paletteFamily='8BAD63';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11067';
theSitetree.graphicsetId='11841';
theSitetree.contentColor='283915';
theSitetree.contentBGColor='66873E';
var theTemplate={
				name: 			'Boston',
				paletteFamily: 	'8BAD63',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11067',
				graphicsetId: 	'11841',
				contentColor: 	'283915',
				contentBGColor: '66873E',
				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: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15912',
internalId:  '',
customField: '20091229-190613'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9312',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20100111-160205'
};
webappMappings['1003']=webappMappings['1003-ahw050invgwc125dd1bc354']={
webappId:    '1003',
documentId:  '15912',
internalId:  'ahw050invgwc125dd1bc354',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9312',
internalId:  '',
customField: '20100206-124730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11512',
internalId:  '',
customField: '20100115-164601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11533',
internalId:  '',
customField: '20091229-185751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11554',
internalId:  '',
customField: '20091228-182234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11659',
internalId:  '',
customField: '20091228-162233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11596',
internalId:  '',
customField: '20091229-175634'
};
webappMappings['7008']=webappMappings['7008-6021']={
webappId:    '7008',
documentId:  '12254',
internalId:  '6021',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12212',
internalId:  '',
customField: '20091229-185651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12233',
internalId:  '',
customField: '20091228-155703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11575',
internalId:  '',
customField: '20100122-141249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14012',
internalId:  '',
customField: '20091228-172126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12254',
internalId:  '',
customField: '20091228-171954'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '14012',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVGWC';
var companyName   = 'Curlew+Seed%2C+Inc.';
var htmlTitle	  = 'curlew+seed+11+oct+2008';
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();
};
