// JavaScript Document
//
// State jump dropdown menu
// This card is used to generate a drop-down menu and send people to any page within a state's subdirectory.
// The following lines of code MUST be added to the page to use this script.

//<form name="jumpmenu">
//		<script language="javascript" src="jumpmenu.js"></script>
//		<input type="hidden" name="target" value="best_practices.htm">
//      <input type="button" name="Submit" value="Submit" onClick="GoTo(); return false">
//</form>

// Hidden value "target" specifying the page name (contact.htm, success_stories.htm, or best_practices.htm) must be specified in the page.  


document.write('<select name="selectstate" size="1">');
document.write('        <option>Select a state below:</option>');
//document.write('        <option value="CT">Connecticut</option>');
document.write('        <option value="FL">Florida</option>');
document.write('        <option value="GA">Georgia</option>');
document.write('        <option value="IN">Indiana</option>');
document.write('        <option value="MD-DC">Maryland & DC</option>');
document.write('        <option value="MA">Massachusetts</option>');
document.write('        <option value="MS">Mississippi</option>');
document.write('		<option value="MO">Missouri</option>');
document.write('        <option value="MT">Montana</option>');
document.write('        <option value="NC">North Carolina</option>');
//document.write('        <option value="VT">Vermont</option>');
document.write('        <option value="WI">Wisconsin</option>');
document.write('</select>');


function GoTo() {
	var DirPath = document.jumpmenu.selectstate.options[document.jumpmenu.selectstate.selectedIndex].value;
	var PageTarget = document.jumpmenu.target.value;
	var FullTarget = 'http://statewildlife.nwf.org/' + DirPath + '/' + PageTarget;
	if (DirPath != "") {
		window.location = FullTarget;
	} else {
		alert("Please select a state!")
	}
}