// Timeline code
var active = 0;  //selected time event
var timeline = 0; //timeline open?


var timeData = new Array(17); //Text for Info window pop up
timeData[1] = '<h2>May 1998</h2><p>Glacier submits an application to King County for permits to repair the barge-loading dock at Maury Island.</p>';
timeData[2] = '<h2>June 2000</h2><p>After nearly two years of review King County issues its <a href="LinkDocs/FEIS%20Volume%201.pdf" target="new">Final Environmental Impact Statement</a> (26MB Download).  The Final EIS concludes that, with identified mitigation measures, the project will not have significant adverse impacts.  The Final EIS includes four volumes devoted to responding to public comments.</p>';
timeData[3] = '<h2>May 13, 2002</h2><p>Based on the conclusions in Washington Department of Ecology\'s Nearshore Impact Assessment, and the County\'s Final EIS-and approximately 18 months of its own additional environmental review-<b>Washington Department of Fish and Wildlife issues a Hydraulic Project Approval</b> for the piling repair project. A five-year permit extension was granted on May 2, 2007.</p>';
timeData[4] = '<h2>February 10, 2004</h2><p>The National Marine Fisheries Service (NMFS) completes their review of the project pursuant to the Endangered Species Act (ESA), and issues a letter concurring with the determination that the project is "<a href="LinkDocs/ESA%20Concurrence%20Letters/04-02-10%20NOAA%20ESA%20Concurrence.pdf" target="new">not likely to adversely affect threatened Puget Sound Chinook</a>" salmon.  The letter also summarizes the Service\'s review completed as required under the Magnuson-Stevens Fishery Conservation and Management Act, concluding that the conservation measures included as part of the project to address ESA concerns are also adequate to avoid, minimize, or otherwise offset potential adverse impacts to Essential Fish Habitat for 46 species of groundfish, four species of coastal pelagics, and three species of Pacific salmon. In June of 2005 following its listing, NMFS determines that the project is not likely to adversely affect Chinook salmon critical habitat.</p>';
timeData[5] = '<h2>March 16, 2004</h2><p>King County issues a <a href="LinkDocs/03-11-29%20Final%20Bound%20SEPA%20Addendum.pdf" target="new">revised EIS Addendum</a>, once again concluding that the new dock will have no significant unavoidable adverse impacts on the environment.  At the same time, the DDES director issues a <a href="LinkDocs/04-03-16%20King%20Co.%20Decision.pdf" target="new">decision denying</a> the shoreline substantial development and conditional use permits based on her determination that the proposed use is not "water dependent." This decision is later overturned on appeal to the State Shoreline Hearings Board.</p>';
timeData[6] = '<h2>April 2004</h2><p>The U.S. Fish and Wildlife Service (USFWS) issues a letter concurring with the determination that the project is <a href="LinkDocs/ESA%20Concurrence%20Letters/04-04-08%20USFWS%20Concurrence.pdf" target="new">not likely to adversely affect bull trout, bald eagles or marbled murrelets</a>. In December of 2005 following its listing, the USFWS determines that the project is not likely to adversely affect bull trout critical habitat.</p>';
timeData[7] = '<h2>March 15, 2005</h2><p>In accordance with the decision of the Washington State Shorelines Hearings Board, King County issues a Shoreline Substantial Development Permit and Shoreline Conditional Use Permit for the replacement barge-loading dock.</p>';
timeData[8] = '<h2>February 9, 2006</h2><p>King County issues a building permit for the replacement barge-loading dock.  The expiration date of the permit is one year from the date of issue. <a href="LinkDocs/06-02-09%20Building%20Permit%20Conditons%20Consol.pdf" target="new">Click here to see the building permit conditions</a>.</p>';
timeData[9] = '<h2>March 14, 2006</h2><p>Washington Department of Ecology issues <a href="LinkDocs/06-03-14%20Maury%20Island%20401CZM.pdf" target="new">Water Quality Certification and Coastal Zone Consistency Determination</a> for barge-loading project and related project activities.</p>';
timeData[10] = '<h2>June 19, 2006</h2><p>The <a href="LinkDocs/06-06-19%20Decision%20of%20WA%20Court%20of%20Appeals.pdf" target="new">Washington State Court of Appeals affirms the State Shorelines Hearings Board\'s Determination</a> that the project will not have significant impacts and that Glacier is entitled to shoreline permits.</p>';
timeData[11] = '<h2>November 6, 2006</h2><p>The National Marine Fisheries Service issues a letter concurring with determinations that the project <a href="LinkDocs/ESA%20Concurrence%20Letters/06-11-06%20NMFS%20Concurr%20Letter%20on%20SRKWs.pdf" target="new">is not likely to adversely affect Southern Resident killer whales and is not likely to adversely modify or destroy proposed Southern Resident killer whale critical habitat</a>. On January 19, following its listing, NMFS issued a letter concurring with the determination that the project is "not likely to adversely affect" orca critical habitat.</p>';
timeData[12] = '<h2>February 9, 2007</h2><p>King County issues one-year <a href="LinkDocs/07-02-09%20Extension%20of%20Building%20Permit%20to%202-09-08.pdf" target="new">extension of building permit</a>.</p>';
timeData[13] = '<h2>May 2, 2007</h2><p>Washington Department of Fish and Wildlife issues five-year extension of <a href="LinkDocs/09-01-09%2Revised%2HPA%2108837-2.pdf" target="new">Hydraulic Project Approval</a>.</p>';
timeData[14] = '<h2>January 8, 2008</h2><p>A five-justice panel of the Washington State Supreme Court unanimously <a href="LinkDocs/08-01-08 Supreme Court Ruling to Deny Review.pdf" target="new">denied without comment</a> an appeal of two earlier court rulings on Glacier Northwest\'s proposal to barge sand and gravel from its mine on Maury Island.  This decision followed unanimous rulings by the Washington State Court of Appeals and the Shoreline Hearings Board that the Maury Island project was entitled to shoreline permits and could proceed.</p>';
timeData[15] = '<h2>January 2008</h2><p>Legislators file bills to support opponents\' claims that the sand and gravel on 77 acres of the 235-acre site owned by Glacier Northwest may still belong to the state.  This legislation is approved in the state senate despite <a href="LinkDocs/Historical Documents.ppt" target="new">historical legal documents</a> recorded in 1907 and 1923, when the state sold the two parcels, which indicate specifically that the "lands, timber, stone, gravel and other materials described in the foregoing schedule&#0133;" were included in the sale.  The legislation would block any construction on the property or leasing of the state-owned tidelands where a new dock is proposed until the State Court of Appeals issues a ruling on who owns the sand and gravel.</p>';
timeData[16] = '<h2>July 15, 2008</h2><p>An administrative law judge has <a href="LinkDocs/08-07-15 ALJ Decision.pdf" target="new">affirmed the permit</a> issued by the Washington Department of Fish and Wildlife for construction of a new dock at Glacier Northwest\'s Maury Island site. The judge ruled that conditions already imposed as part of the Hydraulic Project Approval (HPA) permit are sufficient under the law to protect migrating juvenile salmon, herring and their spawning beds, surf smelt, young ling cod and eel grass. Besides denying a request to rescind the permit, the judge also ruled that additional restrictions sought by project opponents were not justified and declined to impose them. The HPA was first issued by WDFW in 2002 and was revised in 2004 and 2006 to conform to additional requirements.  The HPA was last renewed in May 2007. This is the fourth legal ruling that has determined that Glacier Northwest\'s proposal can proceed without harming the environment.</p>';
timeData[17] = '<h2>July 2, 2008</h2><p>The U.S. Army Corps of Engineers has <a href="LinkDocs/08-07-02 Corps Permit for Dock.pdf" target="new">issued the last permits needed</a> to build a new a dock for transporting sand and gravel by barge from an existing mine on Maury Island. The final permits issued by the Corps of Engineers to allow dock construction include a Section 10 permit under the Rivers and Harbors Act and a Section 404 permit under the Clean Water Act. The U.S. Fish and Wildlife Service and National Marine Fisheries Service have indicated  the project is not likely to adversely affect threatened or endangered species or their designated critical habitat. The proposal to resume mining and replace the dock at Maury Island has been reviewed by local, state and federal regulatory agencies in more depth for a longer time than any similar project in the state. It has been approved at each step in this long, complex and stringent process.</p>';
timeData[18] = '<h2>December 2, 2008</h2><p>Washington\'s Department of Natural Resources grants a 30-year <a href="LinkDocs/09-01-21 THE AQUATIC LANDS LEASE.pdf" target="_blank">aquatic lands lease</a> to allow construction and operation of the part of the barge-loading dock on state-owned aquatic lands (i.e., the portion waterward of extreme low tide).  The DNR lease adds more requirements to the dozens already in permit conditions and other regulations to protect and enhance the aquatic environment, including:  added monitoring requirements; added scientific studies; more dock lighting restrictions; restrictions during demolition on any shading of even individual eelgrass shoots; specific requirements for eelgrass replacement if there are unexpected impacts; and requirements that Glacier put the bluffs and beach it owns into permanent conservation easements to protect the shoreline in perpetuity.</p>';
timeData[19] = '<h2>December 5, 2008</h2><p>King County issues a "Notice to Proceed" and Glacier commences construction of replacement barge-loading dock.</p>';
timeData[20] = '<h2>December 11 and 19, 2008</h2><p>King County Superior Court <a href="LinkDocs/08-12-15 Preliminary  injunction release.pdf" target="_blank">denies Preserve Our Islands\' request</a> for a preliminary injunction on construction activities.<br/><br/>U.S. District Court denies Preserve Our Islands\' request for a temporary restraining order on construction activities.  After the Court issues a written opinion on January 5, 2009, POI withdraws its request for a preliminary injunction.</p>';
timeData[21] = '<h2>Januaray 8 and 9, 2008</h2><p>The Corps of Engineers modifies <a href="LinkDocs/09-01-08 Let from Corp Modifying Permit for Sand Lance.pdf" target="_blank">permit conditions</a> to restrict piling installation to use of a vibratory hammer.  Weekly monitoring and reporting is required to see if sand lance are spawning on the beach near the dock site.  This change came after Glacier reported finding one sand lance egg and an empty egg case.  Its permits did not require it, but Glacier reported this finding to the Corps of Engineers and Washington Department of Fish and Wildlife (WDFW).  Later sampling found a 16 more sand lance eggs.  Glacier\'s observations were the first documenting use of this beach for sand lance spawning. WDFW also added weekly monitoring and reporting of sand lance eggs to Glacier\'s Hydraulic Project Approval permit. If eggs are present, restrictions ban equipment operation on the beach, impact hammer pile driving and any piling installation landward of -2 tide elevation.</p>';


function findPosX(obj) { 
    var curleft = 0;
    if(obj.offsetParent)
    while(1)
    {
    curleft += obj.offsetLeft;
    if(!obj.offsetParent)
    break;
    obj = obj.offsetParent;
    }
    else if(obj.x)
    curleft += obj.x;
    return curleft;
}

function findPosY(obj) {
    var curtop = 0;
    if(obj.offsetParent)
    while(1)
    {
    curtop += obj.offsetTop;
    if(!obj.offsetParent)
    break;
    obj = obj.offsetParent;
    }
    else if(obj.y)
    curtop += obj.y;
    return curtop;
}

function findWidth() {
    if (parseInt(navigator.appVersion)>3) {
     if (navigator.appName=="Netscape") {
      winW = window.innerWidth;
     }
     if (navigator.appName.indexOf("Microsoft")!=-1) {
      winW = document.body.offsetWidth;
     }
    }
    return winW;
}
//show/hide description for timeline event
function showTip(timeitem) {
    //tipBox = document.getElementById('tipbox');
    //x = findPosX(timeitem);
    //y = findPosY(timeitem);
    //tipBox.innerHTML = timeTips[timeitem.id];  
    //width = findWidth();
    //if(x > (((width - 770)/2) + 560)) {
    //    tipBox.style.left = x - (tipBox.clientWidth + 4) + 'px';
    //} else {
    //    tipBox.style.left = x + 27 + 'px';
    //}
    timeitem.style.border = '1px solid white';
    timeitem.style.backgroundColor = 'White';
    //tipBox.style.top = y + 2 + 'px';
    //tipBox.style.visibility = 'visible';   
}
function hideTip(timeitem) {
    if (active != timeitem) {
        timeitem.style.border = '1px solid gray';
        timeitem.style.backgroundColor = '';
    }
    //tipBox = document.getElementById('tipbox');
    //tipBox.style.visibility = 'hidden';
}
//open or close the timeline
function toggleTime(){
    Effect.toggle('timeline','blind'); 
    if(timeline) {
        new Effect.Fade('infoFader', { duration: 0.3 } );
        turnOff();
    }
    if(timeline==0) {
        timeline = 1;
    } else if(timeline==1) {
        timeline = 0;
    }
    return false;
}
//highlight/unhighlight a timeline event          
function turnOn(timeitem) {
    infoBox = document.getElementById('holder');
    infoBox.innerHTML = timeData[timeitem.id];
    new Effect.Appear('infoFader', { to: 0.85 }, { duration: .5 });
    if (active) {
        active.style.border = '1px solid gray';
        active.style.backgroundColor = '';
    }
    newColor = "white";
    timeitem.style.border = '1px solid white';
    timeitem.style.backgroundColor = newColor;
    active = timeitem;
}
function turnOff(){
    if(active) {
        active.style.border = '1px solid gray';
        active.style.backgroundColor = '';
    }
    active = 0;
}
//jump to next or previous timeline event
function nextTime() {
    if(active.id < (timeData.length-1)) {
        active.style.border = '1px solid gray';
        active.style.backgroundColor = '';
        newId = parseInt(active.id) + 1;
        newActive = document.getElementById(newId);
        infoBox.innerHTML = timeData[newId];
        newColor = "white";
        newActive.style.border = '1px solid ' + newColor;
        newActive.style.backgroundColor = newColor;
        active = newActive;
    }
}
function prevTime() {
    if(active.id > 1) {
        active.style.border = '1px solid gray';
        active.style.backgroundColor = '';
        newId = active.id - 1;
        newActive = document.getElementById(newId);
        infoBox.innerHTML = timeData[newId];
        newColor = "white";
        newActive.style.border = '1px solid ' + newColor;
        newActive.style.backgroundColor = newColor;
        active = newActive;
    }
}

