/* [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','1001',jdecode('AHSCC+Home'),jdecode(''),'/1001.html','true',[],''],
	['PAGE','216576',jdecode('Query+the+GUHSD'),jdecode(''),'/216576.html','true',[],''],
	['PAGE','103632',jdecode('Info+Links++I'),jdecode(''),'/103632/index.html','true',[ 
		['PAGE','102932',jdecode('*Opinion+Poll+%231'),jdecode(''),'/103632/102932.html','false',[],''],
		['PAGE','103653',jdecode('*Opinion+Poll+%232'),jdecode(''),'/103632/103653.html','false',[],''],
		['PAGE','103674',jdecode('*Opinion+Poll+%233'),jdecode(''),'/103632/103674.html','false',[],''],
		['PAGE','104332',jdecode('*Opinion+Poll+%234'),jdecode(''),'/103632/104332.html','false',[],'']
	],''],
	['PAGE','109432',jdecode('Info+Links+II'),jdecode(''),'/109432.html','true',[],''],
	['PAGE','55021',jdecode('About+the+AHSCC'),jdecode(''),'/55021/index.html','true',[ 
		['PAGE','54832',jdecode('Our+History'),jdecode(''),'/55021/54832.html','true',[],''],
		['PAGE','54895',jdecode('Our+Positions'),jdecode(''),'/55021/54895.html','true',[],''],
		['PAGE','81132',jdecode('Our+Donors'),jdecode(''),'/55021/81132.html','true',[],'']
	],''],
	['PAGE','55374',jdecode('Contact+Us'),jdecode(''),'/55374.html','false',[],''],
	['PAGE','15327',jdecode('Contact+Us+%28Help%29'),jdecode(''),'/15327.html','true',[],''],
	['PAGE','15306',jdecode('Our+Meetings'),jdecode(''),'/15306/index.html','true',[ 
		['PAGE','55000',jdecode('Minutes'),jdecode(''),'/15306/55000.html','false',[],'']
	],''],
	['PAGE','15348',jdecode('Blog+%26+News'),jdecode(''),'/15348.html','false',[],''],
	['PAGE','147432',jdecode('The+%22Site%22+Details'),jdecode(''),'/147432/index.html','true',[ 
		['PAGE','148832',jdecode('GUHSD+Update+4%2F24%2F09'),jdecode(''),'/147432/148832.html','true',[],''],
		['PAGE','147232',jdecode('Background+Info'),jdecode(''),'/147432/147232.html','true',[],'']
	],''],
	['PAGE','15201',jdecode('Sub-Committees'),jdecode(''),'/15201/index.html','true',[ 
		['PAGE','15243',jdecode('Finance'),jdecode(''),'/15201/15243.html','true',[],''],
		['PAGE','15264',jdecode('Design'),jdecode(''),'/15201/15264.html','true',[],''],
		['PAGE','15285',jdecode('Curriculum'),jdecode(''),'/15201/15285.html','true',[],'']
	],''],
	['PAGE','15222',jdecode('The+School+Sites'),jdecode(''),'/15222.html','false',[],'']];
var siteelementCount=25;
theSitetree.topTemplateName='Common';
theSitetree.paletteFamily='D40202';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='26635';
theSitetree.graphicsetId='13449';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Common',
				paletteFamily: 	'D40202',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'26635',
				graphicsetId: 	'13449',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1001',
internalId:  '',
customField: '20100119-135618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20090704-123832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15264',
internalId:  '',
customField: '20091107-213259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15348',
internalId:  '',
customField: '20090403-192421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15327',
internalId:  '',
customField: '20090622-140705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15306',
internalId:  '',
customField: '20100119-010326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15222',
internalId:  '',
customField: '20090311-134815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15243',
internalId:  '',
customField: '20090814-131154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15285',
internalId:  '',
customField: '20090625-194020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54832',
internalId:  '',
customField: '20100111-185344'
};
webappMappings['7008']=webappMappings['7008-14148']={
webappId:    '7008',
documentId:  '55374',
internalId:  '14148',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102932',
internalId:  '',
customField: '20090509-142027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54895',
internalId:  '',
customField: '20090512-091148'
};
webappMappings['7005']=webappMappings['7005-1786']={
webappId:    '7005',
documentId:  '103674',
internalId:  '1786',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103632',
internalId:  '',
customField: '20100114-184958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103653',
internalId:  '',
customField: '20090324-131840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55000',
internalId:  '',
customField: '20090508-140653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55021',
internalId:  '',
customField: '20100111-161025'
};
webappMappings['7005']=webappMappings['7005-1783']={
webappId:    '7005',
documentId:  '102932',
internalId:  '1783',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81132',
internalId:  '',
customField: '20091108-142939'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1001',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-14418']={
webappId:    '7008',
documentId:  '15327',
internalId:  '14418',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55374',
internalId:  '',
customField: '20090318-152320'
};
webappMappings['7005']=webappMappings['7005-1785']={
webappId:    '7005',
documentId:  '103653',
internalId:  '1785',
customField: 'language:en;country:US;'
};
webappMappings['7005']=webappMappings['7005-1787']={
webappId:    '7005',
documentId:  '104332',
internalId:  '1787',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103674',
internalId:  '',
customField: '20090324-131912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104332',
internalId:  '',
customField: '20090324-131940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109432',
internalId:  '',
customField: '20100114-185329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148832',
internalId:  '',
customField: '20090728-174413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147232',
internalId:  '',
customField: '20090426-151636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147432',
internalId:  '',
customField: '20090729-140018'
};
webappMappings['7008']=webappMappings['7008-22244']={
webappId:    '7008',
documentId:  '216576',
internalId:  '22244',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '216576',
internalId:  '',
customField: '20091224-195331'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2C90';
var companyName   = 'The+Alpine+High+School+Citizens+Committee';
var htmlTitle	  = 'AHSCC+%7C+Alpine+High+School+Citizens+Committee';
var metaKeywords  = 'Alpine%3BAHS%3BAlpine+High+School%3B+Alpine+High+School+Citizens+Committee%3B+GUHSD%3B+grossont%3B+AHSCC%3Bhigh+school%3Bblossom+valley%3B';
var metaContents  = 'The+objective+of+the+AHSCC+is+to+achieve+an+exemplary+High+School+for+the+students+and+community+of+Alpine%2C+San+Diego+County%2C+California+in+the+fastest%2C+and+most+economical%2C+and+effective+means+possible.++This+new+school+will+embody+the+spirit+and+values+of+the+Alpine+community+and+be+dedicated+to+academic+excellence+and+cultural+diversity.';
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();
};
