/* [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','14',jdecode('Home'),jdecode(''),'/14.html','true',[],'',''],
	['PAGE','44',jdecode('Tickets'),jdecode(''),'/44.html','true',[],'',''],
	['PAGE','35',jdecode('2010-2011+Season'),jdecode(''),'/35.html','true',[],'',''],
	['PAGE','53',jdecode('Contact+Us'),jdecode(''),'/53.html','true',[],'',''],
	['PAGE','1187',jdecode('Directions'),jdecode(''),'/1187.html','true',[],'',''],
	['PAGE','71',jdecode('Fundraising'),jdecode(''),'/71.html','true',[],'',''],
	['PAGE','87501',jdecode('Past+Shows'),jdecode(''),'/87501.html','true',[],'',''],
	['PAGE','1094',jdecode('Photo+Album'),jdecode(''),'/1094.html','true',[],'',''],
	['PAGE','62501',jdecode('Volunteer'),jdecode(''),'/62501.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Vegas';
theSitetree.paletteFamily='0A0847';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16928';
theSitetree.graphicsetId='12328';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0A0847';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'true',
				name: 			'Vegas',
				paletteFamily: 	'0A0847',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16928',
				graphicsetId: 	'12328',
				contentColor: 	'FFFFFF',
				contentBGColor: '0A0847',
				a_color: 		'0A0847',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '1187',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '14',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-c52392c3fc8666a01d898c4e1b7c1997']={
webappId:    '7060',
documentId:  '1094',
internalId:  'c52392c3fc8666a01d898c4e1b7c1997',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-1678539']={
webappId:    '1501',
documentId:  '14',
internalId:  '1678539',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14',
internalId:  '',
customField: '20100821-151458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35',
internalId:  '',
customField: '20100821-151702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44',
internalId:  '',
customField: '20100820-143220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20100827-230122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71',
internalId:  '',
customField: '20100902-145044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1187',
internalId:  '',
customField: '20081221-161842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1094',
internalId:  '',
customField: '20061021-142056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62501',
internalId:  '',
customField: '20100716-150923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87501',
internalId:  '',
customField: '20100716-143059'
};
webappMappings['7008']=webappMappings['7008-15845']={
webappId:    '7008',
documentId:  '53',
internalId:  '15845',
customField: 'language:en;country:US;'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2DE4';
var companyName   = 'Bothell+High+School+Theatre+Arts';
var htmlTitle	  = 'Bothell+High+School+Theatre+Arts';
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();
};
