// JavaScript Document

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 (document.all&&document.getElementById) window.onload=sfHover;*/ 

if (window.attachEvent) window.attachEvent("onload", sfHover);

//Basket Address Option Box Validation
function verifySelected() {
	var addressFlag = false;
	var theTable = document.getElementById("address-list");
	var inputArray = theTable.getElementsByTagName("input");

	for (var i=0; i < inputArray.length; i++) {
		var inputType = inputArray[i].getAttribute("type");
		
		if (inputType == "radio" && inputArray[i].checked == true) {
			addressFlag = true;
		}
	}

	if (addressFlag == true) {
		return true;
	}
	
	else {
		alert("Please make sure valid delivery and invoice addresses are selected. \n\n If no invoice address is selected we will use the most recently added address by default.");
		return false;
	}
	
}
