var cur_img = 3;
function cam_swap(img) {
	time = new Date();
	if(img) cur_img = img;
	else img = cur_img;
	cam = document.getElementById('wcam');
	cam.setAttribute('src','http://www.edgartownmarine.com/images/webcam/pos'+(img+4)+'.jpg?'+Math.round(time.getTime()/1000/60/5));
	links = document.getElementById('wcamls');
	j = 0;
	for(i = 0; i < links.childNodes.length; i++) {
		if(links.childNodes.item(i).nodeName != 'LI') continue;
		else j++;
		link = document.getElementById('wcaml'+j);
		if(j == img) {
			link.removeAttribute('href');
			link.style.textDecoration = 'underline';
		}
		else {
			link.setAttribute('href','webcam.php3?img='+j);
			link.style.textDecoration = 'none';
		}
	}
	
}
function meta_cam_swap() {
	cam_swap(cur_img);
}
var refint = setInterval(meta_cam_swap,300000);

