function doPopup() {
if (!document.getElementsByTagName) return false;
	var links=document.getElementsByTagName("a");
	
	for (var i=0; i < links.length; i++) {
	
		if (links[i].className.match("popup")) {
			links[i].onclick=function() {
				window.open(this.href, "", "width=776,height=600,scrollbars,resizable,status"); return false;
			}
		}
		if (links[i].className.match("popup2")) {
			links[i].onclick=function() {
				window.open(this.href, "", "width=776,height=460,scrollbars,resizable,status"); return false;
			}
		}
		
		//MON: 09/07/2008 - for video popup window (320x240 + flash control)
		if (links[i].className.match("popup_video")) {
			links[i].onclick=function() {
			window.open(this.href, "", "width=320,height=280"); return false;
			}
		}
		
		//MON: 16/07/2008 - no scrollbars thin window
		if (links[i].className.match("popup_thin")) {
			links[i].onclick=function() {
			window.open(this.href, "", "width=800,height=460"); return false;
			}
		}
		
		//Ben: 04/11/2008 - used for an image on the keven miles page
		if (links[i].className.match("popup_image")) {
			links[i].onclick=function() {
			window.open(this.href, "", "width=720,height=410"); return false;
			}
		}
		
		//TUE: 05/08/2008 - for HTW videos (512x329 + flash control)
		if (links[i].className.match("popup_htw")) {
			links[i].onclick=function() {
			window.open(this.href, "", "width=512,height=329"); return false;
			}
		}
		
		//ROB: 25/11/2008 - education videos (600x375 inc. flash control)
		if (links[i].className.match("popup_education")) {
			links[i].onclick=function() {
			window.open(this.href, "", "width=600,height=375"); return false;
			}
		}
		
		//MON: 11/03/2009 - innit
		if (links[i].className.match("popup_howto")) {
			var w = 506;
			var h = 350;
			var l = (screen.width/2)-(w/2);
			var t = (screen.height/2)-(h/2);
			links[i].onclick=function() {
				window.open(this.href, "", "width=" + w + ",height=" + h + ",left=" + l + ",top=" + t + ",resizable,status"); return false;
			}
		}
	}
}


window.onload = function(){
  doPopup();
}
