/* [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','2101',jdecode('Home'),jdecode(''), jdecode('%2F2101.html'), 'true',[],'',''],
	['PAGE','11601',jdecode('Government+%26+Employees'),jdecode(''), jdecode('%2F11601.html'), 'true',[],'',''],
	['PAGE','11622',jdecode('Police+%26+Victim+Advocate'),jdecode(''), jdecode('%2F11622.html'), 'true',[],'',''],
	['PAGE','91367',jdecode('Court+Dates'),jdecode(''), jdecode('%2F91367.html'), 'true',[],'',''],
	['PAGE','37112',jdecode('Christmas+Parade+Registration'),jdecode(''), jdecode('%2F37112.html'), 'false',[],'',''],
	['PAGE','75456',jdecode('Christmas+Parade+%26+Festival'),jdecode(''), jdecode('%2F75456.html'), 'false',[],'',''],
	['PAGE','75756',jdecode('Christmas+Parade+Line-up'),jdecode(''), jdecode('%2F75756.html'), 'false',[],'',''],
	['PAGE','85556',jdecode('Parade+Sponsorships'),jdecode(''), jdecode('%2F85556.html'), 'false',[],'',''],
	['PAGE','86356',jdecode('Vendor+Application'),jdecode(''), jdecode('%2F86356.html'), 'false',[],'',''],
	['PAGE','75777',jdecode('Christmas+Detailed+Information'),jdecode(''), jdecode('%2F75777.html'), 'false',[],'',''],
	['PAGE','42323',jdecode('Event+Pictures'),jdecode(''), jdecode('%2F42323%2Findex.html'), 'true',[ 
		['PAGE','42344',jdecode('2010+Car+Show'),jdecode(''), jdecode('%2F42323%2F42344.html'), 'true',[],'',''],
		['PAGE','46223',jdecode('Snow+12%2F26%2F2010'),jdecode(''), jdecode('%2F42323%2F46223.html'), 'true',[],'',''],
		['PAGE','42365',jdecode('Snow+1%2F10%2F2011'),jdecode(''), jdecode('%2F42323%2F42365.html'), 'true',[],'','']
	],'',''],
	['PAGE','45023',jdecode('Financial+Charts+%26+Graphs'),jdecode(''), jdecode('%2F45023.html'), 'true',[],'',''],
	['PAGE','53345',jdecode('2012+Meeting+%26+Holiday+'),jdecode(''), jdecode('%2F53345.html'), 'true',[],'',''],
	['PAGE','54245',jdecode('New+Police+Car'),jdecode(''), jdecode('%2F54245.html'), 'true',[],'',''],
	['PAGE','56156',jdecode('Stormwater+Committee'),jdecode(''), jdecode('%2F56156.html'), 'false',[],'',''],
	['PAGE','56177',jdecode('StormWater'),jdecode(''), jdecode('%2F56177.html'), 'true',[],'',''],
	['PAGE','68856',jdecode('Lexington+Medical'),jdecode(''), jdecode('%2F68856.html'), 'false',[],'',''],
	['PAGE','93167',jdecode('Election+2012'),jdecode(''), jdecode('%2F93167.html'), 'true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Simple';
theSitetree.paletteFamily='DAFADA';
theSitetree.keyvisualId='4621';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='10346';
theSitetree.graphicsetId='10461';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='dafada';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'enom',
  product: 'WSCENOSSSLYTC21T'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Simple',
				paletteFamily: 	'DAFADA',
				keyvisualId: 	'4621',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'10346',
				graphicsetId: 	'10461',
				contentColor: 	'000000',
				contentBGColor: 'dafada',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'857157',
				e_color: 		'AAAAAA',
				f_color: 		'817E7E',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20120104-211419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20110629-222651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11622',
internalId:  '',
customField: '20110907-203524'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-4112']={
webappId:    '7008',
documentId:  '37112',
internalId:  '4112',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37112',
internalId:  '',
customField: '20110817-210806'
};
webappMappings['7060']=webappMappings['7060-cda4601df7d11bb1a4d781a38b580323']={
webappId:    '7060',
documentId:  '42344',
internalId:  'cda4601df7d11bb1a4d781a38b580323',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-c761293bcf5799e0a9de52aa8d892db1']={
webappId:    '7060',
documentId:  '42365',
internalId:  'c761293bcf5799e0a9de52aa8d892db1',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42323',
internalId:  '',
customField: '20101207-210514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42344',
internalId:  '',
customField: '20101207-211545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42365',
internalId:  '',
customField: '20110110-213955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68856',
internalId:  '',
customField: '20110809-194341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45023',
internalId:  '',
customField: '20120110-194625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46223',
internalId:  '',
customField: '20101226-185720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53345',
internalId:  '',
customField: '20111226-205334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54245',
internalId:  '',
customField: '20110212-080409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56177',
internalId:  '',
customField: '20110223-204626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56156',
internalId:  '',
customField: '20110223-205707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75456',
internalId:  '',
customField: '20110817-204532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75756',
internalId:  '',
customField: '20111020-192408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75777',
internalId:  '',
customField: '20110817-204644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85556',
internalId:  '',
customField: '20111020-200415'
};
webappMappings['7008']=webappMappings['7008-4988']={
webappId:    '7008',
documentId:  '86356',
internalId:  '4988',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93167',
internalId:  '',
customField: '20120127-095815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91367',
internalId:  '',
customField: '20120104-210811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86356',
internalId:  '',
customField: '20111020-205322'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN330INFR4H';
var companyName   = 'Welcome+to+the+Town+of+South+Congaree';
var htmlTitle	  = '';
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();
};

