var allowformsubmit=true;
    var numCourse=0;
    function doCourseCount() {
    var total = 0;
    var max = document.TeeTimeSearchFormLg.crs.length;
    for (var idx = 0; idx < max; idx++) {
    if (eval("document.TeeTimeSearchFormLg.crs[" + idx + "].checked") == true) {
        total += 1;
       }
    }
    if (total > 3)
        {
            allowformsubmit=false;
        }
        else
        {
            allowformsubmit=true;
        }
    if (total < 1)
        {
            allowformsubmit=false;
        }
       numCourse=total;
    }
    function checkformsubmit()
    {
        
        doCourseCount();
        if (numCourse < 1)
        {
            allowformsubmit = false;
        }
        if (allowformsubmit)
        {
            document.TeeTimeSearchFormLg.submit();
        }
        else
        {
            if (numCourse > 3)
            {
            document.getElementById('PkgMessage').innerHTML='You have selected too many courses, please select no more than 3.';
            }
            if (numCourse < 1)
            {
                document.getElementById('PkgMessage').innerHTML='You must select at least one course in order to search.';
            }
            
        document.getElementById('PKGContainer').style.visibility='visible';
        }
    }
    function hideme(container)
    {
        document.getElementById(container).style.visibility='hidden';
    }
