function RequestForShops(branchegroups) {
    var shopLogosMode = jQuery("#shopLogosMode");
    if (!shopLogosMode[0]) return;
    var shopLogosCount = jQuery("#shopLogosCount");
    if (!shopLogosCount[0]) return;

    jQuery.post("~/ShopLogos/ShopLogos.ashx",
     { mode: shopLogosMode[0].value
     , count: shopLogosCount[0].value
     , branchegroups: branchegroups
     , page: GetPage()
     }, function(data) {
        jQuery('#shopsOutPut').html(data);
      });
}
function clearCounter() {
    var item = jQuery('#shopLogosPage');
    if (!item.length) return;
    item.val('0');
}
function GetPage() {
    var item = jQuery('#shopLogosPage');
    if (!item.length) return -1;
    var page = parseInt(item.val());
    item.val(page + 1)
    return page;
}
function RequestForNextAcceptanceShops() {
    RequestForShops(GetBrancheGroups());
}
function RequestForAcceptanceShops() {
    clearCounter();
    RequestForShops(GetBrancheGroups());
}
function FilterBranchesOnShops(el) {
    var branch = '';
    if (el) branch = el.options[el.selectedIndex].value;
    if (branch == "" && el)
        for (var i = 0; i < el.options.length; i++)
        branch += el.options[i].value + ",";

    RequestForShops(branch);
}
