// Check At Least 1 Form Of Payment
function chk_check(cid)
{
var cc = 0;
var chks = form['fop[]'];
var curchk = document.getElementById(cid);
	for (count = 0; count < chks.length; count++)
	{
		if (chks[count].checked)
		{
		cc = cc + 1;
		}
	}
	if (cc < 1 )
	{
	alert("At least 1 form of payment must be selected.")
	curchk.checked = true;
	return (false);
	}
}
// Toggle DIVs
function toggle(id,cell)
{
var mydiv = document.getElementById(id);
var mycell = document.getElementById(cell);
	if(mydiv.style.display == 'block')
	{
	mydiv.style.display = 'none';
	mycell.style.paddingBottom = null;
	mycell.style.height = '11px';
	} else {
	mydiv.style.display = 'block';
	mycell.style.paddingBottom = '11px';
	mycell.style.height = null;
	}
}
// Control Business Hour
function checkBH(bhtype,id,id2)
{
var vala = document.getElementById(id);
var valb = document.getElementById(id2);
if(bhtype == 1)
{
	if (vala.selectedIndex == 48){valb.options[48].selected = true; valb.disabled = true;}
	if (vala.selectedIndex == 49){valb.options[49].selected = true; valb.disabled = true;}
	if (vala.selectedIndex != 48 && vala.selectedIndex != 49){valb.options[40].selected = true; valb.disabled = false;}
}
if(bhtype == 2)
{
	if (valb.selectedIndex == 48){vala.options[48].selected = true; valb.disabled = true;}
	if (valb.selectedIndex == 49){vala.options[49].selected = true; valb.disabled = true;}
}
}
// Limit Form Field
function ismaxlength(obj)
{
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}