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 whichlocmap='wxmap';
var mapday=1
var datepart='high';
var whichscope='southeast';
var whichforecast='temps';
var myplace;
var myshortregion;
var myregion;
var daynum;
Stamp = new Date();
Hours = Stamp.getHours();
myUTCHour = Stamp.getUTCHours();
if (Hours > 15)  {
	datepart='low'
	}
if (Hours < 6)  {
	datepart='low'
	}
if (myUTCHour <14 && 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 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=='temps') {
		  daynum=1;
		  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';
	}
	
function showstate(mystate) {
	var mysrc = 'http://contours.hamweather.net/wxD2mWCPHeT5EG/contours/png/320x240/currents/us'+mystate+'_temperature_i1_points.png';
	document['map'].src = mysrc;
	whichlocmap='statetemp';
	mywarninglayer  = document.getElementById( "warnings" )
	mynormallayer  = document.getElementById( "othermaps" )
	mywxlayer  = document.getElementById( "wxmap" );
	myformlayer  = document.getElementById( "labelform" );
	myformlayer.style.display="block";
	mymsglayer  = document.getElementById( "formmsg" );
	mymsglayer.style.display="block";
	mywarninglayer.style.display="none";
	mynormallayer.style.display="block";
	mywxlayer.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 = '#416161';
	menu3.style.backgroundColor = '#578282';
	menu4.style.backgroundColor = '#416161';
	}								

function showsat(mystate) {
	document['map'].src = 'http://www.lawrencevilleweather.com/satfetch.php?size=320x240&img='+mystate+'_clir&r=1';
whichlocmap='statesat';
	mywarninglayer  = document.getElementById( "warnings" )
	mynormallayer  = document.getElementById( "othermaps" )
	mywxlayer  = document.getElementById( "wxmap" );
	myformlayer  = document.getElementById( "labelform" );
	myformlayer.style.display="none";
	mymsglayer  = document.getElementById( "formmsg" );
	mymsglayer.style.display="none";
	mywarninglayer.style.display="none";
	mynormallayer.style.display="block";
	mywxlayer.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';
	}								

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";
	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';
	whichlocmap='fronts';
	}		
	
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';
	whichlocmap='wxmap';
	}		
	
function changelocal() {
	if (whichlocmap == 'fronts') {
		document.location = 'http://www.lawrencevilleweather.com/fronts/current';
		}
	else if (whichlocmap == 'wxmap') {
		document.location = 'http://www.lawrencevilleweather.com/weathermaps/'+myshortregion;
		}
	else if (whichlocmap == 'statesat') {
		document.location = 'http://www.lawrencevilleweather.com/satellite/'+mylcstate;		}
	else {
	document.location = '/wx.php?forecast=pass&pass=condmaps&place='+myplace+'&hwvmap=statetemp';
	}
}		
	
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_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();
	}

