function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var MM_contentVersion = 7;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

var ns = (document.layers) ? true : false;
var ie = (document.all) ? true : false;

function showLayer (id) {
	if (ns) {
		document.layers[id].visibility = "show";
	} else if (ie) {
		document.all[id].style.visibility = "visible";
	}
}

function hideLayer (id) {
	if (ns) {
		document.layers[id].visibility = "hide";
	} else if (ie) {
		document.all[id].style.visibility = "hidden";
	}
}

function GoBlank(currentfield){
	var selectedField = currentfield
	selectedField.value = ""
}

function popup_window(url, windowName, windowWidth, windowHeight) {
	win = window.open(url, windowName, "width="+windowWidth+",height="+windowHeight+",resizable=no,status=no,scrollbars=no,location=no,menubar=no,toolbar=no");
}

function CheckUserForm()
		{
			var ReturnVar = false
			if 	(document.footballers_wives.entry_answer.value == "")
			{
				alert ("To enter this competition, we will require you to enter an answer. Thank you.");
				document.footballers_wives.entry_answer.focus();
			}
			else if 	(document.footballers_wives.entry_firstname.value == "")
			{
				alert ("To enter this competition, we will require your First Name. Thank you.");
				document.footballers_wives.entry_firstname.focus();
			}
			else if 	(document.footballers_wives.entry_surname.value == "")
			{
				alert ("To enter this competition, we will require your Surname. Thank you.");
				document.footballers_wives.entry_surname.focus();
			}
			else if 	(document.footballers_wives.entry_address.value == "")
			{
				alert ("To enter this competition, we will require your Address. Thank you.");
				document.footballers_wives.entry_address.focus();
			}
			else if 	(document.footballers_wives.entry_email.value == "")
			{
				alert ("To enter this competition, we will require your E-Mail Address. Thank you.");
				document.footballers_wives.entry_email.focus();
			}
			else if 	(document.footballers_wives.entry_phone.value == "")
			{
				alert ("To enter this competition, we will require your Phone. Thank you.");
				document.footballers_wives.entry_phone.focus();
			}
			else
			{
				ReturnVar = true;
			}
		
			return ReturnVar;
		}
		
function change_visibility(the_menu,visibility_type) {
	document.all.item(the_menu).style.display = visibility_type;	
}

function InsertFlash(html)
{
	document.write(html);
}
// Go Blank (Used to replace default values in fields)
function GoBlank(obj,DefaultValue) {
	if (obj.value == DefaultValue) {
		obj.value = '';
	}		
}
