/* [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','3522',jdecode('Home'),jdecode(''),'/3522.html','true',[],'',''],
	['PAGE','27423',jdecode('President%26%23x27%3Bs+Page'),jdecode(''),'/27423.html','true',[],'',''],
	['PAGE','3543',jdecode('All+About+UCA'),jdecode(''),'/3543.html','true',[],'',''],
	['PAGE','5412',jdecode('Academic+Affairs'),jdecode(''),'/5412.html','true',[],'',''],
	['PAGE','5433',jdecode('Student+Affairs'),jdecode(''),'/5433.html','true',[],'',''],
	['PAGE','10423',jdecode('Fiscal+Affairs'),jdecode(''),'/10423.html','true',[],'',''],
	['PAGE','7223',jdecode('Faculty+%2F+Staff'),jdecode(''),'/7223.html','true',[],'',''],
	['PAGE','15223',jdecode('Employee+of+the+Year'),jdecode(''),'/15223.html','true',[],'',''],
	['PAGE','15244',jdecode('Teacher+of+the+Year'),jdecode(''),'/15244.html','true',[],'',''],
	['PAGE','5496',jdecode('Calendars'),jdecode(''),'/5496.html','true',[],'',''],
	['PAGE','3564',jdecode('Photo+Gallery'),jdecode(''),'/3564.html','true',[],'',''],
	['PAGE','10444',jdecode('PTA'),jdecode(''),'/10444.html','true',[],'',''],
	['PAGE','10465',jdecode('Learning+Village'),jdecode(''),'/10465.html','true',[],'',''],
	['PAGE','5454',jdecode('Donations'),jdecode(''),'/5454.html','true',[],'',''],
	['PAGE','3617',jdecode('Contact+Us'),jdecode(''),'/3617.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Qben';
theSitetree.paletteFamily='92AA38';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17182';
theSitetree.graphicsetId='12658';
theSitetree.contentColor='586A14';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Qben',
				paletteFamily: 	'92AA38',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17182',
				graphicsetId: 	'12658',
				contentColor: 	'586A14',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				d_color: 		'39E094',
				e_color: 		'9DCB6E',
				f_color: 		'DC9E3C',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-9636219926a60160a985bf98e7462960']={
webappId:    '7060',
documentId:  '3564',
internalId:  '9636219926a60160a985bf98e7462960',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3522',
internalId:  '',
customField: '20101006-160220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3543',
internalId:  '',
customField: '20101007-154530'
};
webappMappings['7008']=webappMappings['7008-9375']={
webappId:    '7008',
documentId:  '3617',
internalId:  '9375',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5412',
internalId:  '',
customField: '20101008-094817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5433',
internalId:  '',
customField: '20101021-000925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5454',
internalId:  '',
customField: '20101013-154803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27423',
internalId:  '',
customField: '20101020-102135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5496',
internalId:  '',
customField: '20101022-150758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3564',
internalId:  '',
customField: '20101001-211235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3617',
internalId:  '',
customField: '20101004-100617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7223',
internalId:  '',
customField: '20101007-161229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10423',
internalId:  '',
customField: '20101008-134022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10444',
internalId:  '',
customField: '20101020-103102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10465',
internalId:  '',
customField: '20101015-102634'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3522',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15223',
internalId:  '',
customField: '20101013-094354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15244',
internalId:  '',
customField: '20101004-110623'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INZVMO';
var companyName   = 'University+Community+Academy+';
var htmlTitle	  = 'University+Community+Academy++Is+Online%21';
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();
};

