Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing HTML for Tree Menu 1

Status
Not open for further replies.

fooobee

Technical User
Nov 13, 2003
33
US
Hello all, I need help automating the creation of a tree menu. I get a .js file exported from Stellent (I can make this a HTML or text file if need be) and I need to parse out the HTML elements from it to make a tree menu. h1's are chapters, h2's are sections, and h3's are subsections. I also need to parse out he fragment ('#P212_17452') from any h1's and h2's.

Here is the .JS file and below that I will give you what the final treemenu js file. I am not very familiar with parsing out HTMl elements and would like some guidance or a quick example.

.JS file from Stellent
/* Sections.js. */

var pcor_sections = [ 0

/*<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>slicedemo Table of Contents</title>
<meta name="GENERATOR" content="Stellent Content Publisher 7.0">

<meta name="TransitPubID" content="120">

</head>
<body><a name="TopOfPage"> </a>
<!-- TRANSIT - INFOBEFORE -->
<hr size="2" width="80%">


*/ , '<h1><a href="chf%20ES.htm#P0_0" target="_top">Executive Summary </a></h1>' /*

*/ , '<h2><a href="chf%20ES.htm#P6_1060" target="_top">What are the key parameters of the CHF market?</a></h2>' /*

*/ , '<h2><a href="chf%20ES-01.htm#P10_1106" target="_top">What are the factors driving the market for CHF therapies? </a></h2>' /*

*/ , '<h2><a href="chf%20ES-02.htm#P14_2724" target="_top">What factors are constraining the market for CHF therapies? </a></h2>' /*

*/ , '<h2><a href="chf%20ES-03.htm#P17_3692" target="_top">What are the drug development activities of note in CHF? </a></h2>' /*

*/ , '<h2><a href="chf%20ES-04.htm#P21_4848" target="_top">What do the experts say? </a></h2>' /*

*/ , '<h2><a href="chf%20ES-05.htm#P28_6611" target="_top">What key challenges and opportunities remain? </a></h2>' /*

*/ , '<h1><a href="Pharmacor%20Chapter%20Head.htm#P0_0" target="_top">1. Introduction </a></h1>' /*

*/ , '<h1><a href="CHF-EP-cmc.htm#P0_0" target="_top">2. Etiology and Pathophysiology </a></h1>' /*

*/ , '<h2><a href="CHF-EP-cmc.htm#P7_960" target="_top">Etiology and Pathophysiology Overview</a></h2>' /*

*/ , '<h2><a href="CHF-EP-cmc-01.htm#P9_1980" target="_top">Anatomy</a></h2>' /*

*/ , '<h2><a href="CHF-EP-cmc-02.htm#P12_3759" target="_top">Etiology</a></h2>' /*

*/ , '<h3><a href="CHF-EP-cmc-02.htm#P13_3767" target="_top">Causes of Chronic Heart Failure </a></h3>' /*

*/ , '<h3><a href="CHF-EP-cmc-02.htm#P18_5924" target="_top">Clinical Characterization of Chronic Heart Failure </a></h3>' /*

*/ , '<h2><a href="CHF-EP-cmc-03.htm#P21_7226" target="_top">Pathophysiology</a></h2>' /*

*/ , '<h3><a href="CHF-EP-cmc-03.htm#P25_9608" target="_top">Sympathetic Nervous System</a></h3>' /*

*/ , '<h3><a href="CHF-EP-cmc-03.htm#P28_10921" target="_top">Renin-Angiotensin-Aldosterone System</a></h3>' /*

*/ , '<h3><a href="CHF-EP-cmc-03.htm#P34_13615" target="_top">Natriuretic Peptides</a></h3>' /*

*/ , '<h3><a href="CHF-EP-cmc-03.htm#P37_14887" target="_top">Endothelin-1</a></h3>' /*

*/ , '<h3><a href="CHF-EP-cmc-03.htm#P39_15408" target="_top">Immunomodulator Activity in CHF</a></h3>' /*

*/ , '<h1><a href="epi%20mock-up-cmc.htm#P5_0" target="_top">3. Epidemiology</a></h1>' /*

*/ , '<h2><a href="epi%20mock-up-cmc.htm#P38_1150" target="_top">Overview</a></h2>' /*

*/ , '<h2><a href="epi%20mock-up-cmc-01.htm#P41_2865" target="_top">Disease Definition</a></h2>' /*

*/ , '<h2><a href="epi%20mock-up-cmc-02.htm#P44_4463" target="_top">Methodology Overview</a></h2>' /*

*/ , '<h2><a href="epi%20mock-up-cmc-03.htm#P61_16869" target="_top">Major-Market Profiles</a></h2>' /*

*/ , '<h3><a href="epi%20mock-up-cmc-03.htm#P62_16890" target="_top">United States</a></h3>' /*

*/ , '<h3><a href="epi%20mock-up-cmc-03.htm#P65_18532" target="_top">France</a></h3>' /*

*/ , '<h3><a href="epi%20mock-up-cmc-03.htm#P67_19000" target="_top">Germany</a></h3>' /*

*/ , '<h3><a href="epi%20mock-up-cmc-03.htm#P70_20039" target="_top">Italy</a></h3>' /*

*/ , '<h3><a href="epi%20mock-up-cmc-03.htm#P72_21293" target="_top">Spain</a></h3>' /*

*/ , '<h3><a href="epi%20mock-up-cmc-03.htm#P75_23563" target="_top">United Kingdom</a></h3>' /*

*/ , '<h3><a href="epi%20mock-up-cmc-03.htm#P80_26567" target="_top">Japan</a></h3>' /*

*/ , '<h2><a href="epi%20mock-up-cmc-04.htm#P82_27850" target="_top">Subpopulations</a></h2>' /*

*/ , '<h1><a href="CHF-CT-cmc.htm#P5_0" target="_top">4. Current Therapies</a></h1>' /*

*/ , '<h2><a href="CHF-CT-cmc.htm#P12_846" target="_top">Overview of Current Therapies</a></h2>' /*

*/ , '<h2><a href="CHF-CT-cmc-01.htm#P16_3190" target="_top">Angiotensin-Converting Enzyme Inhibitors</a></h2>' /*

*/ , '<h3><a href="CHF-CT-cmc-01.htm#P17_3230" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-01.htm#P23_6331" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-01.htm#P27_9912" target="_top">Ramipril</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-01.htm#P31_11868" target="_top">Enalapril</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-01.htm#P36_14438" target="_top">Lisinopril</a></h3>' /*

*/ , '<h2><a href="CHF-CT-cmc-02.htm#P39_15672" target="_top">Angiotensin II Receptor Antagonists </a></h2>' /*

*/ , '<h3><a href="CHF-CT-cmc-02.htm#P40_15708" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-02.htm#P42_16829" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-02.htm#P44_17837" target="_top">Valsartan</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-02.htm#P50_22036" target="_top">Candesartan</a></h3>' /*

*/ , '<h2><a href="CHF-CT-cmc-03.htm#P56_26286" target="_top">Diuretics </a></h2>' /*

*/ , '<h3><a href="CHF-CT-cmc-03.htm#P57_26296" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-03.htm#P61_28399" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-03.htm#P63_29545" target="_top">Furosemide</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-03.htm#P65_30276" target="_top">Chlorothiazide</a></h3>' /*

*/ , '<h2><a href="CHF-CT-cmc-04.htm#P67_30922" target="_top">Aldosterone Antagonists</a></h2>' /*

*/ , '<h3><a href="CHF-CT-cmc-04.htm#P68_30945" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-04.htm#P70_32123" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-04.htm#P73_33147" target="_top">Spironolactone </a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-04.htm#P77_35246" target="_top">Eplerenone</a></h3>' /*

*/ , '<h2><a href="CHF-CT-cmc-05.htm#P80_37565" target="_top">Beta Blockers </a></h2>' /*

*/ , '<h3><a href="CHF-CT-cmc-05.htm#P81_37579" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-05.htm#P83_38452" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-05.htm#P85_39243" target="_top">Carvedilol</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-05.htm#P89_41813" target="_top">Metoprolol</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-05.htm#P92_43636" target="_top">Bisoprolol</a></h3>' /*

*/ , '<h2><a href="CHF-CT-cmc-06.htm#P95_45111" target="_top">Inotropic Agents</a></h2>' /*

*/ , '<h3><a href="CHF-CT-cmc-06.htm#P96_45127" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-06.htm#P98_45758" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="CHF-CT-cmc-06.htm#P100_46806" target="_top">Digoxin</a></h3>' /*

*/ , '<h2><a href="CHF-CT-cmc-07.htm#P104_48541" target="_top">Nonpharmacological Approaches </a></h2>' /*

*/ , '<h1><a href="chf%20MP-cmc.htm#P0_0" target="_top">5. Medical Practice</a></h1>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P10_746" target="_top">First-Line Therapy</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P11_764" target="_top">Second-Line Therapy</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P12_783" target="_top"><img src="Table%20of%20Contents-1t.gif" border="0" width="9" height="5"></a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P13_783" target="_top">US</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P14_785" target="_top">ACEI + Beta blocker</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P15_804" target="_top">Add Diuretic +/- digoxin</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P16_828" target="_top"><img src="Table%20of%20Contents-2t.gif" border="0" width="8" height="5"></a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P17_828" target="_top">FR</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P18_830" target="_top">Watchful waiting</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P19_846" target="_top">ACEI</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P20_850" target="_top"><img src="Table%20of%20Contents-3t.gif" border="0" width="8" height="5"></a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P21_850" target="_top">GE</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P22_852" target="_top">ACEI</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P23_856" target="_top">Add Diuretic</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P24_868" target="_top"><img src="Table%20of%20Contents-4t.gif" border="0" width="8" height="4"></a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P25_868" target="_top">IT</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P26_870" target="_top">ACEI + Beta blocker</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P27_889" target="_top">Add Diuretic</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P28_901" target="_top"><img src="Table%20of%20Contents-5t.gif" border="0" width="7" height="4"></a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P29_901" target="_top">SP</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P30_903" target="_top">ACEI + Beta blocker</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P31_922" target="_top">Add Diuretic</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P32_934" target="_top"><img src="Table%20of%20Contents-6t.gif" border="0" width="7" height="5"></a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P33_934" target="_top">UK</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P34_936" target="_top">ACEI + Beta blocker</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P35_955" target="_top">Add Diuretic +/- digoxin</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P36_979" target="_top"><img src="Table%20of%20Contents-7t.gif" border="0" width="2" height="2"></a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P37_979" target="_top"><img src="Table%20of%20Contents-8t.gif" border="0" width="6" height="5"></a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P38_979" target="_top">JA</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P39_981" target="_top">ACE</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc.htm#P40_984" target="_top">Add Diuretic +/- digoxin</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc-01.htm#P42_1008" target="_top">Overview</a></h2>' /*

*/ , '<h3><a href="chf%20MP-cmc-01.htm#P45_2994" target="_top">Disease Prevention and Screening</a></h3>' /*

*/ , '<h3><a href="chf%20MP-cmc-01.htm#P48_5188" target="_top">Diagnosis and Referral </a></h3>' /*

*/ , '<h2><a href="chf%20MP-cmc-02.htm#P76_12051" target="_top">Treatment Guidelines</a></h2>' /*

*/ , '<h2><a href="chf%20MP-cmc-03.htm#P85_16771" target="_top">Major-Market Profiles </a></h2>' /*

*/ , '<h3><a href="chf%20MP-cmc-03.htm#P86_16793" target="_top">United States </a></h3>' /*

*/ , '<h3><a href="chf%20MP-cmc-03.htm#P92_19859" target="_top">France </a></h3>' /*

*/ , '<h3><a href="chf%20MP-cmc-03.htm#P99_24404" target="_top">Germany </a></h3>' /*

*/ , '<h3><a href="chf%20MP-cmc-03.htm#P105_27369" target="_top">Italy </a></h3>' /*

*/ , '<h3><a href="chf%20MP-cmc-03.htm#P112_31655" target="_top">Spain</a></h3>' /*

*/ , '<h3><a href="chf%20MP-cmc-03.htm#P117_34646" target="_top">United Kingdom</a></h3>' /*

*/ , '<h3><a href="chf%20MP-cmc-03.htm#P126_39532" target="_top">Japan</a></h3>' /*

*/ , '<h1><a href="CHF-UN_cmc.htm#P0_0" target="_top">6. Unmet Needs</a></h1>' /*

*/ , '<h2><a href="CHF-UN_cmc.htm#P7_1160" target="_top">Overview</a></h2>' /*

*/ , '<h3><a href="CHF-UN_cmc.htm#P9_1882" target="_top">More-Efficacious Agents for Classes III and IV Patients </a></h3>' /*

*/ , '<h3><a href="CHF-UN_cmc.htm#P12_2963" target="_top">Increased Use of Existing Drugs in Classes I and II </a></h3>' /*

*/ , '<h3><a href="CHF-UN_cmc.htm#P15_4760" target="_top">Improved Diagnosis </a></h3>' /*

*/ , '<h3><a href="CHF-UN_cmc.htm#P18_6145" target="_top">Improved Compliance </a></h3>' /*

*/ , '<h3><a href="CHF-UN_cmc.htm#P21_7756" target="_top">Improved Surgery </a></h3>' /*

*/ , '<h1><a href="chf%20ET-cmc.htm#P0_0" target="_top">7. Emerging Therapies</a></h1>' /*

*/ , '<h2><a href="chf%20ET-cmc.htm#P6_944" target="_top"><img src="Table%20of%20Contents-9t.gif" border="0" width="96" height="63"></a></h2>' /*

*/ , '<h2><a href="chf%20ET-cmc-01.htm#P8_944" target="_top"><img src="Table%20of%20Contents-10t.gif" border="0" width="96" height="54"></a></h2>' /*

*/ , '<h2><a href="chf%20ET-cmc-02.htm#P9_944" target="_top">Emerging Therapies Overview</a></h2>' /*

*/ , '<h2><a href="chf%20ET-cmc-03.htm#P576_7866" target="_top">Angiotensin II Receptor Antagonists </a></h2>' /*

*/ , '<h3><a href="chf%20ET-cmc-03.htm#P577_7902" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-03.htm#P579_9720" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-03.htm#P581_10793" target="_top">Telmisartan</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-03.htm#P584_12451" target="_top">Irbesartan</a></h3>' /*

*/ , '<h2><a href="chf%20ET-cmc-04.htm#P587_13672" target="_top">Vasopeptidase Inhibitors </a></h2>' /*

*/ , '<h3><a href="chf%20ET-cmc-04.htm#P588_13697" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-04.htm#P590_14814" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-04.htm#P594_16416" target="_top">Omapatrilat </a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-04.htm#P600_20154" target="_top">Gemopatrilat </a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-04.htm#P602_20615" target="_top">MDL-100240 </a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-04.htm#P604_20947" target="_top">AVE-7688</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-04.htm#P606_21803" target="_top">Sampatrilat</a></h3>' /*

*/ , '<h2><a href="chf%20ET-cmc-05.htm#P608_22274" target="_top">Arginine Vasopressin Receptor Antagonists</a></h2>' /*

*/ , '<h3><a href="chf%20ET-cmc-05.htm#P609_22315" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-05.htm#P612_23143" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-05.htm#P615_23933" target="_top">Conivaptan</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-05.htm#P621_26470" target="_top">Tolvaptan </a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-05.htm#P627_29295" target="_top">SR-121463 </a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-05.htm#P629_29941" target="_top">OPC-21268</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-05.htm#P631_30354" target="_top">OPC-31260</a></h3>' /*

*/ , '<h2><a href="chf%20ET-cmc-06.htm#P633_30685" target="_top">Endothelin Receptor Antagonists</a></h2>' /*

*/ , '<h3><a href="chf%20ET-cmc-06.htm#P634_30716" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-06.htm#P636_31127" target="_top">Mechanism of Action </a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-06.htm#P639_31967" target="_top">Bosentan </a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-06.htm#P643_32999" target="_top">J-104132 </a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-06.htm#P645_33587" target="_top">Sitaxsentan </a></h3>' /*

*/ , '<h2><a href="chf%20ET-cmc-07.htm#P649_34532" target="_top">Adenosine A1 Receptor Antagonists </a></h2>' /*

*/ , '<h3><a href="chf%20ET-cmc-07.htm#P650_34566" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-07.htm#P652_35297" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-07.htm#P655_35936" target="_top">BG9928 (Adentri)</a></h3>' /*

*/ , '<h2><a href="chf%20ET-cmc-08.htm#P659_36810" target="_top">Anti-TNF-&#945; Agents </a></h2>' /*

*/ , '<h3><a href="chf%20ET-cmc-08.htm#P660_36829" target="_top">Overview </a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-08.htm#P662_37217" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-08.htm#P664_37671" target="_top">Etanercept </a></h3>' /*

*/ , '<h2><a href="chf%20ET-cmc-09.htm#P667_39057" target="_top">Nonspecific Auto-Antigen Stimulation</a></h2>' /*

*/ , '<h3><a href="chf%20ET-cmc-09.htm#P668_39093" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-09.htm#P670_39465" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-09.htm#P672_40350" target="_top">Celacade</a></h3>' /*

*/ , '<h2><a href="chf%20ET-cmc-10.htm#P675_41499" target="_top">Natriuretic Peptides</a></h2>' /*

*/ , '<h3><a href="chf%20ET-cmc-10.htm#P676_41519" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-10.htm#P678_42403" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-10.htm#P680_43279" target="_top">Recombinant BNP (Nesiritide) </a></h3>' /*

*/ , '<h2><a href="chf%20ET-cmc-11.htm#P685_44765" target="_top">Inotropic Agents </a></h2>' /*

*/ , '<h3><a href="chf%20ET-cmc-11.htm#P686_44782" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-11.htm#P689_45781" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-11.htm#P693_47202" target="_top">Levosimendan</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-11.htm#P701_53254" target="_top">Enoximone </a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-11.htm#P705_55315" target="_top">Oxypurinol</a></h3>' /*

*/ , '<h2><a href="chf%20ET-cmc-12.htm#P712_57690" target="_top">Dual Neutral Endopeptidase/Endothelin-Converting Enzyme Inhibitors</a></h2>' /*

*/ , '<h3><a href="chf%20ET-cmc-12.htm#P713_57756" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-12.htm#P715_57970" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-12.htm#P718_58667" target="_top">SLV-306</a></h3>' /*

*/ , '<h2><a href="chf%20ET-cmc-13.htm#P721_59287" target="_top">Dopamine D2 Receptor Agonists</a></h2>' /*

*/ , '<h3><a href="chf%20ET-cmc-13.htm#P722_59316" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-13.htm#P724_60750" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-13.htm#P726_61059" target="_top">Nolomirole</a></h3>' /*

*/ , '<h2><a href="chf%20ET-cmc-14.htm#P728_62218" target="_top">Advanced Glycosylation End-Point Breakers</a></h2>' /*

*/ , '<h3><a href="chf%20ET-cmc-14.htm#P729_62259" target="_top">Overview</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-14.htm#P731_62805" target="_top">Mechanism of Action</a></h3>' /*

*/ , '<h3><a href="chf%20ET-cmc-14.htm#P733_63041" target="_top">ALT-711</a></h3>' /*

*/ , '<h1><a href="CHF-MKTcmc.htm#P5_0" target="_top">8. Market Outlook</a></h1>' /*

*/ , '<h2><a href="CHF-MKTcmc.htm#P12_1200" target="_top">Overview</a></h2>' /*

*/ , '<h2><a href="CHF-MKTcmc-01.htm#P27_5555" target="_top">Drug-Class-Specific Trends</a></h2>' /*

*/ , '<h3><a href="CHF-MKTcmc-01.htm#P28_5581" target="_top">Angiotensin-Converting Enzyme Inhibitors</a></h3>' /*

*/ , '<h3><a href="CHF-MKTcmc-01.htm#P32_7215" target="_top">Angiotensin II Receptor Antagonists</a></h3>' /*

*/ , '<h3><a href="CHF-MKTcmc-01.htm#P37_9005" target="_top">Beta Blockers</a></h3>' /*

*/ , '<h3><a href="CHF-MKTcmc-01.htm#P40_10052" target="_top">Diuretics</a></h3>' /*

*/ , '<h3><a href="CHF-MKTcmc-01.htm#P44_10660" target="_top">Aldosterone Antagonists </a></h3>' /*

*/ , '<h3><a href="CHF-MKTcmc-01.htm#P47_11662" target="_top">Inotropic Agents</a></h3>' /*

*/ , '<h3><a href="CHF-MKTcmc-01.htm#P50_12388" target="_top">Vasopeptidase Inhibitors</a></h3>' /*

*/ , '<h3><a href="CHF-MKTcmc-01.htm#P52_12897" target="_top">Arginine Vasopressin Antagonists</a></h3>' /*

*/ , '<h3><a href="CHF-MKTcmc-01.htm#P55_13356" target="_top">Natriuretic Peptides</a></h3>' /*

*/ , '<h2><a href="CHF-MKTcmc-02.htm#P57_13644" target="_top">Region-Specific Trends </a></h2>' /*

*/ , '<h1><a href="Bibiography.htm#P0_0" target="_top">Appendix A. Bibliography&#8212;Chronic Heart Failure</a></h1>' /*

*/ , '<h1><a href="Experts%20Interviewed.htm#P0_0" target="_top">Appendix C. Experts Interviewed&#8212;Chronic Heart Failure</a></h1>' /*

*/ , '<h1><a href="Market%20Forecast%20Methodology.htm#P0_0" target="_top">Appendix B. Market Forecast Methodology</a></h1>' /*

*/ , '<h2><a href="Market%20Forecast%20Methodology.htm#P1_39" target="_top">General Statement About Patient Population</a></h2>' /*

*/ , '<h2><a href="Market%20Forecast%20Methodology-01.htm#P3_469" target="_top">General Sources of Data </a></h2>' /*

*/ , '<h2><a href="Market%20Forecast%20Methodology-02.htm#P5_1007" target="_top">Definitions of Agents Included in Class Categories </a></h2>' /*

*/ , '<h2><a href="Market%20Forecast%20Methodology-03.htm#P8_1260" target="_top">General Statements About Pricing</a></h2>' /*

*/ , '<h2><a href="Market%20Forecast%20Methodology-04.htm#P31_3491" target="_top">Pricing Assumptions </a></h2>' /*

*/ , '<h3><a href="Market%20Forecast%20Methodology-04.htm#P36_4308" target="_top">Days of Therapy and Compliance</a></h3>' /*

*/ , '<h3><a href="Market%20Forecast%20Methodology-04.htm#P39_5234" target="_top">Emerging Therapy Prices</a></h3>' /*

*/ , '<h2><a href="Market%20Forecast%20Methodology-05.htm#P42_5870" target="_top">Significant Events Impacting the Disease Marketplace</a></h2>' /*

*/ , '<h3><a href="Market%20Forecast%20Methodology-05.htm#P43_5922" target="_top">Percentage Diagnosed</a></h3>' /*

*/ , '<h3><a href="Market%20Forecast%20Methodology-05.htm#P45_6470" target="_top">Percentage Drug-Treated</a></h3>' /*

*/ , '<h3><a href="Market%20Forecast%20Methodology-05.htm#P47_6882" target="_top">Patient Share</a></h3>' /*<!-- TRANSIT - INFOAFTER -->
</body>
</html> */



The tree_nodes.js (final).
var TREE_NODES = [
f(["Executive Summary", "chf-ES.htm", null,
f(["Key Findings", "chf-ES.htm", null]),
f(["What are the key parameters of the CHF market?", "chf-ES-cmc-00.htm", null]),
f(["What are the factors driving the market for CHF therapies?", "chf-ES-01.htm", null]),
f(["What factors are constraining the market for CHF therapies?", "chf-ES-02.htm", null]),
f(["What are the drug development activities of note in CHF?", "chf-ES-03.htm", null]),
f(["What do the experts say?", "chf-ES-04.htm", null]),
f(["What key challenges and opportunities remain?", "chf-ES-05.htm", null])
]),

f(["Introduction", "Pharmacor-Chapter-Head.htm", null,{format:{isFolder:true}}]),

f(["Etiology & Pathophysiology", "CHF-EP-cmc.htm", null,
f(["Key Findings", "CHF-EP-cmc.htm", null]),
f(["Overview", "CHF-EP-cmc-00.htm", null]),
f(["Anatomy", "chf-EP-cmc-01.htm", null]),
f(["Etiology", "CHF-EP-cmc-02.htm", null,
f(["Causes of Chronic Heart Failure", "CHF-EP-cmc-02.htm#P13_3767", null]),
f(["Clinical Characterization of Chronic Heart Failure", "CHF-EP-cmc-02.htm#P18_5924", null])
]),
f(["Pathophysiology", "CHF-EP-cmc-03.htm", null,
f(["Sympathetic Nervous System", "CHF-EP-cmc-03.htm#P25_9608", null]),
f(["Renin-Angiotensin-Aldosterone System", "CHF-EP-cmc-03.htm#P28_10921", null]),
f(["Natriuretic Peptides", "CHF-EP-cmc-03.htm#P34_13615", null]),
f(["Endothelin-1", "CHF-EP-cmc-03.htm#P37_14887", null]),
f([{id:1234}, "Immunomodulator Activity in CHF", "CHF-EP-cmc-03.htm#P39_15408", null])
]) ]),

f(["Epidemiology", "epi-mock-up-cmc.htm", null,
f(["Key Findings", "epi-mock-up-cmc.htm", null]),
f(["Overview", "epi-mock-up-cmc-00.htm", null]),
f(["Disease Definition", "epi-mock-up-cmc-01.htm", null]),
f(["Methodology Overview", "epi-mock-up-cmc-02.htm", null]),
f(["Major-Market Profiles", "epi-mock-up-cmc-03.htm", null,
f(["United States", "epi-mock-up-cmc-03.htm#P62_16890", null]),
f(["France", "epi-mock-up-cmc-03.htm#P65_18532", null]),
f(["Germany", "epi-mock-up-cmc-03.htm#P67_19000", null]),
f(["Italy", "epi-mock-up-cmc-03.htm#P70_20039", null]),
f(["Spain", "epi-mock-up-cmc-03.htm#P72_21293", null]),
f(["United Kingdom", "epi-mock-up-cmc-03.htm#P75_23563", null]),
f(["Japan", "epi-mock-up-cmc-03.htm#P80_26567", null])
]),
f(["Subpopulations","epi-mock-up-cmc-04.htm", null])
]),

f(["Current Therapies", "CHF-CT-cmc.htm", null,
f(["Key Findings", "CHF-CT-cmc.htm", null]),
f(["Overview", "CHF-CT-cmc-00.htm", null]),
f(["Angiotensin-Converting Enzyme Inhibitors", "CHF-CT-cmc-01.htm", null,
f(["Overview", "CHF-CT-cmc-01.htm#P17_3230", null]),
f(["Mechanism of Action", "CHF-CT-cmc-01.htm#P23_6331", null]),
f(["Ramipril", "CHF-CT-cmc-01.htm#P27_9912", null]),
f(["Enalapril", "CHF-CT-cmc-01.htm#P31_11868", null]),
f(["Lisinopril", "CHF-CT-cmc-01.htm#P36_14438", null])
]),
f(["Angiotensin II Receptor Antagonists","CHF-CT-cmc-02.htm", null,
f(["Overview", "CHF-CT-cmc-02.htm#P40_15708", null]),
f(["Mechanism of Action", "CHF-CT-cmc-02.htm#P42_16829", null]),
f(["Valsartan", "CHF-CT-cmc-02.htm#P44_17837", null]),
f(["Candesartan", "CHF-CT-cmc-02.htm#P50_22036", null])
]),
f(["Diuretics","CHF-CT-cmc-03.htm", null,
f(["Overview", "CHF-CT-cmc-03.htm#P57_26296", null]),
f(["Mechanism of Action", "CHF-CT-cmc-03.htm#P61_28399", null]),
f(["Furosemide", "CHF-CT-cmc-03.htm#P63_29545", null]),
f(["Chlorothiazide", "CHF-CT-cmc-03.htm#P65_30276", null])
]),
f(["Aldosterone Antagonists","CHF-CT-cmc-04.htm", null,
f(["Overview", "CHF-CT-cmc-04.htm#P68_30945", null]),
f(["Mechanism of Action", "CHF-CT-cmc-03.htm#P61_28399", null]),
f(["Spironolactone", "CHF-CT-cmc-04.htm#P73_33147", null]),
f(["Eplerenone", "CHF-CT-cmc-04.htm#P77_35246", null])
]),
f(["Beta Blockers ","CHF-CT-cmc-05.htm", null,
f(["Overview", "CHF-CT-cmc-03.htm#P57_26296", null]),
f(["Mechanism of Action", "CHF-CT-cmc-05.htm#P83_38452", null]),
f(["Carvedilol", "CHF-CT-cmc-05.htm#P85_39243", null]),
f(["Metoprolol", "CHF-CT-cmc-05.htm#P89_41813", null]),
f(["Bisoprolol", "CHF-CT-cmc-05.htm#P92_43636", null])
]),
f(["Inotropic Agents","CHF-CT-cmc-06.htm", null,
f(["Overview", "CHF-CT-cmc-06.htm#P96_45127", null]),
f(["Mechanism of Action", "CHF-CT-cmc-06.htm#P98_45758", null]),
f(["Digoxin", "CHF-CT-cmc-06.htm#P100_46806", null])
]),
f(["Nonpharmacological Approaches ","CHF-CT-cmc-07.htm", null])

]),

f(["Medical Practice", "chf-MP-cmc.htm", null,
f(["Key Findings", "chf-MP-cmc.htm", null]),
f(["Overview", "chf-MP-cmc-01.htm", null,
f(["Disease Prevention and Screening", "chf-MP-cmc-01.htm#P45_2994", null]),
f(["Diagnosis and Referral", "chf-MP-cmc-01.htm#P48_5188", null])
]),
f(["Treatment Guidelines","chf-MP-cmc-02.htm", null]),
f(["Major-Market Profiles","chf-MP-cmc-03.htm", null,
f(["United States", "chf-MP-cmc-03.htm#P86_16793", null]),
f(["France", "chf-MP-cmc-03.htm#P92_19859", null]),
f(["Germany", "chf-MP-cmc-03.htm#P99_24404", null]),
f(["Italy", "chf-MP-cmc-03.htm#P105_27369", null]),
f(["Spain", "chf-MP-cmc-03.htm#P112_31655", null]),
f(["United Kingdom", "chf-MP-cmc-03.htm#P117_34646", null]),
f(["Japan", "chf-MP-cmc-03.htm#P126_39532", null])
]) ]),

f(["Unmet Needs", "CHF-UN_cmc.htm", null,
f(["Key Findings", "CHF-UN_cmc.htm", null]),
f(["Overview", "CHF-UN_cmc-00.htm", null,
f(["More-Efficacious Agents for Classes III and IV Patients", "CHF-UN_cmc-00.htm#P9_1882", null]),
f(["Increased Use of Existing Drugs in Classes I and II", "CHF-UN_cmc-00.htm#P12_2963", null]),
f(["Improved Diagnosis", "CHF-UN_cmc-00.htm#P15_4760", null]),
f(["Improved Compliance", "CHF-UN_cmc-00.htm#P18_6145", null]),
f(["Improved Surgery", "CHF-UN_cmc-00.htm#P21_7756", null])
]) ]),

f(["Emerging Therapies", "chf-ET-cmc.htm", null,
f(["Key Findings", "chf-ET-cmc.htm", null]),
f(["Emerging Therapies Overview", "chf-ET-cmc-02.htm", null]),
f(["Angiotensin II Receptor Antagonists", "chf-ET-cmc-03.htm", null,
f(["Overview", "chf-ET-cmc-03.htm#P577_7902", null]),
f(["Mechanism of Action", "chf-ET-cmc-03.htm#P579_9720", null]),
f(["Telmisartan", "chf-ET-cmc-03.htm#P581_10793", null]),
f(["Irbesartan", "chf-ET-cmc-03.htm#P584_12451", null])
]),
f(["Vasopeptidase Inhibitors", "chf-ET-cmc-04.htm", null,
f(["Overview", "chf-ET-cmc-04.htm#P588_13697", null]),
f(["Mechanism of Action", "chf-ET-cmc-04.htm#P590_14814", null]),
f(["Omapatrilat", "chf-ET-cmc-04.htm#P594_16416", null]),
f(["Gemopatrilat", "chf-ET-cmc-04.htm#P600_20154", null]),
f(["MDL-100240", "chf-ET-cmc-04.htm#P602_20615", null]),
f(["AVE-7688", "chf-ET-cmc-04.htm#P604_20947", null]),
f(["Sampatrilat", "chf-ET-cmc-04.htm#P606_21803", null])
]),
f(["Arginine Vasopressin Receptor Antagonists", "chf-ET-cmc-05.htm", null,
f(["Overview", "chf-ET-cmc-05.htm#P609_22315", null]),
f(["Mechanism of Action", "chf-ET-cmc-05.htm#P612_23143", null]),
f(["Conivaptan", "chf-ET-cmc-05.htm#P615_23933", null]),
f(["Tolvaptan", "chf-ET-cmc-05.htm#P621_26470", null]),
f(["SR-121463", "chf-ET-cmc-05.htm#P627_29295", null]),
f(["OPC-21268", "chf-ET-cmc-05.htm#P629_29941", null]),
f(["OPC-31260", "chf-ET-cmc-05.htm#P631_30354", null])
]),
f(["Endothelin Receptor Antagonists", "chf-ET-cmc-06.htm", null,
f(["Overview", "chf-ET-cmc-06.htm#P634_30716", null]),
f(["Mechanism of Action", "chf-ET-cmc-06.htm#P636_31127", null]),
f(["Bosentan", "chf-ET-cmc-06.htm#P639_31967", null]),
f(["J-104132", "chf-ET-cmc-06.htm#P643_32999", null]),
f(["Sitaxsentan", "chf-ET-cmc-06.htm#P645_33587", null])
]),
f(["Adenosine A1 Receptor Antagonists", "chf-ET-cmc-07.htm", null,
f(["Overview", "chf-ET-cmc-07.htm#P650_34566", null]),
f(["Mechanism of Action", "chf-ET-cmc-07.htm#P652_35297", null]),
f(["BG9928 (Adentri)", "chf-ET-cmc-07.htm#P655_35936", null])
]),
f(["Anti-TNF-\u03b1 Agents", "chf-ET-cmc-08.htm", null,
f(["Overview", "chf-ET-cmc-08.htm#P660_36829", null]),
f(["Mechanism of Action", "chf-ET-cmc-08.htm#P662_37217", null]),
f(["Etanercept", "chf-ET-cmc-08.htm#P664_37671", null])
]),
f(["Nonspecific Auto-Antigen Stimulation", "chf-ET-cmc-09.htm", null,
f(["Overview", "chf-ET-cmc-09.htm#P668_39093", null]),
f(["Mechanism of Action", "chf-ET-cmc-09.htm#P670_39465", null]),
f(["Celacade", "chf-ET-cmc-09.htm#P672_40350", null])
]),
f(["Natriuretic Peptides", "chf-ET-cmc-10.htm", null,
f(["Overview", "chf-ET-cmc-10.htm#P676_41519", null]),
f(["Mechanism of Action", "chf-ET-cmc-10.htm#P678_42403", null]),
f(["Recombinant BNP (Nesiritide)", "chf-ET-cmc-10.htm#P680_43279", null])
]),
f(["Inotropic Agents", "chf-ET-cmc-11.htm", null,
f(["Overview", "chf-ET-cmc-11.htm#P686_44782", null]),
f(["Mechanism of Action", "chf-ET-cmc-11.htm#P689_45781", null]),
f(["Levosimendan", "chf-ET-cmc-11.htm#P693_47202", null]),
f(["Enoximone", "chf-ET-cmc-11.htm#P701_53254", null]),
f(["Oxypurinol", "chf-ET-cmc-11.htm#P705_55315", null])
]),
f(["Dual Neutral Endopeptidase/Endothelin-Converting Enzyme Inhibitors", "chf-ET-cmc-12.htm", null,
f(["Overview", "chf-ET-cmc-12.htm#P713_57756", null]),
f(["Mechanism of Action", "chf-ET-cmc-12.htm#P715_57970", null]),
f(["SLV-306", "chf-ET-cmc-12.htm#P718_58667", null])
]),
f(["Dopamine D2 Receptor Agonists", "chf-ET-cmc-13.htm", null,
f(["Overview", "chf-ET-cmc-13.htm#P722_59316", null]),
f(["Mechanism of Action", "chf-ET-cmc-13.htm#P724_60750", null]),
f(["Nolomirole", "chf-ET-cmc-13.htm#P726_61059", null])
]),
f(["Advanced Glycosylation End-Point Breakers", "chf-ET-cmc-14.htm", null,
f(["Overview", "chf-ET-cmc-14.htm#P729_62259", null]),
f(["Mechanism of Action", "chf-ET-cmc-14.htm#P731_62805", null]),
f(["ALT-711", "chf-ET-cmc-14.htm#P733_63041", null])
]) ]),

f(["Market Outlook", "CHF-MKTcmc.htm", null,
f(["Key Findings", "CHF-MKTcmc.htm", null]),
f(["Overview", "CHF-MKTcmc-00.htm", null]),
f(["Drug-Class-Specific Trends", "CHF-MKTcmc-01.htm", null,
f(["Angiotensin-Converting Enzyme Inhibitors", "CHF-MKTcmc-01.htm#P28_5581", null]),
f(["Angiotensin II Receptor Antagonists", "CHF-MKTcmc-01.htm#P32_7215", null]),
f(["Beta Blockers", "CHF-MKTcmc-01.htm#P37_9005", null]),
f(["Diuretics", "CHF-MKTcmc-01.htm#P40_10052", null]),
f(["Aldosterone Antagonists", "CHF-MKTcmc-01.htm#P44_10660", null]),
f(["Inotropic Agents", "CHF-MKTcmc-01.htm#P47_11662", null]),
f(["Vasopeptidase Inhibitors", "CHF-MKTcmc-01.htm#P50_12388", null]),
f(["Arginine Vasopressin Antagonists", "CHF-MKTcmc-01.htm#P52_12897", null]),
f(["Natriuretic Peptides", "CHF-MKTcmc-01.htm#P55_13356", null])
]),
f(["Region-Specific Trends", "CHF-MKTcmc-02.htm", null])
]),

f(["Bibliography", "Bibiography.htm", null,{format:{isFolder:true}}]),

f(["Experts Interviewed", "Experts%20Interviewed.htm", null,{format:{isFolder:true}}]),

f(["Market Forecast Methodology", "Market-Forecast-Methodology.htm", null,
f(["General Statement About Patient Population", "Market-Forecast-Methodology.htm", null]),
f(["General Sources of Data", "Market-Forecast-Methodology-01.htm", null]),
f(["Definitions of Agents Included in Class Categories", "Market-Forecast-Methodology-02.htm", null]),
f(["General Statements About Pricing", "Market-Forecast-Methodology-03.htm", null]),
f(["Pricing Assumptions", "Market-Forecast-Methodology-04.htm", null,
f(["Days of Therapy and Compliance", "Market-Forecast-Methodology-04.htm#P36_4308", null]),
f(["Emerging Therapy Prices", "Market-Forecast-Methodology-04.htm#P39_5234", null]) ]),
f(["Significant Events Impacting the Disease Marketplace", "Market-Forecast-Methodology-05.htm", null,
f(["Percentage Diagnosed", "Market-Forecast-Methodology-05.htm#P43_5922", null]),
f(["Percentage Drug-Treated", "Market-Forecast-Methodology-05.htm#P45_6470", null]),
f(["Patient Share", "Market-Forecast-Methodology-05.htm#P47_6882", null])
]),

f(["Market Assumptions","Market%20Assumptions.htm",null])
])

];

Thanks


 
The actual file has it missing. How would I go about doing this then?
 
Well - if you're including the script directly from their site, you couldn't, as the JS would be invalid, and effectively ignored (meaning you couldn't parse it).

Is this the case? If so, maybe you can ask Stellent for technical support with making it right (assuming it's not an in-house macro that someone has written, etc).

Hope this helps,
Dan





[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
If I can get that array terminated how would I go about parsing out the revelevant h heads?
 
This is how you would parse the headings if the array were correctly terminated:

Code:
<html>
<head>
	<script type="text/javascript">
	/* Sections.js. */

	var pcor_sections = [ 0

	/*<html>
	...
	</html> */
	];

	function findSections() {
		var outputHTML = '';
		for (var loop=0; loop<pcor_sections.length; loop++) {
			var str = '' + pcor_sections[loop];
			// discard any line without a heading element at the start
			if (str.indexOf('<h') != 0) continue;
			outputHTML += str + '\n';
		}
		document.getElementsByTagName('body')[0].innerHTML = outputHTML;
	}

	onload = findSections;

	</script>
</head>
<body>
</body>
</html>

I've cut out most of the content, but left the HEAD tags in place so you can see where it would go. I've also put in the array terminator.

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hey Dan,

Your solution doesn't suit me. I don't just need to parse out the html, but also alter the array so I can call it in the final Js file. here is a shorter version of what I am trying to do. I am new to JS regular expressions, and as you know they can be quite tedious.

I have to convert this array to exactly match the 2nd variable(TREE_NODES).

var pcor_sections = [ 0

,'<p class="chap"><a href="chf-ES.htm#P6_36" target="_top">Executive Summary</a></p>'

,'<p class="ahead"><a href="chf-ES-cmc-00.htm#P52_1438" target="_top">What are the key parameters of the CHF market?</a></p>'

,'<p class="chap"><a href="Pharmacor-Chapter-Head.htm#P89_11313" target="_top">Introduction</a></p>'

,'<p class="chap"><a href="CHF-EP-cmc.htm#P210_16143" target="_top">Etiology and Pathophysiology </a></p>'

,'<p class="ahead"><a href="CHF-EP-cmc-02.htm#P242_29404" target="_top">Etiology</a></p>'

,'<p class="bhead"><a href="CHF-EP-cmc-02.htm#P13_3767" target="_top">Causes of Chronic Heart Failure</a></p>'

,'<p class="bhead"><a href="CHF-EP-cmc-02.htm#P18_5924" target="_top">Clinical Characterization of Chronic Heart Failure</a></p>'

,'<p class="ahead"><a href="epi-mock-up-cmc-03.htm#P62_16890" target="_top">United States</a></p>'

,'<p class="chap"><a href="chf-ct.htm" target="_top">Current Therapies</a></p>'

,'<p class="ahead"><a href="chf-ct-cmc-00.htm" target="_top">Diuretics</a></p>'

];


var TREE_NODES = [

f(["Executive Summary", "chf-ES.htm", null,
f(["What are the key parameters of the CHF market?", "chf-ES-cmc-00.htm", null]),
]),


f(["Introduction", "Pharmacor-Chapter-Head.htm", null,{format:{isFolder:true}}]),


f(["Etiology & Pathophysiology", "CHF-EP-cmc.htm", null,
f(["Etiology", "CHF-EP-cmc-02.htm", null,
f(["Causes of Chronic Heart Failure", "CHF-EP-cmc-02.htm#P13_3767", null]),
f(["Clinical Characterization of Chronic Heart Failure", "CHF-EP-cmc-02.htm#P18_5924", null])
]),
f(["United States", "epi-mock-up-cmc-03.htm#P62_16890", null]),
]),


f(["Current Therapies", "chf-ct.htm", null,
f(["Diuretics", "chf-ct-cmc-00.htm", null]),
]),

];


Rules
remove #p242_2393 framgments where the classes= chap or ahead
if a chap has no ahead or bhead following it then we need to add {format:{isFolder:true}}
 
Would you be able to help me, this is what I got so far, but it's all screwy. I just recently started using js.

<html>
<head>
<script type="text/javascript">
Array.prototype.parseHTML=function(){
var l=this.length,i;
var nArray=new Array();
for(i=1;i<l;i++)nArray[nArray.length]=this.match(/^<p\s+class=[\"\']?(\w*)[\"\']?[^>]*><a href=[\"\']?([^\"\' ]*)[\"\']?[^>]*?>\s*(.*?)\s*<\/a>s*<\/p>\s*$/i);
var oArray=new Array(),tmp1;
for(i=0,l=nArray.length;i<l;i++){
tmp1=(nArray[1]=="chap"||nArray[1]=="ahead")?nArray[2].split("#")[0]:nArray[2];
oArray[oArray.length]=(nArray[1]=="chap"&&typeof nArray[i+1] !="undefined" &&nArray[i+1][1]=="chap")?
[nArray[1],false,nArray[3],tmp1,null,{format:{isFolder:true}}]:[nArray[1],true,nArray[3],tmp1,null]
}
var outArray=new Array();
var writePlace=-1;
for(i=0,l=oArray.length;i<l;i++){
if(oArray[0]=="chap"){writePlace++;outArray[writePlace]=new Array();}
if(writePlace<0)continue;
outArray[writePlace][outArray[writePlace].length]=(oArray[1])?[oArray[2],oArray[3],oArray[4]]:[oArray[2],oArray[3],oArray[4],oArray[5]];
}
return outArray
}
</script>
<script type="text/javascript">
Array.prototype.showTheArray=function(){
var j1=new Array();
var j2=new Array();
for(var i=0,j;i<this.length;i++){
j1=new Array()
for(j=0;j<this.length;j++){
j1.push("[\""+this[j].join("\", \"")+"\"]")
}
j2.push("["+j1.join(", ")+"]")
}
document.write("var TREE_NODES=[<br>"+j2.join(", <br>")+"<br>];")
}
</script>




<script type="text/javascript">
var pcor_sections = [ 0

,'<p class="chap"><a href="chf-ES.htm#P6_36" target="_top">Executive Summary</a></p>'

,'<p class="ahead"><a href="chf-ES-cmc-00.htm#P52_1438" target="_top">What are the key parameters of the CHF market?</a></p>'

,'<p class="chap"><a href="Pharmacor-Chapter-Head.htm#P89_11313" target="_top">Introduction</a></p>'

,'<p class="chap"><a href="CHF-EP-cmc.htm#P210_16143" target="_top">Etiology and Pathophysiology </a></p>'

,'<p class="ahead"><a href="CHF-EP-cmc-02.htm#P242_29404" target="_top">Etiology</a></p>'

,'<p class="bhead"><a href="CHF-EP-cmc-02.htm#P13_3767" target="_top">Causes of Chronic Heart Failure</a></p>'

,'<p class="bhead"><a href="CHF-EP-cmc-02.htm#P18_5924" target="_top">Clinical Characterization of Chronic Heart Failure</a></p>'

,'<p class="ahead"><a href="epi-mock-up-cmc-03.htm#P62_16890" target="_top">United States</a></p>'

,'<p class="chap"><a href="chf-ct.htm" target="_top">Current Therapies</a></p>'

,'<p class="ahead"><a href="chf-ct-cmc-00.htm" target="_top">Diuretics</a></p>'

];
</script>
<script type="text/javascript">
var TREE_NODES=pcor_sections.parseHTML() //the assignment is done at the this point
TREE_NODES.showTheArray() //now display the Array we have
</script>
<title>Untitled Document</title>
</head>

<body>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top