﻿
(function(){if(typeof BA==='undefined'){BA={};}
if(typeof BA.Flat==='undefined'){BA.Flat={};}
if(typeof BA.Flat.AjaxAllFlatResults==='undefined'){BA.Flat.AjaxAllFlatResults={};}
Cuke.apply(BA.Flat.AjaxAllFlatResults,{searchParams:null,init:function(clientId,cityId,currentPageUrl,isLogged,page,itemsCountRessource,itemsPerPage)
{var self=this;var wrapper=$j("#"+clientId);var getResultData=function(dInfo,synDicName)
{$j.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:Cuke.RootUrl+"BeApart/Basic/Service/SearchService.asmx/GetAllFlatOnline",data:JSON.stringify({cityID:cityId,displayInfo:dInfo,cultureName:Cuke.cultureName}),dataType:"json",success:function(resp)
{if(resp.d.Result===0)
{Cuke.SyncDic.dispatch(synDicName,resp.d.Data);}}});};Cuke.SyncDic.bind("AjaxResultsListGetPage",function(displayInfo,name)
{getResultData(displayInfo,"AjaxResultsListNewPage");});Cuke.SyncDic.bind("AjaxResultsMapGetPage",function(displayInfo,name)
{getResultData(displayInfo,"AjaxResultsMapNewPage");});BA.Flat.AjaxResults.init($j("#"+clientId),currentPageUrl,isLogged,page,itemsCountRessource,itemsPerPage);}});})();
