/* [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','2101',jdecode('Home'),jdecode(''), jdecode('%2F2101.html'), 'true',[],'',''],
	['PAGE','2152',jdecode('About+us'),jdecode(''), jdecode('%2F2152.html'), 'true',[],'',''],
	['PAGE','2173',jdecode('Courses'),jdecode(''), jdecode('%2F2173.html'), 'true',[],'',''],
	['PAGE','76201',jdecode('Class+Scuedule'),jdecode(''), jdecode('%2F76201.html'), 'true',[],'',''],
	['PAGE','21501',jdecode('Register+for+a+Class'),jdecode(''), jdecode('%2F21501.html'), 'true',[],'',''],
	['PAGE','12101',jdecode('Pay+for+a+Class'),jdecode(''), jdecode('%2F12101.html'), 'true',[],'',''],
	['PAGE','8501',jdecode('Student+Information'),jdecode(''), jdecode('%2F8501.html'), 'true',[],'',''],
	['PAGE','9101',jdecode('Resources'),jdecode(''), jdecode('%2F9101.html'), 'true',[],'',''],
	['PAGE','2194',jdecode('Contact'),jdecode(''), jdecode('%2F2194.html'), 'true',[],'',''],
	['PAGE','30901',jdecode('This+and+That'),jdecode(''), jdecode('%2F30901.html'), 'false',[],'',''],
	['PAGE','68801',jdecode('What%26%23x27%3Bs+new%3F'),jdecode(''), jdecode('%2F68801.html'), 'false',[],'',''],
	['PAGE','70301',jdecode('SIRT+Pistols'),jdecode(''), jdecode('%2F70301.html'), 'false',[],'',''],
	['PAGE','71301',jdecode('SIoSI+for+Groups'),jdecode(''), jdecode('%2F71301.html'), 'false',[],'',''],
	['PAGE','73001',jdecode('SMFTS+SIoSI'),jdecode(''), jdecode('%2F73001.html'), 'false',[],'',''],
	['PAGE','73022',jdecode('NRA+FSPO'),jdecode(''), jdecode('%2F73022.html'), 'false',[],'',''],
	['PAGE','73043',jdecode('NRA+BPSC'),jdecode(''), jdecode('%2F73043.html'), 'false',[],'',''],
	['PAGE','74685',jdecode('SMFTS+BPC'),jdecode(''), jdecode('%2F74685.html'), 'false',[],'',''],
	['PAGE','74601',jdecode('SMFTS+IPC'),jdecode(''), jdecode('%2F74601.html'), 'false',[],'',''],
	['PAGE','74622',jdecode('Firearms+and+the+Law'),jdecode(''), jdecode('%2F74622.html'), 'false',[],'',''],
	['PAGE','74643',jdecode('NRA+PPITH'),jdecode(''), jdecode('%2F74643.html'), 'false',[],'',''],
	['PAGE','74664',jdecode('NRA+PPOTH'),jdecode(''), jdecode('%2F74664.html'), 'false',[],'',''],
	['PAGE','94901',jdecode('Liability+Coverage'),jdecode(''), jdecode('%2F94901.html'), 'false',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Usa';
theSitetree.paletteFamily='8194C3';
theSitetree.keyvisualId='4354';
theSitetree.keyvisualName='kv_4354.jpg';
theSitetree.fontsetId='10796';
theSitetree.graphicsetId='11228';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='8194C3';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'fatcow',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Usa',
				paletteFamily: 	'8194C3',
				keyvisualId: 	'4354',
				keyvisualName: 	'kv_4354.jpg',
				fontsetId: 		'10796',
				graphicsetId: 	'11228',
				contentColor: 	'FFFFFF',
				contentBGColor: '8194C3',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20111018-073519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2152',
internalId:  '',
customField: '20110323-115232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2173',
internalId:  '',
customField: '20110905-215029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2194',
internalId:  '',
customField: '20110323-121836'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2101',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2152',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2173',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2194',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-28010']={
webappId:    '7008',
documentId:  '2194',
internalId:  '28010',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20110905-120838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20111103-185358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20110722-105241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94901',
internalId:  '',
customField: '20111018-081004'
};
webappMappings['7008']=webappMappings['7008-28389']={
webappId:    '7008',
documentId:  '21501',
internalId:  '28389',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20110323-115358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30901',
internalId:  '',
customField: '20110313-091440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68801',
internalId:  '',
customField: '20110905-114245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70301',
internalId:  '',
customField: '20110312-163228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71301',
internalId:  '',
customField: '20110313-112446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73001',
internalId:  '',
customField: '20110313-073856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73022',
internalId:  '',
customField: '20110323-222146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73043',
internalId:  '',
customField: '20110323-222219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74622',
internalId:  '',
customField: '20110905-105852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74643',
internalId:  '',
customField: '20110905-120422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74685',
internalId:  '',
customField: '20110330-051425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74601',
internalId:  '',
customField: '20110330-181053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74664',
internalId:  '',
customField: '20110905-111510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76201',
internalId:  '',
customField: '20110723-085630'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INLRX7';
var companyName   = 'Stone+Mountain+Firearms+Training+Service';
var htmlTitle	  = 'Stone+Mountain+Firearms+Training+Service%2C+LLC';
var metaKeywords  = 'pistol%2C+handgun%2C+self-defense%2C+personal+protection%2C+NRA%2C+National+Rifle+Association%2C+Atlanta%2C+Stone+Mountain%2C+safety%2C+shooting%2C+certified';
var metaContents  = 'National+Rifle+Association+%28NRA%29+certified+pistol+courses+available+in+the+Atlanta%2C+Ga+area.+';
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();
};

