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 chkF(field,alerttxt,reject){
	with (field) {
		if (value==null||value==""||value==reject){
			alert(alerttxt);
			return false
		} else { return true }
	}
}

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

function contactForm(thisForm) {
	with (thisForm){
		if (chkF(name, "Please enter your name.", "asd")==false){
			name.focus();
			return false
		}
		
		if (chkE(email,"Sorry that isn't a valid Email Address")==false){
			email.focus();
			return false
		}
	}
}

function confirmBox(text) {
	var answer = confirm(text);
	if (answer){ return true; }
	else { return false; }
}

function atbForm(thisForm) {
	with (thisForm){
		if (colour.selected = '0'){
			alert('Please choose a Colour');
			colour.focus();
			return false
		}
		
		if (size.selected = '0'){
			alert('Please choose a Size');
			size.focus();
			return false
		}
	}
}

function checkPrice(box, amt) {
	if(box.checked==true) {
		document.getElementById('priceForm').innerHTML = (parseFloat(amt) + 5).toFixed(2);
	} else {
		document.getElementById('priceForm').innerHTML = amt;
	}
}