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';
	}
	}
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';
var myplace;

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 ='/radarfetch.php?size=320x240&img=1nextype';
	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=1&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['map'].src ='http://www.lawrencevilleweather.com/satfetch.php?size=320x240&img=ga_clir&r=1';
	whichsat='local';
	MM_setTextOfLayer('radarmsg','','&nbsp;<a href=\"\" onclick=\"swapsat();return(false);\">View US Satellite</a>')
	localsat = true;
	}
else {
	document['map'].src ='http://www.lawrencevilleweather.com/satfetch.php?size=320x240&img=conus_clir';
	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 changelocal() {
	if (whichlocmap == 'fronts') {
		document.location = 'http://www.lawrencevilleweather.com/fronts/current';
		}
	else if (whichlocmap == 'radar') {
	document.location = 'http://www.lawrencevilleweather.com/radar/ga';
	}
	else if (whichlocmap == 'wxmap') {
		document.location = 'http://www.lawrencevilleweather.com/weathermaps/southeast';
		}
	else if (whichlocmap == 'statesat') {
		document.location = 'http://www.lawrencevilleweather.com/satellite/ga';		
	}
	else {
	document.location = '/wx.php?forecast=pass&pass=condmaps&place='+myplace+'&hwvmap=statetemp';
	}
}		
	
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=='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" )
	menu5  = document.getElementById( "5" )
	menu1.style.backgroundColor = '#578282';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#416161';
	menu5.style.backgroundColor = '#416161';
	MM_setTextOfLayer('radarmsg','','&nbsp;');
	}
	
function showradar() {
	document['map'].src ='http://rads.hamweather.net/wxD2mWCPHeT5EG/320x240/ptype/topo/usga.png?o=cities2&u=c,i';
	mywarninglayer  = document.getElementById( "warnings" )
	mynormallayer  = document.getElementById( "othermaps" )
	mywxlayer  = document.getElementById( "wxmap" );
	mywarninglayer.style.display="none";
	mynormallayer.style.display="block";
	mywxlayer.style.display="none";
	myformlayer  = document.getElementById( "labelform" );
	myformlayer.style.display="none";
	menu1  = document.getElementById( "1" )
	menu2  = document.getElementById( "2" )
	menu3  = document.getElementById( "3" )
	menu4  = document.getElementById( "4" )
	menu5  = document.getElementById( "5" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#578282';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#416161';
	menu5.style.backgroundColor = '#416161';
	whichradar='radar';
	whichlocmap='radar';
	MM_setTextOfLayer('radarmsg','','&nbsp;');
	}	
	
function showstate(mystate) {
	document['map'].src =arg = 'http://www.lawrencevilleweather.com/imagefetch.php?size=320x240&type=currents&img=us'+mystate+'_temperature_i1_points.png';
	mywarninglayer  = document.getElementById( "warnings" )
	mynormallayer  = document.getElementById( "othermaps" )
	mywxlayer  = document.getElementById( "wxmap" );
	mywxlayer.style.display="none";
	mywarninglayer.style.display="none";
	mynormallayer.style.display="block";
	myformlayer  = document.getElementById( "labelform" );
	myformlayer.style.display="block";
	menu1  = document.getElementById( "1" )
	menu2  = document.getElementById( "2" )
	menu3  = document.getElementById( "3" )
	menu4  = document.getElementById( "4" )
	menu5  = document.getElementById( "5" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#578282';
	menu5.style.backgroundColor = '#416161';
	whichlocmap='temps';
	MM_setTextOfLayer('radarmsg','','Click map for that location\'s forecast');
	}			
	
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" )
	menu5  = document.getElementById( "5" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#416161';
	menu5.style.backgroundColor = '#578282';
	whichlocmap='wxmap';
	MM_setTextOfLayer('radarmsg','','&nbsp;');
	}		
	
function showfronts() {
	document['map'].src ='http://www.lawrencevilleweather.com/cgi-bin/weather/hw3.cgi?config=&forecast=asussmall';
	mywarninglayer  = document.getElementById( "warnings" )
	mynormallayer  = document.getElementById( "othermaps" )
	mywxlayer  = document.getElementById( "wxmap" );
	mywarninglayer.style.display="none";
	mynormallayer.style.display="block";
	mywxlayer.style.display="none";
	myformlayer  = document.getElementById( "labelform" );
	myformlayer.style.display="none";
	menu1  = document.getElementById( "1" )
	menu2  = document.getElementById( "2" )
	menu3  = document.getElementById( "3" )
	menu4  = document.getElementById( "4" )
	menu5  = document.getElementById( "5" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#416161';
	menu4.style.backgroundColor = '#578282';
	menu5.style.backgroundColor = '#416161';
	whichlocmap='fronts';
	MM_setTextOfLayer('radarmsg','','&nbsp;');
	}		
	
function showsat(mystate) {
	document['map'].src =arg = 'http://www.lawrencevilleweather.com/satfetch.php?size=320x240&img=ga_clir&r=1';
whichlocmap='statesat';
	mywarninglayer  = document.getElementById( "warnings" )
	mynormallayer  = document.getElementById( "othermaps" )
	mywxlayer  = document.getElementById( "wxmap" );
	mywarninglayer.style.display="none";
	mynormallayer.style.display="block";
	mywxlayer.style.display="none";
	myformlayer  = document.getElementById( "labelform" );
	myformlayer.style.display="none";
	menu1  = document.getElementById( "1" )
	menu2  = document.getElementById( "2" )
	menu3  = document.getElementById( "3" )
	menu4  = document.getElementById( "4" )
	menu5  = document.getElementById( "5" )
	menu1.style.backgroundColor = '#416161';
	menu2.style.backgroundColor = '#416161';
	menu3.style.backgroundColor = '#578282';
	menu4.style.backgroundColor = '#416161';
	menu5.style.backgroundColor = '#416161';
MM_setTextOfLayer('radarmsg','','&nbsp;<a href=\"\" onclick=\"swapsat();return(false);\">View US Satellite</a>');
	}								

function showfc() {
	var mysrc = 'http://www.lawrencevilleweather.com/imagefetch.php?size=320x240&type=forecasts&img=us_forecast'+datepart+'s_day'+mapday+'_i1_points.png'; 
//	alert(mysrc);
	document['mapfc'].src =mysrc;
	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_msg1_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 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();
	}

