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 (filepath) {
	new_window = window.open ("photos/"+filepath+".jpg",filepath,"width=440,height=510,toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=yes");
}

function open_map (filename) {
	new_window = window.open (filename,"map","width=625,height=600,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 open_otherimage (imagefile, width, height) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);


	new_window = window.open (imagefile,"a" + counter + "a","width="+width+",height="+height+",toolbar=no,location=no,scrollbars=no,directories=no,menubar=no,resizable=no");
}

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 () {

	if (document.FrontPage_Form3.Billing_State.value == "OH" || document.FrontPage_Form3.Shipping_State.value == "OH") {
		document.FrontPage_Form3.tax.value = cent(eval(document.FrontPage_Form3.subtotal.value) * .0675);
		document.FrontPage_Form3.total.value = cent(eval(document.FrontPage_Form3.tax.value) + eval(document.FrontPage_Form3.shipping.value) + eval(document.FrontPage_Form3.subtotal.value) - eval(document.FrontPage_Form3.gift.value));
		if (document.FrontPage_Form3.total.value < 0) {
			document.FrontPage_Form3.total.value = 0;
		}
		if (document.FrontPage_Form3.Billing_State.value !== "OH" || document.FrontPage_Form3.Shipping_State.value !== "OH") {
			alert("Ohio State Sales Tax in the amount of $"+ document.FrontPage_Form3.tax.value + " has been added to your order total.");
		}
	}
	else {
		document.FrontPage_Form3.tax.value = cent(0);
		document.FrontPage_Form3.total.value = cent(0);
	}
}
function open_window (page) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);

	new_window = window.open (page,"a" + counter + "a","width=575,height=650,toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=yes");
}

function open_newsletter (imagefile, width, height) {

date = new Date();
counter = Math.floor((date.getSeconds()/60)*100);


	new_window = window.open (imagefile,"a" + counter + "a","width="+width+",height="+height+",toolbar=no,location=no,scrollbars=yes,directories=no,menubar=no,resizable=no");
}
