/* [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','7501',jdecode('Home'),jdecode(''), jdecode('%2F7501.html'), 'true',[],'',''],
	['PAGE','11301',jdecode('About+Us'),jdecode(''), jdecode('%2F11301.html'), 'true',[],'',''],
	['PAGE','208401',jdecode('History'),jdecode(''), jdecode('%2F208401.html'), 'true',[],'',''],
	['ITEM','169001',jdecode('Cornerstone'),jdecode(''), jdecode('https%3A%2F%2Fsis.churchwerks.com%2Fcornerstone'), 'true',[],'','_blank'],
	['PAGE','18601',jdecode('Faculty+and+Staff'),jdecode(''), jdecode('%2F18601.html'), 'true',[],'',''],
	['PAGE','28101',jdecode('Hot+Lunch'),jdecode(''), jdecode('%2F28101.html'), 'true',[],'',''],
	['ITEM','249412',jdecode('Blood+Drive'),jdecode(''), jdecode('http%3A%2F%2Fwww.saintclementschool.com%2FDocuments%2Fblooddrive.pdf'), 'true',[],'','_blank'],
	['PAGE','227401',jdecode('IMC'),jdecode(''), jdecode('%2F227401.html'), 'true',[],'',''],
	['PAGE','34701',jdecode('Accelerated+Reader'),jdecode(''), jdecode('%2F34701.html'), 'true',[],'',''],
	['ITEM','226701',jdecode('School+Calendar'),jdecode(''), jdecode('http%3A%2F%2Fwww.saintclementschool.com%2FDocuments%2Fschoolcalendar2011-2012.pdf'), 'true',[],'','_blank'],
	['PAGE','208443',jdecode('Family+Bulletins'),jdecode(''), jdecode('%2F208443.html'), 'true',[],'',''],
	['ITEM','221101',jdecode('Family+Handbook'),jdecode(''), jdecode('http%3A%2F%2Fwww.saintclementschool.com%2FDocuments%2FFamilyhandbook2011.pdf'), 'true',[],'','_blank'],
	['ITEM','244801',jdecode('Anti-Bullying+Policy'),jdecode(''), jdecode('http%3A%2F%2Fwww.saintclementschool.com%2FDocuments%2FAntibullying.pdf'), 'true',[],'','_blank'],
	['ITEM','209001',jdecode('School+Supplies+List'),jdecode(''), jdecode('http%3A%2F%2Fwww.saintclementschool.com%2FDocuments%2FSchoolsupplieslist2011-12.pdf'), 'true',[],'','_blank'],
	['PAGE','208485',jdecode('Medical+Forms'),jdecode(''), jdecode('%2F208485.html'), 'true',[],'',''],
	['ITEM','221201',jdecode('Scrip'),jdecode(''), jdecode('http%3A%2F%2Fwww.saintclementschool.com%2FDocuments%2FscripJan2012.pdf'), 'true',[],'','_blank'],
	['ITEM','237901',jdecode('Scrip+Schedule'),jdecode(''), jdecode('http%3A%2F%2Fwww.saintclementschool.com%2FDocuments%2Fscripschedule.pdf'), 'true',[],'','_blank'],
	['ITEM','238701',jdecode('Basketball+Schedule'),jdecode(''), jdecode('http%3A%2F%2Fwww.saintclementschool.com%2FDocuments%2FBasketballschedule.pdf'), 'true',[],'','_blank'],
	['ITEM','243801',jdecode('Basketball+News'),jdecode(''), jdecode('http%3A%2F%2Fwww.saintclementschool.com%2FDocuments%2Fbasketballnews.pdf'), 'true',[],'','_blank'],
	['PAGE','52601',jdecode('Photos'),jdecode(''), jdecode('%2F52601.html'), 'true',[],'',''],
	['PAGE','52622',jdecode('Links'),jdecode(''), jdecode('%2F52622.html'), 'true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Hobby1';
theSitetree.paletteFamily='FFFFF2';
theSitetree.keyvisualId='10188';
theSitetree.keyvisualName='kv_10188.jpg';
theSitetree.fontsetId='21086';
theSitetree.graphicsetId='13178';
theSitetree.contentColor='487207';
theSitetree.contentBGColor='FFFFFF';
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: 			'Hobby1',
				paletteFamily: 	'FFFFF2',
				keyvisualId: 	'10188',
				keyvisualName: 	'kv_10188.jpg',
				fontsetId: 		'21086',
				graphicsetId: 	'13178',
				contentColor: 	'487207',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20110831-150114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '208443',
internalId:  '',
customField: '20120106-150806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20110822-195415'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20111006-143537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28101',
internalId:  '',
customField: '20120131-132324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34701',
internalId:  '',
customField: '20111026-210734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52601',
internalId:  '',
customField: '20111208-143237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52622',
internalId:  '',
customField: '20110822-180715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '208401',
internalId:  '',
customField: '20110818-153853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '208485',
internalId:  '',
customField: '20110818-170135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '227401',
internalId:  '',
customField: '20111005-174529'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INL208';
var companyName   = 'Saint+Clement+School';
var htmlTitle	  = 'Saint+Clement+School';
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();
};

