/* [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','2301',jdecode('Home'),jdecode(''),'/2301.html','true',[],'',''],
	['PAGE','2352',jdecode('About+us'),jdecode(''),'/2352/index.html','true',[ 
		['PAGE','2373',jdecode('Our+team'),jdecode(''),'/2352/2373.html','true',[],'',''],
		['PAGE','2394',jdecode('How+to+find+us'),jdecode(''),'/2352/2394.html','true',[],'','']
	],'',''],
	['PAGE','6785',jdecode('Admissions+'),jdecode(''),'/6785/index.html','true',[ 
		['PAGE','7485',jdecode('Calendar'),jdecode(''),'/6785/7485.html','true',[],'',''],
		['PAGE','8385',jdecode('Curriculum'),jdecode(''),'/6785/8385.html','true',[],'',''],
		['PAGE','7585',jdecode('Cost'),jdecode(''),'/6785/7585.html','true',[],'',''],
		['PAGE','31513',jdecode('Testimonials+'),jdecode(''),'/6785/31513.html','true',[],'','']
	],'',''],
	['PAGE','2436',jdecode('Our+Students'),jdecode(''),'/2436/index.html','true',[ 
		['PAGE','32413',jdecode('Photo+Album+'),jdecode(''),'/2436/32413.html','true',[],'','']
	],'',''],
	['PAGE','31534',jdecode('Fundraising+'),jdecode(''),'/31534/index.html','true',[ 
		['PAGE','31555',jdecode('Donate+'),jdecode(''),'/31534/31555.html','true',[],'',''],
		['PAGE','38494',jdecode('Scholarship+Funds++'),jdecode(''),'/31534/38494.html','true',[],'','']
	],'',''],
	['PAGE','2415',jdecode('News'),jdecode(''),'/2415.html','true',[],'',''],
	['PAGE','2457',jdecode('Current+Events'),jdecode(''),'/2457.html','true',[],'',''],
	['PAGE','40814',jdecode('Summer+Reading+List+'),jdecode(''),'/40814.html','true',[],'',''],
	['PAGE','4929',jdecode('Contact'),jdecode(''),'/4929.html','true',[],'',''],
	['ITEM','31576',jdecode('Blog+'),jdecode(''),'http://www.srmartinschool.blogspot.com','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Holz';
theSitetree.paletteFamily='FF7113';
theSitetree.keyvisualId='8817';
theSitetree.keyvisualName='KV_03.swf';
theSitetree.fontsetId='17186';
theSitetree.graphicsetId='12655';
theSitetree.contentColor='262626';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Holz',
				paletteFamily: 	'FF7113',
				keyvisualId: 	'8817',
				keyvisualName: 	'KV_03.swf',
				fontsetId: 		'17186',
				graphicsetId: 	'12655',
				contentColor: 	'262626',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'FF6600',
				d_color: 		'FFFFFF',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20100520-124736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2352',
internalId:  '',
customField: '20100204-151646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2373',
internalId:  '',
customField: '20090512-133229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2415',
internalId:  '',
customField: '20100512-111427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2457',
internalId:  '',
customField: '20100512-111925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2394',
internalId:  '',
customField: '20090501-180342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2436',
internalId:  '',
customField: '20090501-151350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4929',
internalId:  '',
customField: '20090512-121151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31513',
internalId:  '',
customField: '20100520-124051'
};
webappMappings['7008']=webappMappings['7008-7182']={
webappId:    '7008',
documentId:  '4929',
internalId:  '7182',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6785',
internalId:  '',
customField: '20091118-161041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7585',
internalId:  '',
customField: '20091118-161335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7485',
internalId:  '',
customField: '20090826-112346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8385',
internalId:  '',
customField: '20091118-161221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32413',
internalId:  '',
customField: '20100115-130724'
};
webappMappings['7060']=webappMappings['7060-c0b3b400100f8d3f34961b3a84a8fdea']={
webappId:    '7060',
documentId:  '32413',
internalId:  'c0b3b400100f8d3f34961b3a84a8fdea',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31534',
internalId:  '',
customField: '20100115-115525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31555',
internalId:  '',
customField: '20100115-131617'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38494',
internalId:  '',
customField: '20100305-120111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40814',
internalId:  '',
customField: '20100608-142345'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INH4PD';
var companyName   = 'S.R+Martin+College+Prep+School';
var htmlTitle	  = 'S.R.+Martin+Preparatory+School%3A+Making+a+better+tomorrow+one+mind+at+a+time';
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();
};
