/* [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','4401',jdecode('Home'),jdecode(''),'/4401.html','true',[],'',''],
	['PAGE','7801',jdecode('+leaders%3A+staff+types'),jdecode(''),'/7801.html','true',[],'',''],
	['PAGE','7822',jdecode('leaders%3A+student+types'),jdecode(''),'/7822.html','true',[],'',''],
	['PAGE','7843',jdecode('stuff+we+do+'),jdecode(''),'/7843/index.html','true',[ 
		['PAGE','7864',jdecode('pics+of+stuff+we+do'),jdecode(''),'/7843/7864.html','true',[],'','']
	],'',''],
	['PAGE','7885',jdecode('where+we+hang+out'),jdecode(''),'/7885.html','true',[],'',''],
	['PAGE','7906',jdecode('what+we%26%23x27%3Bre+about'),jdecode(''),'/7906.html','true',[],'',''],
	['PAGE','7927',jdecode('getting+hold+of+us'),jdecode(''),'/7927.html','true',[],'',''],
	['PAGE','7948',jdecode('jim%26%23x27%3Bs+wftw'),jdecode(''),'/7948.html','true',[],'',''],
	['PAGE','7969',jdecode('what+you+think'),jdecode(''),'/7969.html','true',[],'',''],
	['PAGE','7990',jdecode('ccf+alumni-a+page+for+you'),jdecode(''),'/7990.html','true',[],'',''],
	['PAGE','8011',jdecode('cool+links'),jdecode(''),'/8011.html','true',[],'',''],
	['PAGE','12801',jdecode('what%26%23x27%3Bs+it+like+outside'),jdecode(''),'/12801.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Undulate';
theSitetree.paletteFamily='413D42';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33116';
theSitetree.graphicsetId='14071';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='413D42';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Undulate',
				paletteFamily: 	'413D42',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33116',
				graphicsetId: 	'14071',
				contentColor: 	'FFFFFF',
				contentBGColor: '413D42',
				a_color: 		'000000',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20100111-154020'
};
webappMappings['7050']=webappMappings['7050-3012']={
webappId:    '7050',
documentId:  '7948',
internalId:  '3012',
customField: 'language:en;country:US;'
};
webappMappings['1003']=webappMappings['1003-avfl30inhe04123c9e2aaf7']={
webappId:    '1003',
documentId:  '7969',
internalId:  'avfl30inhe04123c9e2aaf7',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7864',
internalId:  '',
customField: '20091022-153819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20090922-160155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7948',
internalId:  '',
customField: '20091012-165525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7969',
internalId:  '',
customField: '20090917-172238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7927',
internalId:  '',
customField: '20090918-173131'
};
webappMappings['7080']=webappMappings['7080-446']={
webappId:    '7080',
documentId:  '12801',
internalId:  '446',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20090921-100435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7822',
internalId:  '',
customField: '20100111-153035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7843',
internalId:  '',
customField: '20090918-165522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7885',
internalId:  '',
customField: '20091022-154654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7906',
internalId:  '',
customField: '20090918-171700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7990',
internalId:  '',
customField: '20090917-172238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8011',
internalId:  '',
customField: '20090917-172238'
};
webappMappings['1501']=webappMappings['1501-16018095']={
webappId:    '1501',
documentId:  '4401',
internalId:  '16018095',
customField: '1501'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHE04';
var companyName   = 'CCF+%40+Appalachian+State+University.+.+.we%27re+on+a+journey';
var htmlTitle	  = 'CCF+%40+Appalachian+State+University';
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();
};
