/* [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','1901',jdecode('Homepage'),jdecode(''),'/1901.html','true',[],'',''],
	['PAGE','29301',jdecode('Instructors'),jdecode(''),'/29301.html','true',[],'',''],
	['PAGE','29322',jdecode('Class+Outlines'),jdecode(''),'/29322/index.html','true',[ 
		['PAGE','29343',jdecode('SCAA+Roasting+and+Cupping++Protocol'),jdecode(''),'/29322/29343.html','true',[],'',''],
		['PAGE','34133',jdecode('SCAA+Green+Coffee+Grading+Principles+%26+Protocols'),jdecode(''),'/29322/34133.html','true',[],'',''],
		['PAGE','34112',jdecode('SCAA+Coffee+Cupping+Form'),jdecode(''),'/29322/34112.html','true',[],'',''],
		['PAGE','29364',jdecode('5-Day+Outline'),jdecode(''),'/29322/29364.html','true',[],'',''],
		['PAGE','29385',jdecode('3-Day+Outline'),jdecode(''),'/29322/29385.html','true',[],'','']
	],'',''],
	['PAGE','29406',jdecode('Certifications'),jdecode(''),'/29406/index.html','true',[ 
		['PAGE','10301',jdecode('SCAA+Cupping+Judge'),jdecode(''),'/29406/10301.html','true',[],'',''],
		['PAGE','6652',jdecode('Q+Grader'),jdecode(''),'/29406/6652.html','true',[],'',''],
		['PAGE','10322',jdecode('Star+Cupper'),jdecode(''),'/29406/10322.html','true',[],'','']
	],'',''],
	['PAGE','3501',jdecode('Study+Materials'),jdecode(''),'/3501.html','true',[],'',''],
	['PAGE','6694',jdecode('Upcoming+Trainings'),jdecode(''),'/6694/index.html','true',[ 
		['PAGE','6715',jdecode('Certification+Classes%2FDates'),jdecode(''),'/6694/6715.html','true',[],'',''],
		['PAGE','7743',jdecode('Photos+of+Training'),jdecode(''),'/6694/7743.html','true',[],'',''],
		['PAGE','6736',jdecode('What+to+Expect'),jdecode(''),'/6694/6736.html','true',[],'',''],
		['PAGE','6757',jdecode('Sample+Itinerary'),jdecode(''),'/6694/6757.html','false',[],'',''],
		['PAGE','13101',jdecode('Canoe+Trip'),jdecode(''),'/6694/13101.html','true',[],'',''],
		['PAGE','6778',jdecode('Travel'),jdecode(''),'/6694/6778.html','true',[],'',''],
		['PAGE','6799',jdecode('Lodging'),jdecode(''),'/6694/6799.html','true',[],'',''],
		['PAGE','6820',jdecode('How+to+Register'),jdecode(''),'/6694/6820.html','true',[],'','']
	],'',''],
	['PAGE','29427',jdecode('Certified+Equipment'),jdecode(''),'/29427/index.html','true',[ 
		['PAGE','10343',jdecode('Sample+Roasting'),jdecode(''),'/29427/10343.html','true',[],'','']
	],'',''],
	['PAGE','3522',jdecode('Staying+Connected'),jdecode(''),'/3522/index.html','true',[ 
		['PAGE','6841',jdecode('Trainers%26%23x27%3B+Journal'),jdecode(''),'/3522/6841.html','true',[],'',''],
		['PAGE','6862',jdecode('Links+to+the+Coffee+World'),jdecode(''),'/3522/6862.html','true',[],'',''],
		['PAGE','29448',jdecode('Testimonials'),jdecode(''),'/3522/29448.html','true',[],'','']
	],'',''],
	['PAGE','40412',jdecode('Coffee+News'),jdecode(''),'/40412.html','true',[],'',''],
	['PAGE','22501',jdecode('Shopping+Cart'),jdecode(''),'/22501.html','true',[],'',''],
	['PAGE','6883',jdecode('Contact+Us'),jdecode(''),'/6883.html','true',[],'',''],
	['PAGE','18601',jdecode(''),jdecode(''),'/18601.html','true',[],'',''],
	['PAGE','18622',jdecode(''),jdecode(''),'/18622.html','true',[],'',''],
	['PAGE','18643',jdecode(''),jdecode(''),'/18643.html','true',[],'','']];
var siteelementCount=34;
theSitetree.topTemplateName='Blades';
theSitetree.paletteFamily='84673F';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='31705';
theSitetree.graphicsetId='13470';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='94784E';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blades',
				paletteFamily: 	'84673F',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'31705',
				graphicsetId: 	'13470',
				contentColor: 	'FFFFFF',
				contentBGColor: '94784E',
				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:  '1901',
internalId:  '',
customField: '20100315-172728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3501',
internalId:  '',
customField: '20090602-163442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3522',
internalId:  '',
customField: '20090518-130445'
};
webappMappings['7050']=webappMappings['7050-82']={
webappId:    '7050',
documentId:  '6841',
internalId:  '82',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20100104-050516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6694',
internalId:  '',
customField: '20090619-045644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6883',
internalId:  '',
customField: '20090526-185821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6715',
internalId:  '',
customField: '20091229-040641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6757',
internalId:  '',
customField: '20090518-204406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6778',
internalId:  '',
customField: '20090526-185415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6799',
internalId:  '',
customField: '20090519-070953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6820',
internalId:  '',
customField: '20090619-051755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6736',
internalId:  '',
customField: '20090508-073643'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6778',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '6799',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['7008']=webappMappings['7008-1207']={
webappId:    '7008',
documentId:  '6820',
internalId:  '1207',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10322',
internalId:  '',
customField: '20090518-202353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6652',
internalId:  '',
customField: '20090602-163250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7743',
internalId:  '',
customField: '20090601-064609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10343',
internalId:  '',
customField: '20090601-064156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6841',
internalId:  '',
customField: '20090519-071304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6862',
internalId:  '',
customField: '20100103-101249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20090518-011052'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20090519-203610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18622',
internalId:  '',
customField: '20090519-203610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18643',
internalId:  '',
customField: '20090519-203610'
};
webappMappings['4001']=webappMappings['4001-19905716']={
webappId:    '4001',
documentId:  '22501',
internalId:  '19905716',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22501',
internalId:  '',
customField: '20090608-195657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20090601-171816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29322',
internalId:  '',
customField: '20090619-045255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29427',
internalId:  '',
customField: '20090601-172340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29406',
internalId:  '',
customField: '20090622-075703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29343',
internalId:  '',
customField: '20090602-190530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29364',
internalId:  '',
customField: '20090602-133535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29385',
internalId:  '',
customField: '20090602-133708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29448',
internalId:  '',
customField: '20090601-170831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34112',
internalId:  '',
customField: '20090602-190725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34133',
internalId:  '',
customField: '20090602-190325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40412',
internalId:  '',
customField: '20090622-070630'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN330INZLZ2';
var companyName   = 'just+cup+coffee+academy';
var htmlTitle	  = '';
var metaKeywords  = 'cupping+coffeecupping+q+gradersq+graders+school+for+coffeegreen+grading';
var metaContents  = 'School+for+cupping+and+grading+coffee';
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();
};
