<!--

function changeRadarMap(image, newSource, divs)
{  
    var myImage = document.getElementById(image);
    myImage.src = newSource;  
    //set the divs back
    document.getElementById('divRadar1').className = "headerZ";
    document.getElementById('divRadar2').className = "headerZ";
    
    var myDiv = document.getElementById(divs);
    myDiv.className = "headerZselected";
    
    return false;
}
function changeNatRadarMap(image, newSource, divs)
{  
    var myImage = document.getElementById(image);
    myImage.src = newSource;  
    //set the divs back
    document.getElementById('divhlNat1').className = "headerZ";
    document.getElementById('divhlNat2').className = "headerZ";
    document.getElementById('divhlNat3').className = "headerZ";
    
    var myDiv = document.getElementById(divs);
    myDiv.className = "headerZselected";
    
    return false;
}
function DisplayMap( newSource)
{  
   
    // open the window 
    win3 = window.open("", "Window3", "location=no,width=700,height=580,scrollbars=no,menubar=no"); 
    // write to window
	win3.document.writeln("<img src=" + newSource + ">"); 
   
    return false;
}
function DisplayWeather(domain, newSource)
{  
   
    win1 = window.open(domain + newSource, "Window1", "location=no,width=750,height=580,scrollbars=no,menubar=no"); 
}

function changeMap2(image, newSource, divs)
{  
    var myImage = document.getElementById(image);
    myImage.src = newSource;  
    //set the divs back
    document.getElementById('divhlCM').className = "headerZ";
    document.getElementById('divhlDM').className = "headerZ";
    document.getElementById('divhlDMZ').className = "headerZ";
    document.getElementById('divhlDOL').className = "headerZ";
    document.getElementById('divhlAPN').className = "headerZ";
    
    var myDiv = document.getElementById(divs);
    myDiv.className = "headerZselected";
    
    return false;
}
function changeMap3(image, newSource, divs)
{  
    var myImage = document.getElementById(image);
    myImage.src = newSource;  
    //set the divs back
    document.getElementById('divhlUSwx1').className = "headerZ";
    document.getElementById('divhlUSwx2').className = "headerZ";
    document.getElementById('divhlUSwx3').className = "headerZ";
    document.getElementById('divhlUSwx4').className = "headerZ";
    document.getElementById('divhlUSwx5').className = "headerZ";
    document.getElementById('divhlUSwx6').className = "headerZ";
    
    var myDiv = document.getElementById(divs);
    myDiv.className = "headerZselected";
    
    return false;
}

function changeMap4(image, action)
{  
    var myImage = document.getElementById(image);
    if (myImage.src.indexOf('conus/Td') > 0 ) {
		//http://www.weather.gov/forecasts/graphical/images/conus/T16_conus.png
		var s1 = myImage.src.indexOf('conus/Td') + 8;
		var s2 = myImage.src.indexOf('_conus.png');
		var s3 = parseInt(myImage.src.substring(s1 ,s2));
		if (action == 'nxt') {
			if (s3 < 20) { s3 = s3 + 1 };
		} else {
			if (s3 > 1) { s3 = s3 - 1 };
		}
		myImage.src = myImage.src.substring(0,s1 ) + s3 + myImage.src.substring(s2 ); 
    }
    if (myImage.src.indexOf('conus/T') > 0 ) {
		//http://www.weather.gov/forecasts/graphical/images/conus/T16_conus.png
		var s1 = myImage.src.indexOf('conus/T') + 7;
		var s2 = myImage.src.indexOf('_conus.png');
		var s3 = parseInt(myImage.src.substring(s1 ,s2));
		if (action == 'nxt') {
			if (s3 < 20) { s3 = s3 + 1 };
		} else {
			if (s3 > 1) { s3 = s3 - 1 };
		}
		myImage.src = myImage.src.substring(0,s1 ) + s3 + myImage.src.substring(s2 ); 
    }
    if (myImage.src.indexOf('conus/PoP12') > 0 ) {
		//http://www.weather.gov/forecasts/graphical/images/conus/PoP121_conus.png
		var s1 = myImage.src.indexOf('conus/PoP12') + 11;
		var s2 = myImage.src.indexOf('_conus.png');
		var s3 = parseInt(myImage.src.substring(s1 ,s2));
		if (action == 'nxt') {
			if (s3 < 20) { s3 = s3 + 1 };
		} else {
			if (s3 > 1) { s3 = s3 - 1 };
		}
		myImage.src = myImage.src.substring(0,s1 ) + s3 + myImage.src.substring(s2 ); 
    }    
    if (myImage.src.indexOf('conus/RH') > 0 ) {
		//http://www.weather.gov/forecasts/graphical/images/conus/RH1_conus.png
		var s1 = myImage.src.indexOf('conus/RH') + 8;
		var s2 = myImage.src.indexOf('_conus.png');
		var s3 = parseInt(myImage.src.substring(s1 ,s2));
		if (action == 'nxt') {
			if (s3 < 20) { s3 = s3 + 1 };
		} else {
			if (s3 > 1) { s3 = s3 - 1 };
		}
		myImage.src = myImage.src.substring(0,s1 ) + s3 + myImage.src.substring(s2 ); 
    }    
    if (myImage.src.indexOf('conus/QPF') > 0 ) {
		//http://www.weather.gov/forecasts/graphical/images/conus/RH1_conus.png
		var s1 = myImage.src.indexOf('conus/QPF') + 9;
		var s2 = myImage.src.indexOf('_conus.png');
		var s3 = parseInt(myImage.src.substring(s1 ,s2));
		if (action == 'nxt') {
			if (s3 < 20) { s3 = s3 + 1 };
		} else {
			if (s3 > 1) { s3 = s3 - 1 };
		}
		myImage.src = myImage.src.substring(0,s1 ) + s3 + myImage.src.substring(s2 ); 
    }    
    if (myImage.src.indexOf('conus/WindSpd') > 0 ) {
		//http://www.weather.gov/forecasts/graphical/images/conus/RH1_conus.png
		var s1 = myImage.src.indexOf('conus/WindSpd') + 13;
		var s2 = myImage.src.indexOf('_conus.png');
		var s3 = parseInt(myImage.src.substring(s1 ,s2));
		if (action == 'nxt') {
			if (s3 < 20) { s3 = s3 + 1 };
		} else {
			if (s3 > 1) { s3 = s3 - 1 };
		}
		myImage.src = myImage.src.substring(0,s1 ) + s3 + myImage.src.substring(s2 ); 
    }    
    return false;

    return false;

}

function init()
{  
    var id = document.getElementById("loader");
    id.style.display = "none";
}

function showLoader()
{
    var id = document.getElementById("loader");
    id.style.display = "inline";
    return false;
}

function showRegions(div)
{
    var myDiv = document.getElementById(div);
    myDiv.style.display = "block";
    return false;
}

function hideRegions(div)
{
    var myDiv = document.getElementById(div);
    myDiv.style.display = "none";
    return false;
}

function clearIt(obj) {
    if (obj.defaultValue == obj.value) {
        obj.value = "";
    }
}

function changeForecast()
{
    var forecast = document.getElementById('content__ctl0_hlExtendedForecast');
    var forecastHeader = document.getElementById('forecastHeader');
    var visualDiv = document.getElementById('content__ctl0_forecast');
    var textualDiv = document.getElementById('content__ctl0_textForecast');    
    
    if (forecast.innerHTML == 'Extended') {
        textualDiv.style.display = "inline";
        visualDiv.style.display = "none";
        
        forecast.innerHTML = "3 Day";
        forecastHeader.innerHTML = "Extended Forecast";
    } else {
        textualDiv.style.display = "none";
        visualDiv.style.display = "inline";
        
        forecast.innerHTML = "Extended";
        forecastHeader.innerHTML = "3 Day Forecast";
    }    

    return false;
}

function loopImage(image)
{
    var myImage = document.getElementById(image);
    var loopRadar = document.getElementById('content__ctl0_hlLoopRadar');
    
    var stationID = '';
    
    if (loopRadar.innerHTML == 'Loop') {
        if (myImage.src == radar_NatlStat) {
            myImage.src = radar_NatlLoop;
        } 
        else if (myImage.src.substring(0, 40) == radar_LoclBase) {
            stationID = myImage.src.substring(40, 43);
            
            myImage.src = radar_LoclBase + stationID + '_loop.gif';
        } 
        else if (myImage.src.substring(0, 46) == radar_ReglStat) {
            stationID = myImage.src.substring(46, myImage.src.lastIndexOf('.'));
            
            myImage.src = radar_ReglLoop + stationID + '_loop.gif';
        }
        
        loopRadar.innerHTML = 'Static';
    } else {
        if (myImage.src == radar_NatlLoop) {
            myImage.src = radar_NatlStat;
        }
        else if (myImage.src.substring(0, 40) == radar_LoclBase) {
            stationID = myImage.src.substring(40, 43);
            
            myImage.src = radar_LoclBase + stationID + '_0.png';
        }
        else if (myImage.src.substring(0, 42) == radar_ReglLoop) {
            stationID = myImage.src.substring(42, myImage.src.lastIndexOf('_'));
            
            myImage.src = radar_ReglStat + stationID + '.gif';
        }
        
        loopRadar.innerHTML = 'Loop';
    }
    
    return false;
}

//-->