/* [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','5201',jdecode('Home'),jdecode(''),'/5201.html','true',[],''],
	['PAGE','5252',jdecode('About+Shannon'),jdecode(''),'/5252.html','true',[],''],
	['PAGE','5273',jdecode('Helping+Shannon'),jdecode(''),'/5273.html','true',[],''],
	['PAGE','5294',jdecode('Voter+Information'),jdecode(''),'/5294.html','true',[],''],
	['PAGE','5315',jdecode('Contact+Shannon'),jdecode(''),'/5315.html','true',[],''],
	['PAGE','5336',jdecode('Campaign+Committee'),jdecode(''),'/5336.html','true',[],''],
	['PAGE','9601',jdecode('%22We+Support+Shannon%22'),jdecode(''),'/9601.html','true',[],''],
	['PAGE','18001',jdecode('News+%26+Press'),jdecode(''),'/18001.html','true',[],''],
	['PAGE','12806',jdecode('Guestbook'),jdecode(''),'/12806/index.html','true',[ 
		['PAGE','12801',jdecode('Read+Guestbook'),jdecode(''),'/12806/12801.html','false',[],'']
	],''],
	['PAGE','13701',jdecode('Elect+Shannon+Album'),jdecode(''),'/13701.html','true',[],''],
	['PAGE','17401',jdecode('THANK+YOU%21%21%21%21%21'),jdecode(''),'/17401.html','true',[],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Deepcolor';
theSitetree.paletteFamily='5583CB';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10349';
theSitetree.graphicsetId='10469';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='154186';
var theTemplate={
				name: 			'Deepcolor',
				paletteFamily: 	'5583CB',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10349',
				graphicsetId: 	'10469',
				contentColor: 	'FFFFFF',
				contentBGColor: '154186',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'5583CB',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-12806AHW050INE82Y']={
webappId:    '1002',
documentId:  '12806',
internalId:  '12806AHW050INE82Y',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-fdbebcb9c7e9ac09a5a83a8c320f3a66']={
webappId:    '7060',
documentId:  '13701',
internalId:  'fdbebcb9c7e9ac09a5a83a8c320f3a66',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5201',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1128176']={
webappId:    '1501',
documentId:  '5201',
internalId:  '1128176',
customField: '1501'
};
webappMappings['1003']=webappMappings['1003-ahw050ine82y11aea0e35ab']={
webappId:    '1003',
documentId:  '5315',
internalId:  'ahw050ine82y11aea0e35ab',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20090503-152848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5252',
internalId:  '',
customField: '20090503-153242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5294',
internalId:  '',
customField: '20090406-115248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5315',
internalId:  '',
customField: '20080904-123416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5336',
internalId:  '',
customField: '20090406-115400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20090406-115541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20090503-153619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12806',
internalId:  '',
customField: '20080114-215308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20070930-224059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20080414-095709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5273',
internalId:  '',
customField: '20080710-100255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20070717-190512'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INE82Y';
var companyName   = 'SHANNON+ERICKSON+++++++South+Carolina+House+%23124';
var htmlTitle	  = 'SHANNON+ERICKSON+SC+House+District+%23124+Your+Community+Voice%21';
var metaKeywords  = 'Shannon%2C+Erickson%2C+candidate%2C+incumbent%2C+Beaufort%2C+House+Seat+124%2C+Republican%2C+child+care%2C+family+issues%2C+education%2C+small+business%2C+South+Carolina%2C+Jean+Lebro%2C+Joan+Petrucci%2C+John+Payne%2C+Nancy+Andrepont%2C+Arlene+Hull%2C+safety%2C+election%2C+voter%2C+voting%2C+poll%2C+woman%2C+government%2C+committee%2C+vote%2C+attorney%2C+legislate%2C+legislation%2C+law%2C+Columbia%2C+legislature%2C+politics%2C+Republican%2C+House%2C+labor%2C+commerce%2C+industry%2C+medical%2C+military%2C+municipal';
var metaContents  = 'Shannon+Erickson%2C+Republican+Incumbent+for+South+Carolina+House+of+Representatives+District+124%2C+has+a+website+containing+personal+biographical+information%2C+issue+points%2C+contact+information%2C+committee+members%2C+voting+information%2C+and+supporters+listings.';
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();
};
