sfHover = function() {
	var sfEls = document.getElementById("mainmenu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
function externalLinks() { 
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && 
			(anchor.getAttribute("rel") == "external" || anchor.getAttribute("rel") == "external nofollow") )
			anchor.target = "_blank"; 
	} 
} 

if (window.attachEvent) window.attachEvent("onload", sfHover);
window.onload = function() {
	settings = {
		tl: { radius: 10 },
		tr: { radius: 10 },
		bl: { radius: 10 },
		br: { radius: 10 },
		antiAlias: true,
		autoPad: true
	}
	var myBoxObject = new curvyCorners(settings, "rounded");
	myBoxObject.applyCornersToAll();
	externalLinks();
}

function confirmDelete(msg,url)  {
	var where_to = confirm(msg);
	if (where_to == true)  {
		window.location=url;
	}  else  {
		return false;
	}
}

function bookmarkPage() {
	var userAg = navigator.userAgent
	if (document.all && userAg.indexOf("MSIE") != -1 && userAg.indexOf("Windows") != -1) {
		window.external.AddFavorite(location,document.title);
	} else {
		if (userAg.indexOf("Windows") != -1) {
			if (userAg.indexOf("Opera") != -1) {
				alert('Use keyboard shortcut <ctrl>+T to bookmark UK Deed Poll');
			} else {
				alert('Use keyboard shortcut <ctrl>+D to bookmark UK Deed Poll');
			}
		} else if (userAg.indexOf("Macintosh") != -1) {
			alert('Use keyboard shortcut <command>+D or <Apple>+D to bookmark UK Deed Poll');
		}
	}
	return false;
}

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=400,height=400,left = 520,top = 250');");
}