function browser_name() {
		var browser_name = navigator.appName;
		return browser_name;
	}

	function browser_version() {
		var browser_version = parseFloat(navigator.appVersion);
		return browser_version;
	}

	function browser_os() {
		if(navigator.appVersion.indexOf("Win95") > 0) return "WIN95";
		else if(navigator.appVersion.indexOf("Win16") > 0) return "WIN31";
		else if(navigator.appVersion.indexOf("WinNT") > 0) return "NT";
		else if(navigator.appVersion.indexOf("Mac") > 0) return "MAC";
		else if(navigator.appVersion.indexOf("UNIX") > 0) return "UNIX";
		else return "UNKNOWN";
	}

var browserOk = false;

if (browser_name() == "Netscape" && browser_version() >= 3.0) browserOk = true;
else if (browser_name() == "Microsoft Internet Explorer" && browser_version() >= 3.0) browserOk = true;

function chg_button(titlename, onoff) 
{

 if (browserOk == true) {
		if (onoff == "on") {
			document[titlename].src = "images/button_" + titlename + "_on.gif"
		}
		else
		{
			document[titlename].src = "images/button_" + titlename + "_off.gif";
		}
	}
}

function open_photo (id) {
	new_window = window.open ("products/photos_large/" + id + ".jpg","a" + id + "a","width=500,height=510,toolbar=no,location=no,scrollbars=no,directories=no,menubar=no,resizable=no");
}

function open_recipe (recipe_id) {
	new_window = window.open ("cookbook_recipe.asp?recipe_id="+recipe_id,"c" + recipe_id + "c","width=650,height=400,toolbar=no,location=no,scrollbars=yes,directories=no,menubar=yes,resizable=yes");
}


function insert_top () {

var top_img = new Array();
var top_img_id = new Array();
var counter;

counter=0;

top_img[counter] = "top_masks.jpg";
top_img_id[counter] = "2";
counter++;

date = new Date();
pick_img = Math.floor((date.getSeconds()/60)*top_img.length);

document.write("<a href='view_product.asp?id=" + top_img_id[pick_img] + "'><img border='0' src='images/" + top_img[pick_img] + "' width='415' height='123'></a>");

}

function cent(amount) {
    amount -= 0;
    amount = (Math.round(amount*100))/100;
    return (amount == Math.floor(amount)) ? amount + '.00' : (  (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
}

function update () {
	quantity_discount = 0; 
	if (document.FrontPage_Form1.quantity_discount_present.value == "yes") { quantity_discount = eval(document.FrontPage_Form1.quantity_discount.value); }
	if (document.FrontPage_Form1.Billing_State.value == "OH" || document.FrontPage_Form1.Shipping_State.value == "OH") {
		document.FrontPage_Form1.shipping.value = cent(document.FrontPage_Form1.Shipping_Options.value);
		document.FrontPage_Form1.tax.value = cent((eval(document.FrontPage_Form1.subtotal.value) - quantity_discount) * .0675);
		document.FrontPage_Form1.total.value = cent(eval(document.FrontPage_Form1.tax.value) + eval(document.FrontPage_Form1.shipping.value) + eval(document.FrontPage_Form1.subtotal.value) - quantity_discount);
		if (document.FrontPage_Form1.Billing_State.value !== "OH" || document.FrontPage_Form1.Shipping_State.value !== "OH") {
			alert("Ohio State Sales Tax in the amount of $"+ document.FrontPage_Form1.tax.value + " has been added to your order total.");
		}
	}
	else {
		document.FrontPage_Form1.tax.value = cent(0);
		document.FrontPage_Form1.shipping.value = cent(document.FrontPage_Form1.Shipping_Options.value);		
		document.FrontPage_Form1.total.value = cent(eval(document.FrontPage_Form1.subtotal.value) + eval(document.FrontPage_Form1.shipping.value) - quantity_discount);
	}
//	document.FrontPage_Form1.Shipping_State.value = document.FrontPage_Form1.Billing_State.value
}





