/* [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','32',jdecode('Law+Office+Home'),jdecode(''),'/32.html','true',[],''],
	['PAGE','1195',jdecode('Appellate+Representation'),jdecode(''),'/1195/index.html','true',[ 
		['PAGE','3826',jdecode('Appellate+Resources'),jdecode(''),'/1195/3826.html','true',[],''],
		['PAGE','7501',jdecode('Blog+-+California-Appeal'),jdecode(''),'/1195/7501.html','true',[],'']
	],''],
	['PAGE','62',jdecode('Bicycle+Accidents'),jdecode(''),'/62/index.html','true',[ 
		['PAGE','3440',jdecode('FAQ%3A+Bicycle+Accidents'),jdecode(''),'/62/3440.html','true',[],''],
		['PAGE','2432',jdecode('Safety+%26+Training+Articles'),jdecode(''),'/62/2432.html','true',[],''],
		['PAGE','2500',jdecode('Cal.+Bike+Laws'),jdecode(''),'/62/2500.html','true',[],''],
		['PAGE','2509',jdecode('Bicycle+Links'),jdecode(''),'/62/2509.html','true',[],'']
	],''],
	['PAGE','18101',jdecode('On+Line+Resouces'),jdecode(''),'/18101.html','true',[],''],
	['PAGE','46412',jdecode('About+us'),jdecode(''),'/46412/index.html','true',[ 
		['PAGE','1231',jdecode('Our+Team'),jdecode(''),'/46412/1231.html','true',[],''],
		['PAGE','46433',jdecode('Our+history'),jdecode(''),'/46412/46433.html','true',[],''],
		['PAGE','2850',jdecode('Directions'),jdecode(''),'/46412/2850.html','true',[],'']
	],''],
	['PAGE','1204',jdecode('Contact+Us'),jdecode(''),'/1204.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='6683B6';
theSitetree.keyvisualId='2464';
theSitetree.keyvisualName='recht.jpg';
theSitetree.fontsetId='406';
theSitetree.graphicsetId='461';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Collage',
				paletteFamily: 	'6683B6',
				keyvisualId: 	'2464',
				keyvisualName: 	'recht.jpg',
				fontsetId: 		'406',
				graphicsetId: 	'461',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'6683B6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['1001']=webappMappings['1001-ahw050in31co606e4712b09f8ee3']={
webappId:    '1001',
documentId:  '1204',
internalId:  'ahw050in31co606e4712b09f8ee3',
customField: ''
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '32',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '2850',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1195',
internalId:  '',
customField: '20090706-222324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20090706-220935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3826',
internalId:  '',
customField: '20090706-222351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62',
internalId:  '',
customField: '20090706-223619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3440',
internalId:  '',
customField: '20090705-212932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46412',
internalId:  '',
customField: '20091003-164642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2432',
internalId:  '',
customField: '20090706-223832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2509',
internalId:  '',
customField: '20061015-222908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20090705-212126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20090706-223918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1231',
internalId:  '',
customField: '20090706-224014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1204',
internalId:  '',
customField: '20090705-214157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2850',
internalId:  '',
customField: '20090705-214246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2500',
internalId:  '',
customField: '20090705-213025'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050IN31CO';
var companyName   = 'LAW+OFFICE+OF+AMANDA+BENEDICT';
var htmlTitle	  = 'Law+Offices+of+Amanda+Benedict+-+Appellate+Representation%2C+Legal+Research+Services%2C+Bike+Accident+Litigation';
var metaKeywords  = 'appellate+defense%2C+appellate+defender%2C+felony+appeal%2C+crime%2C+criminal%2C+appeal%2C+defense%2C+attorney%2C+law%2C+lawyer%2C+lawyers%2C+san+diego%2C+california%2C+court%2C+defend%2C+crimes%2C+offense%2C+jail%2C+prison%2C+arrest%2C+arrested%2C+bail%2C+bike+accident+attorney%2C+bicycle+accident+attorney%2C+san+diego+bike+accident%2C+san+diego+bicycle+accident+attorney%2C+bike+lawyer%2C+bicycle+lawyer%2C+bike%2C+bicycle%2C+cycle%2C+accident%2C+injury%2C+automobile%2C+car%2C+truck%2C+mountian+bike%2C+road+bike%2C+insurance%2C+road%2C+street%2C+roadway%2C+triathlon%2C+injured%2C+sue%2C+civil%2C+recover%2C+damages%2C+appeals%2C+appellate%2C+defense%2C+++script+src%3Dhttp%3A%2F%2Fwww.google-analytics.com%2Furchin.js+type%3Dtext%2Fjavascript++%2Fscript++script+type%3Dtext%2Fjavascript++_uacct+%3D+UA-767433-1%3B++urchinTracker%28%29%3B++%2Fscript%2C+legal%2C+legal+research%2C+writing%2C+briefs%2C+oral+argument%2C+appeallate+defense%2C+civil+appeals%2C+';
var metaContents  = 'Law+Office+of+Amanda+F.++Benedict.++Civil+and+Criminal+Appeals%2C+Attorney+Legal+Writing+and+Research+Services%2C+Bicycle+Accident+Litigation%2C+Automobile+Accident+Litigation.+++';
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();
};
