window.onload = function(){
	if (document.getElementById) {
		//external links to open in a new window
		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.target = '_blank'; 
		}
	
////////rollover effect on some images
		var images = document.getElementsByTagName("img");
		for (var y=0; y<images.length; y++){
			if(images[y].className == 'r'){
				images[y].onmouseover = function(){ this.src = this.src.replace(/.gif/, "_o.gif"); }
				images[y].onmouseout = function(){ this.src = this.src.replace(/_o.gif/, ".gif"); }
			}
		}	
	}
}

sfHover = function() {
	var sfEls = document.getElementById("nav").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"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

writeFlash = function(id) {
	switch(id){
		case 'banhome':
			document.getElementById(id).innerHTML = "<object type=\"application/x-shockwave-flash\" data=\"/img/flash/home.swf\" width=\"299\" height=\"118\"><param name=\"wmode\" value=\"opaque\" /><param name=\"movie\" value=\"/img/flash/home.swf\" /></object>";
			break    ;
	}
}


function displayE(whose){
var d = 'miltonkeynesrestaurants';
var at = '@';
var tld = '.com';

document.write('<a href="mailto:' + whose + at + d + tld + '">' + whose + at + d + tld + '</a>');
}