/**
 * @author mpeccini
 */
/*
Versioning convention
Three digit number 0.0.0
-----------------------------
FIRST DIGIT
0 = Beta version
1 = First production release
First digit changes increase only after a major rewrite
----------------------------
SECOND DIGIT
changes after significant application changes such as:
- Added tool or functionality
- Significant change in interface
- Significantly changed backend code
----------------------------
THIRD DIGIT
Minor changes such as:
- Bug fix
- Changes in help content
- minor tweak
---------------------------
The version number will be followed by the approximate production release date
---------------------------
SVN repository will be notated with the appropriate version number upon release
---------------------------
*/
var updateText = new Array();
var version;
//version = "Beta 0.1.0 - expected release 6/1/09"
//this version removes all jsp functionality and replaces it with hardcoded recovery projects
version = "Beta 0.2.0 - non database version"
//version completed for initial internal review
version = "Beta 0.3.0 - Recovery Projects"
//first rollout version
version = "Version 1.0 - 6/30/09"
updateText[0] ='6/30/09 - initial rollout'
//added detailed location map functionality
version = "Version 1.1.0 - 7/21/09"
updateText[1] = '<b>7/21/09</b> <ul class="updateUL"><lh class="updateUL">Detailed Project Maps Added:</lh> <li>Rhode Island River Ecosystem Restoration<li>New Haven and East Lyme Marsh Restoration</ul>'

//added pictures and captions for detail project popups
version = "V 1.1.1 - Updated 8/17/09"
//added url variables and NOS survey projects
version = "V 2.0 - Updated 8/20/09"
updateText[2] = '<b>8/20/09</b> <ul class="updateUL"><lh class="updateUL">New Projects Added:</lh> <li>Added NOS hydrographic survey projects<li>All NOAA ARRA projects are visible via the current link with the suffix: <a target="_blank" href="http://sharpfind.nmfs.noaa.gov/website/recovery_maps/recovery_map.html?NOAA">?NOAA</a><li>Only survey projects are visible via the current link with the suffix: <a target="_blank" href="http://sharpfind.nmfs.noaa.gov/website/recovery_maps/recovery_map.html?NOS">?NOS</a><li>Coastal restoration projects only are visible via the current link with the suffix: <a target="_blank" href="http://sharpfind.nmfs.noaa.gov/website/recovery_maps/recovery_map.html?Restoration">?Restoration</a></ul>'
updateText[3] += '<ul class="updateUL"><lh class="updateUL">Project Status Updates Added:</lh> <li>Northeast Florida Wetland Restoration <li>Elwha River Floodplain Restoration</ul>'
//added new photos to NW florida wetlands, Elwa, and Puget Sound. Reinstituted the status tab and added status to 
//Elwa, north carolina, and NW florida. Updated coordinates for Survey projects
version = "V 2.1 - Updated 8/27/09"
updateText[3] = '<b>8/27/09</b> <ul class="updateUL"><lh class="updateUL">New Photos Added:</lh> <li>Northeast Florida Wetland Restoration <li>Elwha River Floodplain Restoration<li>Removal of Derelict Fishing Gear in Puget Sound </ul>'
updateText[3] += '<ul class="updateUL"><lh class="updateUL">Project Status Updates Added:</lh> <li>Northeast Florida Wetland Restoration <li>Elwha River Floodplain Restoration</ul>'
updateText[3] += '<ul class="updateUL"><lh class="updateUL">New Press Links:</lh> <li>CNN report: <a target="_blank" href="http://www.cnn.com/video/?/video/us/2009/07/31/oppman.fishing.nets.stimulus.cnn">Removing Dangerous Nets</a></ul>'

version = "V 2.2 - Updated 9/11/09"
updateText[4] = '<b>9/11/09</b> <ul class="updateUL"><lh class="updateUL">New Photos Added:</lh> <li>North Carolina Estuary Habitat Restoration<li>Muskegon Lake Restoration<li>Lost River Preserve Restoration</ul>'
updateText[4] += '<ul class="updateUL"><lh class="updateUL">Project Status Updates Added:</lh> <li>Maine Atlantic Salmon Habitat Restoration  <li>North Carolina Estuary Habitat Restoration <li>Indian River Lagoon Restoration <li>Lost River Preserve Restoration </ul>'
updateText[4] += '<ul class="updateUL"><lh class="updateUL">New Press Links:</lh> <li>WPTV Report: <a target="_blank" href="http://www.wptv.com/content/news/topstories/story/4-million-in-fed-stimulus-help-St-Lucie-oysters/HKM1GeA-KEGVKUZZkn2PvQ.cspx?articleID=14435&articleID=14435">Federal stimulus funds pay for oyster shells </a></ul>'

version = "V 2.3 - Updated 9/22/09"
updateText[5] = '<b>9/22/09</b> <ul class="updateUL"><lh class="updateUL">New Photos Added:</lh> <li>Alaska Marine Debris Removal and Restoration</ul>'
updateText[5] += '<ul class="updateUL"><lh class="updateUL">New Videos Added:</lh><li>Lost River Preserve Restoration (FL)</ul>'
updateText[5] += '<ul class="updateUL"><lh class="updateUL">Live Webcam Added:</lh><li>Winnicut River Fish Passage Restoration (NH)</ul>'

version = "V 2.3.1 - Updated 9/28/09"
updateText[6] = '<b>9/28/09</b> <ul class="updateUL"><lh class="updateUL">New Photos Added:</lh> <li>Alaska Marine Debris Removal and Restoration (AK)<li>Hansen Creek Floodplain Restoration (WA)<li>Indian River Lagoon Restoration (FL)<li>Laolao Bay Coastal Restoration (NMI)<li>North Carolina Estuary Habitat Restoration (NC)</ul>'
updateText[6] += '<ul class="updateUL"><lh class="updateUL">New Videos Added:</lh><li>New Haven and East Lyme Marsh Restoration (CT)</ul>'

version = "V 2.3.2 - Updated 10/19/09"
updateText[7] = '<b>10/19/09</b> <ul class="updateUL"><lh class="updateUL">New Photos Added:</lh> <li>Fisher Slough Marsh Restoration (WA)<li>Muskegon Lake Restoration (MI)<li>Winnicut River Fish Passage Restoration (NH)<li>Elwha River Floodplain Restoration (WA)<li>American Canyon Salt Pond Restoration (CA)</ul>'
updateText[7] += '<ul class="updateUL"><lh class="updateUL">New Videos Added:</lh><li>Northeast Florida Wetland Restoration (FL) - 3 videos added</ul>'
updateText[7] += '<ul class="updateUL"><lh class="updateUL">Detailed Location Maps Added:</lh><li>Northeast Florida Wetland Restoration (FL)</ul>'
updateText[7] += '<ul class="updateUL"><lh class="updateUL">New Press Links:</lh><li>NBC report: <a target="_blank" href="http://www.msnbc.msn.com/id/3032619/#33079803">Stimulus fixing a problem as old as the seas</a></ul>'

version = "V 2.3.3 - Updated 11/9/09"
updateText[8] = '<b>11/9/09</b> <ul class="updateUL"><lh class="updateUL">New Photos Added:</lh> <li>Dunes Creek Watershed Restoration (IN)<li>Lost River Preserve Restoration (FL)<li>Magnolia Marsh Restoration (CA) </ul>'
updateText[8] += '<ul class="updateUL"><lh class="updateUL">New Videos Added:</lh><li>Elwha River Floodplain Restoration  (WA) - 1 video added<li>New Haven and East Lyme Marsh Restoration - 1 video added</ul>'
updateText[8] += '<ul class="updateUL"><lh class="updateUL">Status Updates:</lh><li>American Canyon Salt Pond Restoration (CA)<li>Northeast Florida Wetland Restoration (FL)<li>Elwha River Floodplain Restoration (WA)<li>Fisher Slough Marsh Restoration (WA)</ul>'



var buildUpdateText = ''
updateIndex = updateText.length

buildUpdateText += '<span class="newUpdates">*Latest Update*</span><br>'
buildUpdateText += '<img src="images/blueBullet.gif">&nbsp;&nbsp;'+updateText[updateIndex-1]+'<br><br>'
updateIndex--
buildUpdateText += '<span class="previousUpdates">Previous Updates</span><br>'
while(updateIndex>0){
	buildUpdateText += '<img src="images/blueBullet.gif">&nbsp;&nbsp;'+updateText[updateIndex-1]+'<br><br>'
	updateIndex--
}



//-------------------------------
//adds the what's new button the the version variable
version += " - <a id='whatsNew' class='whatsNew' href='javascript:showWhatsNew()'><img src='images/new_icon.png'>what's new?</a>"

var whatsNewWin;
var whatsNewButton = Ext.get('whatsNew');

function showWhatsNew(){
//alert("whats new")
		 if(!whatsNewWin){
		    whatsNewWin = new Ext.Window({
               applyTo     : 'whats-new',
                //layout      : 'fit',
				draggable:false,
				resizable:false,
				title: 'Recent Updates',
            	width:mapFrameWidth*0.6,
            	height:mapFrameHeight*0.8,
				autoScroll:true,
				html: '<div class="updateList">'+buildUpdateText+'</div>',
                //closeAction :'hide',
                plain       : true,
				close: closeWindow,
                buttons: [{
                    text     : 'Close',
                    handler  : closeWindow
						
                }]
            });
		}

		 whatsNewWin.show(whatsNewButton);
		 
		if(!spotLight){
		spotLight = new Ext.Spotlight({
		    easing: 'easeOut',
		    duration: .5
		});
	
		//var t=setTimeout("spotLight.show('whats-new')",200);
		spotLight.show('whats-new')
		}

}

function closeWindow(){
		spotLight.hide()
		spotLight='';
		whatsNewWin.hide();
		whatsNewWin.width = "75px"


}

