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);

function pcgcFlash(itemname, width, height, itemid){
   document.write('<object style="border:0;padding:0;margin:0;" type="application/x-shockwave-flash" data="images/'+itemname+'.swf" width="'+width+'" height="'+height+'" title="Minimal Invasive Hip - Warning - Flash Movie" id="'+itemid+'">\n');
   document.write('<param name="movie" value="images/'+itemname+'.swf" />\n');
   document.write('<param name="wmode" value="transparent" />\n');
   document.write('<param name="quality" value="high" />\n');
   document.write('</object>\n');
}

function changeImage(nid, imgn) {
	document.getElementById(nid).src = "images/"+imgn+".jpg";
}


function valReq(field,alerttxt){
	with (field) {
		if (value==null||value==""){
			alert(alerttxt);
			return false
		}
		else {
			return true
		}
	}
}
function valEmail(field,alerttxt){
	with (field){
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
			  {alert(alerttxt);return false}
		else {return true}
	}
}

function gpForm(thisform){
	with (thisform){
		if (valReq(gpPractice,"Please enter your Practice name")==false){
			gpPractice.focus();
			return false
		}
		if (valReq(gpSurname,"Please enter your last name")==false){
			gpSurname.focus();
			return false
		}
		if (valReq(gpTownCity,"Please enter your Town / City")==false){
			gpTownCity.focus();
			return false
		}
		if (valReq(gpTelephone,"Please enter your contact telephone number.")==false){
			gpTelephone.focus();
			return false
		}
		if (valEmail(gpEmail,"Sorry that is not a valid e-mail address!")==false){
			gpEmail.focus();
			return false
		}
	}
}