function imageMouseOver(imagePath,imageFile,imageName) {
	document[imageName].src = imagePath + imageFile; }

function imageMouseOut(imagePath,imageFile,imageName) {
	document[imageName].src = imagePath + imageFile; }

function imageRollover(imagePath,imageFile,imageName) {
	document[imageName].src = imagePath + imageFile; }

var currentDivArray = new Array(2);
currentDivArray[0] = "";
currentDivArray['feature'] = "feature_div1";
currentDivArray['content'] = "content_div1";
	
function show_div(newDiv,currentDivIndex) {
	var currentDiv = currentDivArray[currentDivIndex];
	if (currentDiv != "" && currentDiv != newDiv) {
		document.getElementById(currentDiv).style.display = "none";
	}
	if (newDiv != currentDiv) {
		currentDivArray[currentDivIndex] = newDiv;
		document.getElementById(newDiv).style.display = "";
	}
}

function menuRollover(current, style) {
	current.className = style;
}

function show_div_h(newDiv,currentDivIndex) {
	var currentDiv = currentDivArray[currentDivIndex];
	if (currentDiv != "" && currentDiv != newDiv) {
		document.getElementById(currentDiv).style.display = "none";
		var menuObject = document.getElementById(currentDiv + "_menu");
		if (menuObject != null) {
			menuObject.className = "feature-submenu";
		}
		menuObject = document.getElementById(currentDiv + "_img");
		if (menuObject != null) {
			var path = menuObject.src;
			menuObject.src = path.substring(0, path.lastIndexOf('_h.jpg')) + '.jpg';
		}
	}
	
	if (newDiv != currentDiv) {
		currentDivArray[currentDivIndex] = newDiv;
		document.getElementById(newDiv).style.display = "";
		var menuObject = document.getElementById(newDiv + "_menu");
		if (menuObject != null) {
			menuObject.className = "feature-submenuS";
		}
		menuObject = document.getElementById(newDiv + "_img");
		if (menuObject != null) {
			var path = menuObject.src;
			menuObject.src = path.substring(0, path.length - 4) + '_h.jpg';
		}
	}
}


function validate_feedback() {
	return true;
}



function validate_order() {
	var count = 1;
	var error = "";
	if (form_order.order_name.value == "")
		error += count++ + ". Contact Name\n";
	if (form_order.order_email.value == "")
		error += count++ + ". Email\n";
	if (form_order.order_phone.value == "")
		error += count++ + ". Phone\n";
	
	
	if (!form_order.club_address.checked) {
		if (!form_order.delivery_service[0].checked) {
			if (form_order.shipping_name.value == "")
				error += count++ + ". Shipping Name\n";
			if (form_order.shipping_address.value == "")
				error += count++ + ". Shipping Address\n";
			if (form_order.shipping_city.value == "")
				error += count++ + ". Shipping City\n";
			if (form_order.shipping_state.value == "")
				error += count++ + ". Shipping State\n";
			if (form_order.shipping_zip.value == "")
				error += count++ + ". Shipping Zip Code\n";
		}
	}	
	if (!form_order.club_cc.checked) {
		if (form_order.billing_same.checked) {
			if (form_order.shipping_name.value == "")
				error += count++ + ". Shipping/Billing Name\n";
			if (form_order.shipping_address.value == "")
				error += count++ + ". Shipping/Billing Address\n";
			if (form_order.shipping_city.value == "")
				error += count++ + ". Shipping/Billing City\n";
			if (form_order.shipping_state.value == "")
				error += count++ + ". Shipping/Billing State\n";
			if (form_order.shipping_zip.value == "")
				error += count++ + ". Shipping/Billing Zip Code\n";
		}
		else {
			if (form_order.billing_name.value == "")
				error += count++ + ". Billing Name\n";
			if (form_order.billing_address.value == "")
				error += count++ + ". Billing Address\n";
			if (form_order.billing_city.value == "")
				error += count++ + ". Billing City\n";
			if (form_order.billing_state_province.value == "")
				error += count++ + ". Billing State / Province\n";
			if (form_order.billing_zip_postal_code.value == "")
				error += count++ + ". Billing Zip / Postal Code\n";
		}
		if (form_order.cc_type.value == "")
			error += count++ + ". Credit Card Type\n";
		if (form_order.cc_number.value == "")
			error += count++ + ". Credit Card Number\n";
		if (form_order.cc_expiration_month.value == "")
			error += count++ + ". Expiration Month\n";
		if (form_order.cc_expiration_year.value == "")
			error += count++ + ". Expiration Year\n";
		
	}
	if (error == "") {
		form_order.email.value = form_order.order_email.value;
		return true;
	}
	else {
		alert("The following fields are required: \n\n" + error);
		return false;
	}
}

function validate_subscription() {
	var count = 1;
	var error = "";
	if (form_subscribe.newsletter_first_name.value == "")
		error = count++ + ". First Name\n";
	if (form_subscribe.newsletter_last_name.value == "")
		error += count++ + ". Last Name\n";
	if (form_subscribe.newsletter_address_1.value == "")
		error += count++ + ". Address\n";
	if (form_subscribe.newsletter_city.value == "")
		error += count++ + ". City\n";
	if (form_subscribe.newsletter_state_province.value == "")
		error += count++ + ". State or Province\n";
	if (form_subscribe.newsletter_zip_postal_code.value == "")
		error += count++ + ". Zip or Postal Code\n";
	if (form_subscribe.newsletter_email.value == "")
		error += count++ + ". Email\n";
	if (error == "") {
		form_subscribe.email.value = form_subscribe.newsletter_email.value;
		return true;
	}
	else {
		alert("The following fields are required: \n\n" + error);
		return false;
	}
}

/* ie fix for incompatibility with css :hover functionality */
sfHover = function() {
	var sfEls = document.getElementById("dmenu").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);