/* [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','901',jdecode('Home'),jdecode(''),'/901.html','true',[],'',''],
	['PAGE','55734',jdecode('ArtWorks+Connellsville'),jdecode(''),'/55734.html','true',[],'',''],
	['PAGE','13801',jdecode('Cultural+Calendar'),jdecode(''),'/13801.html','true',[],'',''],
	['PAGE','45439',jdecode('Connellsville+Crossroads'),jdecode(''),'/45439.html','true',[],'',''],
	['PAGE','15901',jdecode('Downtown+Connellsville'),jdecode(''),'/15901.html','true',[],'',''],
	['PAGE','47708',jdecode('Symposium'),jdecode(''),'/47708.html','true',[],'',''],
	['PAGE','46772',jdecode('Items+for+Sale'),jdecode(''),'/46772.html','true',[],'',''],
	['PAGE','1036',jdecode('Heritage+Trail+%26+more'),jdecode(''),'/1036.html','true',[],'',''],
	['PAGE','45768',jdecode('Art+on+the+Yough'),jdecode(''),'/45768.html','true',[],'',''],
	['PAGE','45632',jdecode('Summer+Art+Camp+2010'),jdecode(''),'/45632.html','true',[],'',''],
	['PAGE','36901',jdecode('Public+Art+Projects'),jdecode(''),'/36901.html','true',[],'',''],
	['PAGE','952',jdecode('City+History'),jdecode(''),'/952.html','true',[],'',''],
	['PAGE','973',jdecode('City+Profile'),jdecode(''),'/973.html','true',[],'',''],
	['PAGE','994',jdecode('National+Register'),jdecode(''),'/994.html','true',[],'',''],
	['PAGE','1015',jdecode('Parks'),jdecode(''),'/1015.html','true',[],'',''],
	['PAGE','1078',jdecode('Contributions'),jdecode(''),'/1078.html','true',[],'',''],
	['PAGE','46021',jdecode('Postcards'),jdecode(''),'/46021.html','true',[],'',''],
	['PAGE','9301',jdecode('In+the+News'),jdecode(''),'/9301.html','true',[],'',''],
	['PAGE','21601',jdecode('Historical+Society'),jdecode(''),'/21601.html','true',[],'',''],
	['PAGE','8501',jdecode('Links'),jdecode(''),'/8501.html','true',[],'',''],
	['PAGE','44374',jdecode('Trivia+Quiz'),jdecode(''),'/44374.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Jakarta';
theSitetree.paletteFamily='6176B2';
theSitetree.keyvisualId='7881';
theSitetree.keyvisualName='kv_7881.jpg';
theSitetree.fontsetId='16854';
theSitetree.graphicsetId='12296';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='ABBBE8';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'true',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Jakarta',
				paletteFamily: 	'6176B2',
				keyvisualId: 	'7881',
				keyvisualName: 	'kv_7881.jpg',
				fontsetId: 		'16854',
				graphicsetId: 	'12296',
				contentColor: 	'000000',
				contentBGColor: 'ABBBE8',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'6176B2',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20101027-082612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20101115-075809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20101115-075339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20100926-203104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55734',
internalId:  '',
customField: '20101115-075442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36901',
internalId:  '',
customField: '20091113-185802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20070429-093644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20071210-112846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20100624-211905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20100624-212118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1078',
internalId:  '',
customField: '20101115-080917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20080607-222523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21601',
internalId:  '',
customField: '20081115-180432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20090903-212730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44374',
internalId:  '',
customField: '20080706-074007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45439',
internalId:  '',
customField: '20101101-074149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45632',
internalId:  '',
customField: '20100926-202307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45768',
internalId:  '',
customField: '20100926-201440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46021',
internalId:  '',
customField: '20091113-185542'
};
webappMappings['1501']=webappMappings['1501-1037292']={
webappId:    '1501',
documentId:  '901',
internalId:  '1037292',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46772',
internalId:  '',
customField: '20100531-121337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47708',
internalId:  '',
customField: '20100531-124401'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INERFY';
var companyName   = 'Connellsville+Cultural+Trust';
var htmlTitle	  = 'Connellsville+Cultural+Trust';
var metaKeywords  = 'Connellsville+Cultural+Trust+Historic+Arts+';
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();
};

