//This function performs validation and any other pre-form-submit tasks.
//The form will only be submitted if this function returns true.
function validateMyForm()
{
	// var isValid = confirm('By changing this information you may no longer be following the Body Genie recommendations. Are you sure you wish to change your preferences?');
    var isValid = confirm('Changing these values will mean you are no longer following the Body Genie program.  You may prolong the process of obtaining results or put your health at risk by changing your body weight faster than the Body Genie program considers safe and effective.  Are you sure you wish to change your preferences?');    
    //alert('validateMyForm: isValid = ' + isValid);
    return isValid;
}

//This function simulates the onsubmit event handler.
//This function should be called by javascript code instead of document.MyFormName.submit().
function submitMyForm()
{
    //first, call the same validation function used in the form.onsubmit event handler
    var thisresult = validateMyForm();
    //alert('submitMyForm: validateMyForm returned: ' + thisresult);

    //if the function returned true, submit the form
    if (thisresult) 
    {
        //alert('submitMyForm: javascript will submit form');
        document.frmMyPrefs.submit();
    }
}


function setCals()
{
  temp = document.frmMyPrefs.cboSpeed;
	vals = temp.options[temp.selectedIndex].value;
	if (!vals) return
	document.frmMyPrefs.txtCalories.value=vals;
}