/*
 * Name: default.js
 * Purpose: Provides functions for use in default.htm
 * Author: Mike Konikoff
 * Dependencies: default.htm
 */

/*
 * Global variables
 */
 
// howtoText is the text that appears when the user clicks the "How?" link on defualt.htm
var howtoText = "<span class=subheader>How To Get Started:</span><br><br>";
howtoText += "<ul><li>Click on the \"Smoke Screening Tool\" link below. When a map of Florida appears, the application is finished loading.";
howtoText += "<li>Select a DOF district from the upper right hand drop down box. The DOF district map will be displayed.";
howtoText += "<li>Use the \"Zoom In\" tool on the left side of the map to zoom into an area on the map where you intend to burn.";
howtoText += "<li>Click on the \"Digitize a Burn Location\" icon located on the left hand side of the map. ";
howtoText += "The icon has an arrow pointing into an area surrounded by dashed lines. ";
howtoText += "<li>Click on the map to set the location of your burn, and then enter the approximate area of your burn. ";
howtoText += "<li>Enter the time of the burn for today or tomorrow and click on the \"Submit\" button. Your smoke plume will appear with a pop up ";
howtoText += "window that lets you know if there are any smoke impacts. ";
howtoText += "</ul>";
howtoText += "<blockquote><i>Please remember, a map with many layers will be downloading and it may take several seconds to a ";
howtoText += "minute for the complete map to appear on the screen.</i></blockquote>";


/*
 * showHowTo()
 * Shows/Hides how-to text.
 */
function showHowTo() {
  document.getElementById("showHowTo").style.color = "purple";

  if (document.getElementById("HowTo") == null) {
    document.getElementById("spanHowTo").innerHTML = "<div id=\"HowTo\"></div>";
    document.getElementById("HowTo").style.backgroundColor = "#F4E5BC";
    document.getElementById("HowTo").style.borderStyle = "solid";
    document.getElementById("HowTo").style.borderWidth = "2px";
    document.getElementById("HowTo").innerHTML = howtoText;
  }
  else {
    document.getElementById("spanHowTo").innerHTML = "";
  }
}

function openWin(control) {
  var strTarget;
  var strName = control.name;
  var strParams = "width=" + Math.min(0.95*screen.availWidth, 1000) + ",height=" + Math.min(0.90*screen.availHeight, 700) + ",";
  switch(strName) {
    case "HELP":
      strTarget = "help/Help.htm#top";
      strParams += "status=yes,resizable=yes,scrollbars=yes"
      break;
    case "FMIS":
      strTarget = "http://tlhforweb2.doacs.state.fl.us/FMIS/_default.htm";
      strParams += "location=no,toolbar=no,status=yes,menubar=no,resizable=yes"
      break;
  }
  //alert(new Array(strTarget, strName, strParams).join('\n'));
  self.open(strTarget,strName,strParams);
  control.style.color='#800080'
}
