NWSRadar.prototype._radarid;
NWSRadar.prototype._left = "0";
NWSRadar.prototype._top = "0";
NWSRadar.prototype._width = "600";
NWSRadar.prototype._height = "550";

function NWSRadar(radarid, left, top, width, height)
{
	this._radarid = radarid;
	this._left = left;
	this._top = top;
	this._width = width;
	this._height = height;
}

NWSRadar.prototype.getRadarID = function()
{
	return this._radarid;
}

NWSRadar.prototype.setRadarID = function(radarid)
{
	this._radarid = radarid;
}

NWSRadar.prototype.setRadarImage = function()
{
	var product = "N0R";
	var radarimg = "RadarImg/" + product + "/" + this._radarid + "_" + product + "_0.gif";
    var legendimg = "Legend/" + product + "/" + this._radarid + "_" + product + "_Legend_0.gif";
	
	document.getElementById("legendimage").src = "http://radar.weather.gov/" + legendimg;;
	document.getElementById("radarimage").src = "http://radar.weather.gov/" + radarimg;
	
	document.getElementById("topo").src = "./images/radar/"+this._radarid+"_Topo_Short.jpg";
	document.getElementById("county").src = "./images/radar/"+this._radarid+"_County_Short.gif";
	document.getElementById("rivers").src = "./images/radar/"+this._radarid+"_Rivers_Short.gif";
	document.getElementById("hways").src = "./images/radar/"+this._radarid+"_Highways_Short.gif";
	document.getElementById("city").src = "./images/radar/"+this._radarid+"_City_Short.gif";
	document.getElementById("warn").src = "http://radar.weather.gov/Warnings/Short/"+this._radarid+"_Warnings_0.gif";
}

NWSRadar.prototype.render = function()
{
	this.renderStyles();
	document.write("<div id=\"image0\"><img width=\""+this._width+"\" height=\""+this._height+"\" style=\"z-index:0\" id=\"topo\" src=\"#\" border=\"0\"></div>");
	document.write("<div id=\"image1\"><img width=\""+this._width+"\" height=\""+this._height+"\" style=\"z-index:1\" id=\"radarimage\"src=\"#\" border=\"0\"></div>");
	document.write("<div id=\"image2\"><img width=\""+this._width+"\" height=\""+this._height+"\" style=\"z-index:2\" id=\"county\" src=\"#\" border=\"0\"></div>");
	document.write("<div id=\"image3\"><img width=\""+this._width+"\" height=\""+this._height+"\" style=\"z-index:3\" id=\"rivers\" src=\"#\" border=\"0\"></div>");
	document.write("<div id=\"image4\"><img width=\""+this._width+"\" height=\""+this._height+"\" style=\"z-index:4\" id=\"hways\" src=\"#\" border=\"0\"></div>");
	document.write("<div id=\"image5\"><img width=\""+this._width+"\" height=\""+this._height+"\" style=\"z-index:5\" id=\"city\" src=\"#\" border=\"0\"></div>");
	document.write("<div id=\"image6\"><img width=\""+this._width+"\" height=\""+this._height+"\" style=\"z-index:6\" id=\"warn\" src=\"#\" border=\"0\"></div>");
	document.write("<div id=\"image7\"><img width=\""+this._width+"\" height=\""+this._height+"\" style=\"z-index:7\" id=\"legendimage\" src=\"#\" border=\"0\"></div>");
	this.setRadarImage();
}

NWSRadar.prototype.renderStyles = function()
{
	document.write("<style>");
	document.write("#image0, #image1, #image2, #image3, #image4, #image5, #image6, #image7, #image8, #image9 ");
	document.write("{");
	document.write("	position:absolute;");
	document.write("	left:"+this._left+"px;");
	document.write("	top:"+this._top+"px;");
	document.write("}");
	document.write("</style>");
}
