//window.onload = refreshGraphs;

var refreshrate=150;   

function refreshGraphs()
{
		var ch = document.getElementsByTagName("img");  //get all img elements in the array ch
		for (a = 0; a < ch.length; a++)  //step through the ch array
		{
			if (ch[a].nodeName=="IMG")  //check to see we are on the img node
			{
				var ch1 = ch[a].src;  //put current src into temp variable
				var ch2 = ch[a].id;  //put current id into tmp variable
				if (ch1)
				{
					var aPosition = ch1.lastIndexOf(".");
					var imgSrc = ch1.substr(0, aPosition);
					var camPos = ch1.lastIndexOf("webcam");
					if (camPos > 1)
					{
						imageType = ".jpg";
					}
					else
					{
						imageType = ".gif";
					}
					document.images[ch2].src = imgSrc + imageType + "?" + new Date();  //set the src of image to its orig location + "?" + today's date to force browser to reload
				}
			}
		};
		setTimeout("refreshGraphs()", refreshrate*1000);
};

