// Function to display images in a popup window
// WJMB 2003-12
function imgWindow(imgurl, win, width, height, restitle, caption, catalogue) {
	horz = width + 28;
	vert = height + 100;
	imgwin = window.open('', win, 'resizable=no,toolbar=no,menubar=no,width=' + horz + ',height=' + vert);
	imgwin.document.writeln('<html><head><title>' + restitle + '</title><meta http-equiv="imagetoolbar" content="no"></head>');
	imgwin.document.writeln('<body bgcolor="#f2f8ff" text="#000000">');
	imgwin.document.writeln('<div align="center"><img src="' + imgurl + '" width="' + width + '" height="' + height + '" border="1" alt="' + restitle + '"><div class="caption" style="font:10pt Verdana,Arial,Helvetica,sans-serif;">' + caption + '</div>');
	if (catalogue != undefined && catalogue != '') {
		imgwin.document.writeln('<div style="font:10pt Verdana,Arial,Helvetica,sans-serif;color:#999">' + catalogue + '</div>');
	}
	imgwin.document.writeln('<div class="popupnav" style="margin:12px;width:100px;margin-right:0;"><a href="javascript:window.parent.close();" style="font:bold 8pt Verdana,Arial,Helvetica,sans-serif;">CLOSE</a></div><div style="height:60px"></div></div>');
	imgwin.document.writeln('</body></html>');
	imgwin.document.close();
	if (window.focus) { imgwin.focus(); }
}
// WJMB 2009-08
function mobile_version(mobile_url) {
	var url = window.location.toString();
	var a = navigator.userAgent.toLowerCase();
	if (url.indexOf("full=1") == -1 && (a.indexOf("iphone") >= 0 || a.indexOf("ipod") >= 0 || a.indexOf("blackberry") >= 0 
		|| a.indexOf("nokia") >= 0 || a.indexOf("android") >= 0 || a.indexOf("windows ce") >= 0 || a.indexOf("palmos") >= 0
		|| a.indexOf("240x320") >= 0 || a.indexOf("opera mini") >= 0)) {
		window.location = mobile_url;
	}
}
