function calc(thisForm)
{
  var total = 0;
  var tempStr;

  for (i = 0; i < thisForm.length; i++) 
  {
	if (thisForm[i].type == 'checkbox' && thisForm[i].checked == true)
	{
		tempStr = "document.form1.q" + thisForm[i].name + ".value";
	 	total = total + (eval(thisForm[i].value) * eval(tempStr));
	}
  }
  total = Math.round(total * 100) / 100;
  document.form1.hiddenTotal.value = total;
  document.form1.total.value = "$ " + total;  
}


//Do not charge multiple amount for this event by the quantity
function calc2(thisForm)
{
  var total = 0;
  var tempStr;

  for (i = 0; i < thisForm.length; i++) 
  {
	if (thisForm[i].type == 'checkbox' && thisForm[i].checked == true)
	{
		tempStr = "document.form1.q" + thisForm[i].name + ".value";
	 	//total = total + (eval(thisForm[i].value) * eval(tempStr));
	 	total = total + (eval(thisForm[i].value));
	}
  }
  total = Math.round(total * 100) / 100;
  document.form1.hiddenTotal.value = total;
  document.form1.total.value = "$ " + total;  
}



function checkForm()
{
  //if (document.form1.hiddenTotal.value == 0)
  if (document.form1.checkedItems.value == "")
  {
    alert("You have to choose at least 1 event.");
    return false;
  }
  if (document.form1.hiddenTotal.value < 0)
  {
    alert("Error!");
    return false;
  }

  return true;
}

function checkedField(thisForm)
{
  var checkedItems = "";
  var tempStr;
  
  for (i = 0; i < thisForm.length; i++) 
  {
    tempStr = "document.form1.q" + thisForm[i].name + ".value";
    if (thisForm[i].type == 'checkbox' && thisForm[i].checked == true && eval(tempStr) > 0)
    {
      checkedItems = checkedItems + thisForm[i].name + ",";
    }
  }

  document.form1.checkedItems.value = checkedItems; 
}

function enableField(me,fieldName)
{
	tField = eval('document.form1.' + fieldName);

	if (me.checked == true)
	{
		tField.disabled = false;
		tField.style.background = 'ffffff';	
	}
	else
	{
		tField.disabled = true;
		tField.style.background = 'eeeeee';
	}
}

function preSet()
{
  formName = eval(document.form1);
  for (i = 0; i < formName.length; i++) 
  {
    if (formName.elements[i].type == 'checkbox' && formName.elements[i].checked == false)
    {
	tField = formName.elements[i].name;
	tField = eval('document.form1.q' + tField); 
        tField.disabled = true;
	tField.style.background = 'eeeeee';
    }
  }
}

