<!-- 
//- Chuck Karo ~ CKandCo.com ~ ©2002, 2003, 2004. -//
var graphWin = null;
function chkStrmTrk(){
	var dt = new Date();
	var m = dt.getMonth();
	if (m < 7 || m == 11) {
		confirm(" Hurricane Season Storm Track normally valid only during August thru November. ");
	}
}
function chkDayBtn(){
	var objFRM = document.forms[0];
	var strURL = "";
	var i = 0;
	var dayVal = "";
	//-- setup chart for DAY selected --//
	with (objFRM) {
		for (i=0; i < Day.length; i++) {
			if (Day[i].checked == false) continue;
			if (Day[i].checked) {
				dayVal = Day[i].value;
				break;
			}
		}
	}
	switch (i) {
		case 0:		//-- 2-day XTide chart.	--//-- [_/options.html] --//-- "killwarn=;cleanout=;" disabled. --//
			strURL = "http://tbone.biol.sc.edu/tide/tideshow.cgi?tplotdir=horiz;type=graph;gx=960;gy=320;caltype=new;interval=00%3A01;glen=3;fontsize=%2B0;units=any;tzone=local;ampm24=24;weekday=1;colortext=black;colordatum=white;colormsl=red;colortics=red;colorday=yellow;colornight=seagreen;colorebb=blue;colorflood=skyblue;killwarn=HwUWFGNxA;cleanout=HwUWFGNxA;site=";
			break;
		case 1:		//-- Curr. Month Table.
			strURL = "http://tbone.biol.sc.edu/tide/tideshow.cgi?type=calen;caltype=new;killwarn=HwUWFGNxA;cleanout=HwUWFGNxA;site=";
			break;
		case 2:		//-- Tide + Current charts: 'Today'.
			strURL = "http://www.tides.com/cgi-bin/tcweb.exe?";
			break;
		case 3:		//-- Tide + Current charts: 'Tomorrow'.
			strURL = "http://www.tides.com/cgi-bin/tcweb.exe?";
			break;
	}
	//-- show if "tide only" --//
	if (i < 2) {
		switch (objFRM.Location.selectedIndex) {
			case 0:		//-- Demo Pt.
				strURL += "Democrat%20Point%2C%20Fire%20Island%20Inlet%2C%20Long%20Island%2C%20New%20York";
				break;
			case 1:		//-- Long Beach
				strURL += "Long+Beach+%28outer+coast%29%2C+Long+Island%2C+New+York";
				break;
			case 2:		//-- Shinn. Canal
				strURL += "Shinnecock+Inlet+%28ocean%29%2C+Long+Island%2C+New+York";
				break;
			case 3:		//-- West Meadow (Stny Brk)
				strURL += "Stony+Brook%2C+Smithtown+Bay%2C+Long+Island+Sound%2C+New+York";
				break;
			case 4:		//-- Hobart's Beach (Eaton's Neck) -- Lloyd Harbor entrance, Huntington Bay.
				strURL += "Lloyd+Harbor+entrance%2C+Huntington+Bay%2C+Long+Island+Sound%2C+New+York";
		}
		window.location = strURL;
		return true;
	} else {
		//-- get TIDE + CURRENT charts >> new window w/FRAMES --//
		if (graphWin != null) graphWin.close();

		//-- W. Meadow >> NO CURRENTS CHART (yet?)
		if (objFRM.Location.selectedIndex == 3) {
			alert("Sorry! -- Currents charts not [yet?] available for selected location.");
			return false;
		}

		graphWin = window.open('','newWin','resizable=1,width=800,height=600,screenY=0;');
		var loc = objFRM.Location[objFRM.Location.selectedIndex].text;
		with (graphWin) {
			moveTo(screen.availWidth-800,0);
			document.write("<HTML><title>Tide and Current Charts -- " + loc + " // </title><frameset rows='300,*'><frame><frame></frameset></HTML>");
		}
		
		strURL += "Day=" + dayVal + "&Region=" + escape("Mid Atlantic (NOAA)");
		//-- Tide > frame 1 --//
		strURL += "&TideCurrent=t";
		with (objFRM) {
			strURL += "&Location=";
			switch (Location.selectedIndex) {
				case 0:		//-- Demo Pt.
					strURL += escape("Democrat Point, Fire Island Inlet - 1451");
					break;
				case 1:		//-- Long Beach
					strURL += escape("Long Beach (outer coast) - 1499");
					break;
				case 2:		//-- Shinn. Canal
					strURL += escape("Shinnecock Inlet (ocean) - 1439");
			}
		}
		strURL += "&DoIt=1";
		graphWin.document.frames[0].document.location = strURL;

		//-- Currents > frame 2 --//
		strURL += "&TideCurrent=c";
		with (objFRM) {
			strURL += "&Location=";
			switch (Location.selectedIndex) {
				case 0:		//-- Demo Pt.
					strURL += escape("Fire I. Inlet, 0.5 mi. S of Oak Beach - 3531");
					break;
				case 1:		//-- Long Beach
					strURL += escape("Jones Inlet - 3536");
					break;
				case 2:		//-- Shinn. Canal
					strURL += escape("Shinnecock Inlet - 3526");
			}
		}
		strURL += "&DoIt=1";
		graphWin.document.frames[1].document.location = strURL;
	}
}
function writeEML(txt) {
	with (document) {
		var lnk = "&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#111;&#110;&#108;&#105;&#110;&#101;&#64;&#99;&#107;&#97;&#110;&#100;&#99;&#111;&#46;&#99;&#111;&#109;?Subject=Dude!";
		write(txt.link(lnk));
	}
}
function selSR() {
	if (document.all) {
		var sr = document.all.sr.options[document.all.sr.selectedIndex].value;
		self.location = 'http://www.' + sr;
	} else {
		alert("\nSorry! Feature not implemented for all browsers [yet?]...\n\nCentral LI = www.surfridercli.org\nLI - East = www.surfriderli.org\nNYC = www.surfrider.org/nyc\n");
	}
}
//-->