// JavaScript Document
function menuShow(m)
{
	// set bgcolor of top horizontal menu bar
	var mTop = document.getElementById(m);
	mTop.style.backgroundColor = "#AA3300";
}

function chkMin(q, m)
{
	qv = Number(q.value);
	mv = Number(m);
	// alert(mv + "   " + qv);

	if (mv >= 1)
	{
		if (qv < mv && qv != 0)
		{
			q.value = mv;
			q.select();
			alert("The minimun order for this item is " + mv + ".\n Please change the quantity to " + mv + " or more.\n Thank You.");
			// return false;
		}
		else if (qv % 1 != 0)
		{
			q.value = Math.round(qv);
			q.select();
			alert("This item is only available in whole units.\n Please enter a whole number for the quantity.\n Tnank You.");
		}
	}
	
	if (mv < 1)
	{
		if (qv < mv && qv != 0)
		{
			q.value = mv;
			q.select();
			alert("The minimun order for this item is " + mv + ".\n Please change the quantity to " + mv + " or more.\n Thank You.");
			// return false;
		}
		else if ((qv * 10) % 1 != 0)
		{
			pt = mv*100;
			q.value = Math.round(qv*10) / 10;
			q.select();
			alert("This item is only available in " + pt + "ths or whole units.\n Please enter " + pt + "ths or a whole number for the quantity.\n Tnank You.");
			// return false;
		}
	}
}

function chkForZipCode()
{
	var f = document.getElementById("txtZip");
	// alert(f.value.length);
	if (f.value.length != 5)
	{
		alert("Please enter your zipcode");
		return false;
	}
	else
	{
		// alert("Zipcode is good");
		return true;
	}
}

function chkSubmitZip()
{
	var zc = document.getElementById("txtZip");
	var zcv = zc.value;
	
	if (zcv.length != 5)
	{
		alert ("Please enter a valid zipcode");
		return false;
	}
	return true;
}

function chkUpdateZip()
{
	var zc = document.getElementById("txtZip");
	var zcv = zc.value;
	
	if (zcv != "")
	{
		if (zcv.length != 5)
		{
			alert ("Please enter a valid zipcode");
			return false;
		}
	}
	return true;
}