﻿var count = 0
var limit = 3;
function BrochureCount(chk)
{
    if(document.getElementById(chk).checked)
    {
        count = count + 1;
    }
    else
    {
        count = count - 1;
    }

    if (count > limit)
    {
        count = count - 1
        document.getElementById(chk).checked = false;
        if (count == 1) {
            alert('Please note: There is a maximum of ' + limit + ' brochure can be requested');
        } else {
            alert('Please note: There is a maximum of ' + limit + ' brochures can be requested');
        }
    }
}