function PopupPic(sPicURL, title) {
    newWindow = window.open('', "",  "HEIGHT=200,WIDTH=200,scrollbars=no");
    newWindow.document.open();
    newWindow.document.write("<HTML><HEAD><TITLE>" + title + "</TITLE><script language='javascript'>var arrTemp=self.location.href.split(\"?\");");
    newWindow.document.write("var picUrl = (arrTemp.length>0)?arrTemp[1]:\"\";var NS = (navigator.appName==\"Netscape\")?true:false;");
    newWindow.document.write("function FitPic() { iWidth = (window.innerWidth)?window.innerWidth - 5:document.body.clientWidth; iHeight = (window.innerHeight)?window.innerHeight:document.body.clientHeight;");
    newWindow.document.write("iWidth = document.images[0].width - iWidth; iHeight = document.images[0].height - iHeight; window.resizeBy(iWidth, iHeight); self.focus();};");
    newWindow.document.write("</script></HEAD><BODY onclick='window.close()' bgcolor='#000000' onload='FitPic();' style='margin:0;padding:0;overflow: hidden;'><script language='javascript'>");
    newWindow.document.write("document.write(\"<img src='" + sPicURL + "' border=0>\");</script></BODY></HTML>");
    newWindow.document.close();
    newWindow.focus();
}

var globalBehaviours = {
	'a' : function (element) {
		if (element.getAttribute("href") && 
			element.getAttribute("rel") && 
			(element.getAttribute("rel") == "ext")) {

			element.target = "_blank";
		}
	},
	'hr' : function (element) {
		var p = document.createElement('p');
		var parent = element.parentNode;
		p.className = 'hr';
		parent.insertBefore(p, element);
		parent.removeChild(element);
	}
};

Behaviour.register(globalBehaviours);

