/* [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','2701',jdecode('Home'),jdecode(''),'/2701.html','true',[],''],
	['PAGE','35501',jdecode('Upcoming+Public+Events'),jdecode(''),'/35501.html','true',[],''],
	['PAGE','35022',jdecode('Venue+Information'),jdecode(''),'/35022/index.html','true',[ 
		['PAGE','52001',jdecode('Audio+Visual+Equipment'),jdecode(''),'/35022/52001.html','true',[],''],
		['PAGE','62001',jdecode('Trade+Show+Information'),jdecode(''),'/35022/62001.html','true',[],'']
	],''],
	['PAGE','35043',jdecode('Catering'),jdecode(''),'/35043/index.html','true',[ 
		['PAGE','35169',jdecode('Terms+And+Conditions'),jdecode(''),'/35043/35169.html','true',[],''],
		['PAGE','17522',jdecode('On-Site+Menu'),jdecode(''),'/35043/17522.html','true',[],''],
		['PAGE','35211',jdecode('Picnic+Menus'),jdecode(''),'/35043/35211.html','true',[],''],
		['PAGE','63301',jdecode('Holiday+Menus'),jdecode(''),'/35043/63301.html','true',[],''],
		['PAGE','63801',jdecode('Pick-Up+Items'),jdecode(''),'/35043/63801.html','true',[],'']
	],''],
	['PAGE','35232',jdecode('RV+Infomation'),jdecode(''),'/35232.html','true',[],''],
	['PAGE','17501',jdecode('How+to+find+us'),jdecode(''),'/17501.html','true',[],''],
	['PAGE','34901',jdecode('Contact+Us'),jdecode(''),'/34901.html','true',[],''],
	['PAGE','50801',jdecode('Links'),jdecode(''),'/50801.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='003399';
theSitetree.keyvisualId='1252';
theSitetree.keyvisualName='gedeck.jpg';
theSitetree.fontsetId='190';
theSitetree.graphicsetId='228';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Profile',
				paletteFamily: 	'003399',
				keyvisualId: 	'1252',
				keyvisualName: 	'gedeck.jpg',
				fontsetId: 		'190',
				graphicsetId: 	'228',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'003399',
				b_color: 		'000066',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20100129-141122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17522',
internalId:  '',
customField: '20091029-183919'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '17501',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34901',
internalId:  '',
customField: '20081106-110110'
};
webappMappings['7008']=webappMappings['7008-10081']={
webappId:    '7008',
documentId:  '34901',
internalId:  '10081',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35022',
internalId:  '',
customField: '20100205-133537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35501',
internalId:  '',
customField: '20100303-131617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35043',
internalId:  '',
customField: '20081121-111833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52001',
internalId:  '',
customField: '20100205-132919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63801',
internalId:  '',
customField: '20091029-191519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35169',
internalId:  '',
customField: '20081121-112016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50801',
internalId:  '',
customField: '20090314-195654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35211',
internalId:  '',
customField: '20090225-114016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35232',
internalId:  '',
customField: '20090406-162834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20090727-155005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62001',
internalId:  '',
customField: '20090729-160509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63301',
internalId:  '',
customField: '20091029-190205'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INE75E';
var companyName   = 'Beckley+Raleigh+County+Convention+Center';
var htmlTitle	  = 'Beckley+Convention+Center';
var metaKeywords  = 'catering%2C+caterer%2C+meeting%2C+conference%2C+convention%2C+arena%2C+toughman%2C+banquet';
var metaContents  = 'Southern+WV+largest+event+facility+offering+full+service+catering+both+on-site+and+off.';
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();
};
