//Maximum number of translations the user can select
var MaxUserTranslations;

// number of selected tranlations
var TranslationCount;

// translation list client id
var TranslationListClientId;

// translation list - number of items
var TranslationListLength;

function CountItems()
{
  TranslationCount = 0;
  for (var ictr = 0; ictr < TranslationListLength; ictr++)
  {
    var cb = document.getElementById(TranslationListClientId + "_" + ictr);
    if ( cb != null)
      if (cb.checked)
        TranslationCount++;
  }
  
  if (TranslationCount > MaxUserTranslations)
  {
    alert("You have exceeded the Maximum number of Translations [" + MaxUserTranslations + "]\n\nYou Selected " + TranslationCount)
    return false;
  }
  else
    return true;
}