/* [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','1401',jdecode('About+Us'),jdecode(''),'/1401.html','true',[],'',''],
	['PAGE','5801',jdecode('Fibromyalgia+Polypain'),jdecode(''),'/5801.html','true',[],'',''],
	['PAGE','5822',jdecode('Jeff+Sarkozi%2C+MD%2CFRCPC%2CFACR+'),jdecode(''),'/5822.html','true',[],'',''],
	['PAGE','18201',jdecode('The+Fibromyalgia+Book'),jdecode(''),'/18201.html','true',[],'',''],
	['PAGE','5843',jdecode('Legal+%2F+Industry+Expert+Services'),jdecode(''),'/5843.html','true',[],'',''],
	['PAGE','5864',jdecode('Speaking+and+Lectures'),jdecode(''),'/5864.html','true',[],'',''],
	['PAGE','5885',jdecode('Media'),jdecode(''),'/5885.html','true',[],'',''],
	['PAGE','5906',jdecode('Question+of+the+Week'),jdecode(''),'/5906.html','true',[],'',''],
	['PAGE','5927',jdecode('Looking+at+the+Journals'),jdecode(''),'/5927/index.html','false',[ 
		['PAGE','9501',jdecode('Articles+-+May%2C+2009'),jdecode(''),'/5927/9501.html','true',[],'','']
	],'',''],
	['PAGE','5948',jdecode('Other+Resources'),jdecode(''),'/5948.html','true',[],'',''],
	['PAGE','5969',jdecode('Contact+Us'),jdecode(''),'/5969/index.html','true',[ 
		['PAGE','10301',jdecode('Map+and+Directions'),jdecode(''),'/5969/10301.html','true',[],'','']
	],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Business';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='2488';
theSitetree.keyvisualName='stethoskop.jpg';
theSitetree.fontsetId='420';
theSitetree.graphicsetId='463';
theSitetree.contentColor='020E66';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Business',
				paletteFamily: 	'003366',
				keyvisualId: 	'2488',
				keyvisualName: 	'stethoskop.jpg',
				fontsetId: 		'420',
				graphicsetId: 	'463',
				contentColor: 	'020E66',
				contentBGColor: 'FFFFFF',
				a_color: 		'003366',
				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['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '10301',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1401',
internalId:  '',
customField: '20110220-215951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20110220-213736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5822',
internalId:  '',
customField: '20090527-144711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5843',
internalId:  '',
customField: '20110210-113238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5906',
internalId:  '',
customField: '20090425-184044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5885',
internalId:  '',
customField: '20080713-172548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5927',
internalId:  '',
customField: '20090425-184225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9501',
internalId:  '',
customField: '20090425-184157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5948',
internalId:  '',
customField: '20090215-035913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5969',
internalId:  '',
customField: '20080713-165259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20080711-203056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5864',
internalId:  '',
customField: '20110220-205121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20090425-183148'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050IN2UYI';
var companyName   = 'Fibromyalgia+Polypain+Arthritis+Center';
var htmlTitle	  = 'Fibromyalgia+Polypain+Arthritis+Center';
var metaKeywords  = 'Fibromyalgia+Arthritis+Polypain%2CFibromyalgia%2CArthritis%2CPolypain%2CPain%2CChronic%2CChronic+Pain%2C+Chronic+Widespread+Pain%2CWidespread+Pain%2CMusculoskeletal%2C+Musculoskeletal+Pain%2CChronic+Musculoskeletal+Pain%2CChronic+Widespread+Musculoskeletal+Pain%2CSarkozi%2CJeff+Sarkozi%2CJeff+Sarkozi+MD%2CJeff+Sarkozi+MD+FRCPC%2CJeff+Sarkozi+MD+FRCPC+FACR%2CExpert%2CLegal%2CMedical+Legal%2CMedical%2CHealth%2CPhysician%2C+Medicolegal%2CWellness%2CSpeaking%2CSpeaker%2CLecture%2CTrial%2CRheumatology%2CRheumatologist%2CRheumatic+Disease%2CRheumatic+Diseases%2Coccupational%2Cindustrial%2Cenvironmental%2Cchronic+fatigue%2Crheumatoid+arthritis%2Costeoarthritis%2Cneck+pain%2Cback+pain%2Clupus%2Cscleroderma%2CRaynauds+syndrome%2Cspondylitis%2C+myositis%2Creflex+dystrophy%2Ctrauma%2Cpost-traumatic%2Cpost+traumatic+connective+tissue+disease%2C+connective+tissue%2Cmedical+malpractice+';
var metaContents  = 'The+Fibromyalgia+Polypain+Arthritis+Center+is+an+exceptional+and+unique+rheumatology+center+located+in+Orange+County%2C+California+dedicated+to+the+comprehensive+assessment%2C+thorough+diagnosis%2C+and+innovative%2C+integrated%2C+wellness-based+treatment+of+fibromyalgia%2C+chronic+widespread+musculoskeletal+pain%2C+and+the+entire+spectrum+of+complex%2C+difficult+rheumatology+conditions+and+disorders.+Our+philosophy+is+to+provide+a+patient-centered%2C+evidence-based+approach+incorporating+thorough%2C+comprehensive%2C+and+individualized+assessment+and+treatment+based+on+integrating+the+mind%2C+body%2C+and+spirit+to+promote+long-term+wellness+in+which+patients+are+fully+educated+and+empowered+partners+in+their+management.';
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();
};

