/* [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','39812',jdecode('Market+Update'),jdecode(''),'/39812.html','true',[],''],
	['PAGE','41612',jdecode('Our+Firm'),jdecode(''),'/41612.html','true',[],''],
	['PAGE','41633',jdecode('Truely+Independant'),jdecode(''),'/41633.html','true',[],''],
	['PAGE','41654',jdecode('Testimonials'),jdecode(''),'/41654.html','true',[],''],
	['PAGE','41675',jdecode('Account+Protection'),jdecode(''),'/41675.html','true',[],''],
	['PAGE','41717',jdecode('LPL+Video'),jdecode(''),'/41717.html','true',[],''],
	['PAGE','41738',jdecode('Markets+At-a-Glance'),jdecode(''),'/41738.html','true',[],''],
	['PAGE','39884',jdecode('Contact+%2F+Directions'),jdecode(''),'/39884.html','true',[],''],
	['PAGE','41759',jdecode('Links'),jdecode(''),'/41759.html','true',[],''],
	['PAGE','45912',jdecode('Client+Account+View'),jdecode(''),'/45912.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1739';
theSitetree.keyvisualName='business1.jpg';
theSitetree.fontsetId='291';
theSitetree.graphicsetId='353';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003390';
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1739',
				keyvisualName: 	'business1.jpg',
				fontsetId: 		'291',
				graphicsetId: 	'353',
				contentColor: 	'FFFFFF',
				contentBGColor: '003390',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'003390',
				b_color: 		'000000',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '39812',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1432858']={
webappId:    '1501',
documentId:  '39812',
internalId:  '1432858',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41759',
internalId:  '',
customField: '20100202-123452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39812',
internalId:  '',
customField: '20100202-140707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41612',
internalId:  '',
customField: '20100128-122545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39884',
internalId:  '',
customField: '20100128-131854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45912',
internalId:  '',
customField: '20100202-163133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41633',
internalId:  '',
customField: '20100128-123004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41654',
internalId:  '',
customField: '20100128-132715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41738',
internalId:  '',
customField: '20100208-174420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41717',
internalId:  '',
customField: '20100128-130639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41675',
internalId:  '',
customField: '20100128-130750'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050IN399E';
var companyName   = 'Ryder+Brose';
var htmlTitle	  = 'Ryder+Brose-LPL+Financial-Financial+Planning%2C+Investment+Advisor-Walnut+Creek%2C+CA';
var metaKeywords  = 'Ryder%2C+Ryder+Brose%2C+Brose%2C+Walnut+Creek%2C+CA%2C+Financial%2C+Retirement%2C+Stocks%2C+Bonds%2C+Mutual+funds%2C+Investing%2C+personal+finance%2C+investing+advice%2C+investing+news%2C+investing+tools%2C+NASDAQ%2C+Dow%2C+NYSE%2C+Get+Started+in+Stocks%2C+how+to+invest%2C+good+stocks%2C+investing+help%2C+financial+advisor%2C+wealth+manager%2C+investment+consultant%2C+asset+manager%2C+wealthy%2C+best';
var metaContents  = 'Ryder+Brose+is+a+leading+financial+advisor+and+investing+consultant.++Ryder+serves+high+net-worth+families%2C+individuals%2C+corporations%2C+foundations%2C+and+endowments+in+the+San+Francisco+Bay+Area+and+throughout+the+United+States.++Ryder+is+conveniently+located+in+Walnut+Creek%2C+CA.++Call+today+to+schedule+a+complimentary+appointment.++925-300-3222';
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();
};
