/* [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','4501',jdecode('Home'),jdecode(''),'/4501.html','true',[],''],
	['PAGE','20743',jdecode('Leadership+Academy'),jdecode(''),'/20743.html','false',[],''],
	['PAGE','80212',jdecode('Qualification+Test+2-27-10'),jdecode(''),'/80212.html','true',[],''],
	['PAGE','47612',jdecode('Class+41+Candidates'),jdecode(''),'/47612/index.html','true',[ 
		['PAGE','74312',jdecode('Candidate+Forum'),jdecode(''),'/47612/74312.html','true',[],'']
	],''],
	['PAGE','72312',jdecode('Instructor+Sign-up+-+Class+41'),jdecode(''),'/72312.html','true',[],''],
	['PAGE','76812',jdecode('Inst.+Sign-up+-+Qualification+41'),jdecode(''),'/76812.html','false',[],''],
	['PAGE','78912',jdecode('Fitness+Challenge'),jdecode(''),'/78912.html','true',[],''],
	['PAGE','43422',jdecode('Smoke+Diver+Forum'),jdecode(''),'/43422.html','true',[],''],
	['PAGE','20701',jdecode('Ga.+Smoke+Diver+Course'),jdecode(''),'/20701/index.html','true',[ 
		['PAGE','44001',jdecode('Creed'),jdecode(''),'/20701/44001.html','true',[],''],
		['PAGE','43401',jdecode('History'),jdecode(''),'/20701/43401.html','true',[],''],
		['PAGE','44022',jdecode('Nutrition+Guide'),jdecode(''),'/20701/44022.html','true',[],''],
		['PAGE','44043',jdecode('Qualification+Test'),jdecode(''),'/20701/44043.html','true',[],'']
	],''],
	['PAGE','20722',jdecode('Ga.+Smoke+Diver+Association'),jdecode(''),'/20722/index.html','true',[ 
		['PAGE','20785',jdecode('Members'),jdecode(''),'/20722/20785.html','true',[],''],
		['PAGE','20764',jdecode('Board+of+Elders'),jdecode(''),'/20722/20764.html','true',[],''],
		['PAGE','20827',jdecode('Lead+Instructors'),jdecode(''),'/20722/20827.html','true',[],''],
		['PAGE','20806',jdecode('Join'),jdecode(''),'/20722/20806.html','true',[],''],
		['PAGE','44201',jdecode('Register+%2F+Update+Info'),jdecode(''),'/20722/44201.html','true',[],''],
		['PAGE','44064',jdecode('Terminology'),jdecode(''),'/20722/44064.html','true',[],'']
	],''],
	['PAGE','43444',jdecode('Training+Resources'),jdecode(''),'/43444/index.html','true',[ 
		['PAGE','43465',jdecode('Tactical+Decision+Game'),jdecode(''),'/43444/43465.html','true',[],''],
		['PAGE','60212',jdecode('Training+Forum'),jdecode(''),'/43444/60212.html','true',[],''],
		['PAGE','44301',jdecode('Physical+Training'),jdecode(''),'/43444/44301.html','true',[],'']
	],''],
	['PAGE','43486',jdecode('Contact+Us'),jdecode(''),'/43486.html','true',[],'']];
var siteelementCount=26;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='291';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'291',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4501',
internalId:  '',
customField: '20100207-185627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43444',
internalId:  '',
customField: '20081003-172603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20722',
internalId:  '',
customField: '20080930-153619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20080922-220435'
};
webappMappings['7008']=webappMappings['7008-25040']={
webappId:    '7008',
documentId:  '78912',
internalId:  '25040',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-43422aendu0ine4wu']={
webappId:    '1002',
documentId:  '43422',
internalId:  '43422aendu0ine4wu',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43486',
internalId:  '',
customField: '20080918-200927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72312',
internalId:  '',
customField: '20100118-080837'
};
webappMappings['7008']=webappMappings['7008-24479']={
webappId:    '7008',
documentId:  '76812',
internalId:  '24479',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44201',
internalId:  '',
customField: '20080922-214022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44001',
internalId:  '',
customField: '20080920-193825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43401',
internalId:  '',
customField: '20080920-194037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44022',
internalId:  '',
customField: '20080923-091946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44043',
internalId:  '',
customField: '20090715-112244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20743',
internalId:  '',
customField: '20081213-095403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43422',
internalId:  '',
customField: '20080922-214050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20785',
internalId:  '',
customField: '20080917-175149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20764',
internalId:  '',
customField: '20081001-113715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20827',
internalId:  '',
customField: '20081001-122821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20806',
internalId:  '',
customField: '20080917-175149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44064',
internalId:  '',
customField: '20080922-215952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43465',
internalId:  '',
customField: '20081003-161004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44301',
internalId:  '',
customField: '20080918-093603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47612',
internalId:  '',
customField: '20100121-203925'
};
webappMappings['7008']=webappMappings['7008-20401']={
webappId:    '7008',
documentId:  '72312',
internalId:  '20401',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-8699']={
webappId:    '7008',
documentId:  '44201',
internalId:  '8699',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1003']=webappMappings['1003-aendu0ine4wu123e97a3d4e']={
webappId:    '1003',
documentId:  '74312',
internalId:  'aendu0ine4wu123e97a3d4e',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74312',
internalId:  '',
customField: '20090923-205407'
};
webappMappings['1003']=webappMappings['1003-aendu0ine4wu11cc450f89d']={
webappId:    '1003',
documentId:  '60212',
internalId:  'aendu0ine4wu11cc450f89d',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60212',
internalId:  '',
customField: '20081003-161154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76812',
internalId:  '',
customField: '20100102-131107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78912',
internalId:  '',
customField: '20100118-202905'
};
webappMappings['7008']=webappMappings['7008-25740']={
webappId:    '7008',
documentId:  '80212',
internalId:  '25740',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80212',
internalId:  '',
customField: '20100207-190751'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INE4WU';
var companyName   = 'Georgia+Smoke+Diver+Association';
var htmlTitle	  = 'Georgia+Smoke+Diver+Association';
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();
};
