/* [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','6401',jdecode('Home'),jdecode(''),'/6401.html','true',[],'',''],
	['PAGE','6452',jdecode('Papago+Range'),jdecode(''),'/6452.html','true',[],'',''],
	['PAGE','6473',jdecode('FAQ'),jdecode(''),'/6473.html','true',[],'',''],
	['PAGE','7601',jdecode('Programs+and+Lessons'),jdecode(''),'/7601.html','true',[],'',''],
	['PAGE','6494',jdecode('Club+Calendar'),jdecode(''),'/6494.html','true',[],'',''],
	['PAGE','6515',jdecode('Upcoming+Events'),jdecode(''),'/6515.html','true',[],'',''],
	['PAGE','6536',jdecode('Membership'),jdecode(''),'/6536.html','true',[],'',''],
	['PAGE','6557',jdecode('JOAD'),jdecode(''),'/6557/index.html','true',[ 
		['PAGE','6578',jdecode('PFA+JOAD'),jdecode(''),'/6557/6578.html','true',[],'','']
	],'',''],
	['PAGE','6599',jdecode('Results'),jdecode(''),'/6599.html','true',[],'',''],
	['PAGE','6620',jdecode('Photos'),jdecode(''),'/6620.html','true',[],'',''],
	['PAGE','21901',jdecode('Resource+Page'),jdecode(''),'/21901.html','true',[],'',''],
	['PAGE','6641',jdecode('Links'),jdecode(''),'/6641.html','false',[],'',''],
	['PAGE','6662',jdecode('Club+Store'),jdecode(''),'/6662.html','false',[],'',''],
	['PAGE','16001',jdecode('Sponsors'),jdecode(''),'/16001.html','true',[],'',''],
	['PAGE','6683',jdecode('Guestbook'),jdecode(''),'/6683.html','true',[],'',''],
	['PAGE','6704',jdecode('Contact+Us'),jdecode(''),'/6704.html','true',[],'',''],
	['PAGE','72712',jdecode('PFA+Survey+Page'),jdecode(''),'/72712.html','false',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Sportfan2';
theSitetree.paletteFamily='D8D5FD';
theSitetree.keyvisualId='10132';
theSitetree.keyvisualName='kv_10132.jpg';
theSitetree.fontsetId='21087';
theSitetree.graphicsetId='13185';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Sportfan2',
				paletteFamily: 	'D8D5FD',
				keyvisualId: 	'10132',
				keyvisualName: 	'kv_10132.jpg',
				fontsetId: 		'21087',
				graphicsetId: 	'13185',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72712',
internalId:  '',
customField: '20090405-182507'
};
webappMappings['1002']=webappMappings['1002-6683aendu0in249b']={
webappId:    '1002',
documentId:  '6683',
internalId:  '6683aendu0in249b',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-78']={
webappId:    '7008',
documentId:  '6704',
internalId:  '78',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20100829-122555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6494',
internalId:  '',
customField: '20100829-141209'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-5124368']={
webappId:    '1501',
documentId:  '6401',
internalId:  '5124368',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6536',
internalId:  '',
customField: '20100829-123731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6683',
internalId:  '',
customField: '20080901-112835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6704',
internalId:  '',
customField: '20100116-214251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6620',
internalId:  '',
customField: '20080928-184259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6515',
internalId:  '',
customField: '20100829-130537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6473',
internalId:  '',
customField: '20080906-204844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20100822-121257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6557',
internalId:  '',
customField: '20100413-232101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6641',
internalId:  '',
customField: '20081123-001150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6662',
internalId:  '',
customField: '20081202-163645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6452',
internalId:  '',
customField: '20100829-141439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6578',
internalId:  '',
customField: '20100829-130505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6599',
internalId:  '',
customField: '20100829-153712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20081014-112134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21901',
internalId:  '',
customField: '20081124-182310'
};
webappMappings['7008']=webappMappings['7008-15361']={
webappId:    '7008',
documentId:  '72712',
internalId:  '15361',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN249B';
var companyName   = 'Papago+FITA+Archers';
var htmlTitle	  = 'Papago+FITA+Archers';
var metaKeywords  = 'Archery%2C+Archers%2C+Papago+Phoenix%2C+JOAD%2C++Archery+clubs%2C';
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();
};
