function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
};

function highlightSubNav(mapName) {
	if (typeof(mapName) != "undefined") {
	map1  = document.getElementById( mapName );
	map1.className = 'submenusel';
	}
	}

function ShowCCSmallMap(which, mystate) {
	myformlayer  = document.getElementById( "labelform2" );
	myformlayer.style.display="none";

if (which == "pressure") {
arg = 'http://www.lawrencevilleweather.com/imagefetch.php?size=320x240&type=currents&img=us_pressure_i2.png'
}

else if  (which == "statetemp") {
arg = 'http://www.lawrencevilleweather.com/imagefetch.php?size=320x240&type=currents&img=us'+mystate+'_temperature_i1_points.png';
	myformlayer.style.display="block";
}
else if  (which == "snowdepth") {
arg = 'http://www.lawrencevilleweather.com/imagefetch.php?size=320x240&type=snow&img=us_snowdepth_i1.png'
}
else if  (which == "yesthigh") {
arg = 'http://www.lawrencevilleweather.com/imagefetch.php?size=320x240&type=yesttemps&img=us_yesthighs_i1_points.png'
}
else if  (which == "yestlow") {
arg = 'http://www.lawrencevilleweather.com/imagefetch.php?size=320x240&type=yesttemps&img=us_yestlows_i1_points.png'
}
else if  (which == "uvi") {
arg = 'http://www.lawrencevilleweather.com/imagefetch.php?size=320x240&type=uvi&img=us_uvi_ip1_points.png'
}
else  {
arg = 'http://www.lawrencevilleweather.com/imagefetch.php?size=320x240&type=currents&img=us_'+which+'_i1_points.png'
};
if (which != "warnings") {
MM_swapImage('cmap','',arg,1);
}
}

var staticradar=true;
var whichsat='local';
var localsat=true;
var mapday=1
var whichradar='radar';
var whichcondmap='statetemp';
var datepart='high';
var whichscope='southeast';
var whichforecast='temps';
Stamp = new Date();
Hours = Stamp.getHours();
myUTCHour = Stamp.getUTCHours();
if (Hours > 15)  {
	datepart='low'
	}
if (Hours < 6)  {
	datepart='low'
	}
if (myUTCHour <7 && datepart == 'high')  {
	mapday=2;
	}
if (myUTCHour >22)  {
	mapday=1;
	}
	
function swapscope() {

if (whichscope == '') {
	whichscope = 'southeast';
	MM_setTextOfLayer('scope','','&nbsp;<a href=\"\" onclick=\"swapscope();return(false);\">View Map of Entire US</a>')
	}
else {
	whichscope = '';
	MM_setTextOfLayer('scope','','&nbsp;<a href=\"\" onclick=\"swapscope();return(false);\">View Map of Southeast</a>')
	}
	if (whichforecast=='pop') { showpop(); }
	if (whichforecast=='qpf') { showqpf(); }
	if (whichforecast=='sky') { showsky(); }
	if (whichforecast=='snow') { showsnow(); }
}

function swapradar() {

if (staticradar == false) {
	document['map'].src ='http://rads.hamweather.net/wxD2mWCPHeT5EG/320x240/ptype/topo/usga.png?o=c,wrn&u=i';
	staticradar = true;
	whichradar='radar';
	MM_setTextOfLayer('radarmsg','','&nbsp;<a href=\"\" onclick=\"swapradar();return(false);\">View Radar in Motion</a>')
	}
else {
	document['map'].src ='/radarfetch.php?size=320x240&img=1nextype&type=gif';
	staticradar = false;
	whichradar='radarm';
	MM_setTextOfLayer('radarmsg','','&nbsp;<a href=\"\" onclick=\"swapradar();return(false);\">View Current Radar</a>')
	}

}

function swapsat() {
if (localsat == false) {
	document['omap'].src ='http://www.ssd.noaa.gov/goes/east/wfo/ffc/rgb.jpg';
	whichradar='sats';
	MM_setTextOfLayer('radarmsg','','&nbsp;<a href=\"\" onclick=\"swapsat(); return(false);\">View US Satellite</a>')
	localsat = true;
	}
else {
	document['omap'].src ='http://www.ssd.noaa.gov/goes/east/eaus/avn.jpg';
	whichradar='national';
	MM_setTextOfLayer('radarmsg','','&nbsp;<a href=\"\" onclick=\"swapsat(); return(false);\">View Georgia Satellite</a>')
	localsat = false;
	}

}


function displayscope() {

if (whichscope == '') {
	MM_setTextOfLayer('scope','','&nbsp;<a href=\"\" onclick=\"swapscope();return(false);\">View Map of Southeast</a>')
	}
else {
	MM_setTextOfLayer('scope','','&nbsp;<a href=\"\" onclick=\"swapscope();return(false);\">View Map of Entire US</a>')
	}
}

function goforecast() {
	if (whichforecast=='sky') {
		document.location = 'http://www.lawrencevilleweather.com/wx.php?forecast=pass&pass=skymaps&s='+whichscope;
		}
	if (whichforecast=='qpf') {
		document.location = 'http://www.lawrencevilleweather.com/wx.php?forecast=pass&pass=qpfmaps&s='+whichscope;
		}
	if (whichforecast=='pop') {
		document.location = 'http://www.lawrencevilleweather.com/wx.php?forecast=pass&pass=popmaps&s='+whichscope;
		}
	if (whichforecast=='snow') {
		document.location = 'http://www.lawrencevilleweather.com/wx.php?forecast=pass&pass=snowmaps&hwvscope='+whichscope;
		}
	if (whichforecast=='sat') {
		document.location = 'http://www.lawrencevilleweather.com/satellite/satrad/us';
		}
	if (whichforecast=='temps') {
		document.location = 'http://www.lawrencevilleweather.com//wx.php?config=&forecast=pass&pass=forecastmaps&hwvdatepart='+datepart;
		}
}

function showwarnings() {
	mywarninglayer  = document.getElementById( "warnings" )
	mynormallayer  = document.getElementById( "othermaps" )
	mywxlayer  = document.getElementById( "wxmap" );
	mywarninglayer.style.display="block";
	mynormallayer.style.display="none";
	mywxlayer.style.display="none";
	menu1  = document.getElementById( "1" )
	menu2  = document.getElementById( "2" )
	menu3  = document.getElementById( "3" )
	menu4  = document.getElementById( "4" )
	menu1.style.backgroundColor = '#578282';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#416161';
	MM_setTextOfLayer('radarmsg','','&nbsp;');
	}
	
function showwx() {
	mywarninglayer  = document.getElementById( "warnings" )
	mynormallayer  = document.getElementById( "othermaps" )
	mywxlayer  = document.getElementById( "wxmap" );
	mywarninglayer.style.display="none";
	mynormallayer.style.display="none";
	mywxlayer.style.display="block";
	menu1  = document.getElementById( "1" )
	menu2  = document.getElementById( "2" )
	menu3  = document.getElementById( "3" )
	menu4  = document.getElementById( "4" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#578282';
	document['omap'].style.height=240;
	MM_setTextOfLayer('radarmsg','','&nbsp;');
	whichradar='wxmap';
	}
	
function shownormal() {
	mywarninglayer  = document.getElementById( "warnings" )
	mynormallayer  = document.getElementById( "othermaps" )
	mywxlayer  = document.getElementById( "wxmap" );
	mywarninglayer.style.display="none";
	mynormallayer.style.display="block";
	mywxlayer.style.display="none";
	}	
	
function showradar() {
	document['omap'].src ='http://rads.hamweather.net/wxD2mWCPHeT5EG/320x240/ptype/topo/usga.png?o=cities2&u=c,i';
	shownormal();
	myformlayer  = document.getElementById( "labelform" );
	myformlayer.style.display="none";
	menu1  = document.getElementById( "1" )
	menu2  = document.getElementById( "2" )
	menu3  = document.getElementById( "3" )
	menu4  = document.getElementById( "4" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#578282';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#416161';
	whichradar='radar';
	document['omap'].style.height="240px";
	MM_setTextOfLayer('radarmsg','','&nbsp;');
	}	
	
function showmovingradar() {
	document['omap'].src ='/radarfetch.php?size=320x240&img=1nextype&type=gif';
	shownormal();
	menu1  = document.getElementById( "1" )
	menu2  = document.getElementById( "2" )
	menu3  = document.getElementById( "3" )
	menu4  = document.getElementById( "4" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#578282';
	menu4.style.backgroundColor = '#416161';
	myformlayer  = document.getElementById( "labelform" );
	myformlayer.style.display="block";
	whichradar='radarm';
	}			
	
function showsat() {
	document['omap'].src ='http://www.ssd.noaa.gov/goes/east/wfo/ffc/avn.jpg';
	mymap = document.getElementById( "omap" )
	mymap.style.height = "213px";
	shownormal();
	menu1  = document.getElementById( "1" )
	menu2  = document.getElementById( "2" )
	menu3  = document.getElementById( "3" )
	menu4  = document.getElementById( "4" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#578282';
	menu4.style.backgroundColor = '#416161';
	myformlayer  = document.getElementById( "labelform" );
	myformlayer.style.display="none";
	whichradar='sats';
MM_setTextOfLayer('radarmsg','','&nbsp;<a href=\"\" onclick=\"swapsat();return(false);\">View US Satellite</a>');
	}			
	
	
function showfronts() {
	document['omap'].src ='http://www.lawrencevilleweather.com/cgi-bin/weather/hw3.cgi?config=&forecast=asussmall';
	shownormal();
	menu1  = document.getElementById( "1" )
	menu2  = document.getElementById( "2" )
	menu3  = document.getElementById( "3" )
	menu4  = document.getElementById( "4" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#578282';
	document['omap'].style.height="240px";
	whichradar='fronts';
	MM_setTextOfLayer('radarmsg','','&nbsp;');
	}		
	
function showts() {
	document['omap'].src ='http://www.lawrencevilleweather.com/cgi-bin/weather/hw3.cgi?config=tropimg,tropsys320x240&forecast=plotsystemforecast&region=NT&year='+year+'&eventnum='+eventnum+'&usemap=AUTO2&zoom=1';
	shownormal();
	menu1  = document.getElementById( "1" )
	menu2  = document.getElementById( "2" )
	menu3  = document.getElementById( "3" )
	menu4  = document.getElementById( "4" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#578282';
	document['omap'].style.height="240px";
	whichradar='ts';
	MM_setTextOfLayer('radarmsg','','<a href="http://www.lawrencevilleweather.com/storms/2011/atlantic/'+lstormname+'/storm-satellite.html">View Satellite Image of '+stormname+'</a></td>');
	}		
	
function changeradar() {
	if (whichradar == 'ts') {
		document.location = 'http://www.lawrencevilleweather.com/storms/2011/atlantic/'+lstormname+'.html';
		}
	else if (whichradar == 'fronts') {
		document.location = 'http://www.lawrencevilleweather.com/fronts/current';
		}
	else if (whichradar == 'wxmap') {
		document.location = 'http://www.lawrencevilleweather.com/weathermaps/southeast';
		}
	else if (whichradar == 'sats') {
		document.location = 'http://www.lawrencevilleweather.com/satellite/ffc';		}
	else if (whichradar == 'radar') {
		document.location = 'http://www.lawrencevilleweather.com/radar/ga';		}
	else if (whichradar == 'national') {
		document.location = 'http://www.lawrencevilleweather.com/satellite/us';		}
	else {
	document.location = 'wx.php?forecast=pass&pass=condmaps&hwvlawrenceville=1&hwvmap='+whichradar;
	}
}		
	
function showfc() {
	document['mapfc'].src ='/imagefetch.php?size=320x240&type=forecasts&img=us_forecast'+datepart+'s_day'+mapday+'_i1_points.png';
	MM_setTextOfLayer('scope','','&nbsp;')	
	menu1  = document.getElementById( "F1" )
	menu2  = document.getElementById( "F2" )
	menu3  = document.getElementById( "F3" )
	menu4  = document.getElementById( "F4" )
	menu5  = document.getElementById( "F5" )

	menu1.style.backgroundColor = '#578282';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#416161';
	menu5.style.backgroundColor = '#416161';
	whichforecast='temps';
	}


function showpop() {
	var mysrc = 'http://contours.hamweather.net/wxD2mWCPHeT5EG/contours/png/320x240/ndfd/us'+whichscope+'_pop12_msg2_i5.png';
	document['mapfc'].src = mysrc;
	menu1  = document.getElementById( "F1" )
	menu2  = document.getElementById( "F2" )
	menu3  = document.getElementById( "F3" )
	menu4  = document.getElementById( "F4" )
	menu5  = document.getElementById( "F5" )

	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor= '#578282';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#416161';
	menu5.style.backgroundColor = '#416161';
	whichforecast='pop';
	displayscope();
	}
function showqpf() {
	var mysrc = 'http://contours.hamweather.net/wxD2mWCPHeT5EG/contours/png/320x240/ndfd/us'+whichscope+'_qpf_msg0_ip1.png';
	document['mapfc'].src = mysrc;
	menu1  = document.getElementById( "F1" )
	menu2  = document.getElementById( "F2" )
	menu3  = document.getElementById( "F3" )
	menu4  = document.getElementById( "F4" )
	menu5  = document.getElementById( "F5" )

	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#578282';
	menu4.style.backgroundColor = '#416161';
	menu5.style.backgroundColor = '#416161';
	whichforecast='qpf';
	displayscope();
	}

function showsnow() {
	var mysrc = 'http://contours.hamweather.net/wxD2mWCPHeT5EG/contours/png/320x240/ndfd/us'+whichscope+'_snow_msg0_ip5.png';
	document['mapfc'].src = mysrc;
	menu1  = document.getElementById( "F1" )
	menu2  = document.getElementById( "F2" )
	menu3  = document.getElementById( "F3" )
	menu4  = document.getElementById( "F4" )
	menu5  = document.getElementById( "F5" )

	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#578282';
	menu5.style.backgroundColor = '#416161';
	whichforecast='snow';
	displayscope();
	}

function showsat2() {
	document['mapfc'].src ='http://www.lawrencevilleweather.com/satfetch.php?size=320x240&img=conus_satrad';
	menu1  = document.getElementById( "F1" )
	menu2  = document.getElementById( "F2" )
	menu3  = document.getElementById( "F3" )
	menu4  = document.getElementById( "F4" )
	menu5  = document.getElementById( "F5" )

	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#578282';
	menu5.style.backgroundColor = '#416161';
	whichforecast='sat';
	MM_setTextOfLayer('scope','','&nbsp;')	
	}

function showsky() {
	var mysrc = 'http://contours.hamweather.net/wxD2mWCPHeT5EG/contours/png/320x240/ndfd/us'+whichscope+'_sky_msg1_i1.png';
	document['mapfc'].src = mysrc;
	menu1  = document.getElementById( "F1" )
	menu2  = document.getElementById( "F2" )
	menu3  = document.getElementById( "F3" )
	menu4  = document.getElementById( "F4" )
	menu5  = document.getElementById( "F5" )

	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#416161';
	menu5.style.backgroundColor = '#578282';
	whichforecast='sky';
	displayscope();
	}

function showstate(mystate) {
	document['cmap'].src =arg = 'http://www.lawrencevilleweather.com/imagefetch.php?size=320x240&type=currents&img=us'+mystate+'_temperature_i1_points.png';
whichcondmap='statetemp';
	menu1  = document.getElementById( "C1" )
	menu2  = document.getElementById( "C2" )
	menu3  = document.getElementById( "C3" )
	myformlayer  = document.getElementById( "labelform2" );
	myformlayer.style.display="block";
	menu1.style.backgroundColor = '#578282';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	}								

function showus() {
	document['cmap'].src =arg = 'http://contours.hamweather.net/wxD2mWCPHeT5EG/contours/png/320x240/currents/us_temperature_i1_points.png';
whichcondmap='temperature';
	menu1  = document.getElementById( "C1" )
	menu2  = document.getElementById( "C2" )
	menu3  = document.getElementById( "C3" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#578282';
	menu3.style.backgroundColor = '#416161';
	myformlayer  = document.getElementById( "labelform2" );
	myformlayer.style.display="none";
	}									
function showmisc(which,state) {
	ShowCCSmallMap(which, state);
whichcondmap=which;
	menu1  = document.getElementById( "C1" )
	menu2  = document.getElementById( "C2" )
	menu3  = document.getElementById( "C3" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#578282';
	}									

	function jrtoggle(a) {
	m = document.getElementById(a);
	if (m.className == 'visible') m.className = 'hidden'; else m.className = 'visible';
}

