﻿// JScript File
function countCheckedLocality()
    {
    var a = document.getElementById('CBLLocality');
    var totRows = a.rows.length;
    var Inputs = a.getElementsByTagName("input");
    var counter = 0;
    var chk="0";
    var x=0; 
    var j=0;
    var p=0;
    var allTypes = ''
    for(var iCount = 0; iCount < totRows ; iCount++)
    {  
        
        if(Inputs[iCount].type == 'checkbox' && Inputs[iCount].checked)
        {
            counter++; 
           if(counter > 5)
            {
                alert('A Maximum 5 locations can be selected.');
                return false;
            }            
        }            
    }    
    return true;
    }
    
    function countCheckedProperty()
    {
    var a = document.getElementById('CBLPropType');
    var totRows = a.rows.length;
    var Inputs = a.getElementsByTagName("input");
    var counter = 0;
    var chk="0";
    var x=0; 
    var j=0;
    var p=0;
    var allTypes = ''
    for(var iCount = 0; iCount < totRows ; iCount++)
    {  
        
        if(Inputs[iCount].type == 'checkbox' && Inputs[iCount].checked)
        {
            counter++; 
           if(counter > 5)
            {
                alert('A Maximum 5 property types can be selected.');
                return false;
            }            
        }            
    }    
    return true;
    }


