function DealerLocator(){
        var path_to_point_profile = Config.getRootPath("index.php?r=site/point");
        var path_to_points_list = Config.getRootPath("index.php?r=site/points");
	var path_to_point_profile_sidebar = Config.getRootPath("index.php?r=site/PointProfileSidebar");
	var path_to_point_profile_title = Config.getRootPath("index.php?r=ajax/PointProfileTitle");
        
        var sidebar_container = $("#searchcontainer");        
        var getBrowserState = function(){
            if ($.browser.msie == true && ($.browser.version == '7.0' || $.browser.version == '6.0')){                
                return 0;
            }
            return 1;
        }
        var if_not_a_browser = '&is_browser='+getBrowserState();
        var setHeight = function(){
            var iFrame = $(this, parent.document.body);
            iFrame.height($(document.body).height() + 30);
            h = $(this, parent.document.body).height();
        }

	var renderList = function(points_list){
		$('#dealer_locator').html(points_list);
		$('#dealer_locator > ul > li:last').attr('style', 'border:0;');
                //ie6 fix
                $('#dealer_locator ul.uho_links_box li').mouseenter(function(){
                        $(this).css('background-color', '#A0B7CF');
                        }).mouseleave(function(){
                                $(this).css('background-color', '#DFE9F4');
                        });
		//ie6 fix
	};
        
	return	{
            url_helper : new UrlHelper(),
            //Specify the url where to send JSONP request
            url:Config.getRootPath('index.php?callback=?&r=ajax/TopPointsList'+if_not_a_browser),
            basID: 0,
	    //Specify count for list of new BAS 
	    topCount: 6,
	    // save BAS Point ID to cookie before redirect page	        
	    savePointID: function (id) {
			$.cookie("basID", id);
			this.basID = id;
			return true;
	    },
	    // get BAS Point ID from cookie
	    getPointID: function(){
	    	this.basID = window.location.hash.substr(1) || $.cookie("basID");
	    	return this.basID; 
	    },
	    // get Top X points list from dealer locator site
	    getTopPointsList: function(count){
	    	count = count || this.topCount;
                var isBrowser = getBrowserState();
	    	$.ajax({
	    	    url: this.url,
	    	    data: {'count': count, 'is_browser': isBrowser, 'domain': this.url_helper.getDomain()},
	    	    type: 'GET',    
	    	    success: function(points_data){
	        	  points_list = points_data; // Should be eval to JSON array                          
	        	  renderList(points_list);    	      
	    	    },
	    	    dataType: 'jsonp'
	    	});
	    },
	    getPointProfileTitle: function(id){
                var isBrowser = getBrowserState();
	    	$.ajax({	    		
	    	    url: path_to_point_profile_title,
	    	    data: {'id': id, 'is_browser': isBrowser, 'domain': this.url_helper.getDomain()},
	    	    type: 'GET',    
	    	    success: function(title){                        
	    	    	$("div#top h2").html(title).css('background','#568DC6').css("color","#fff");
                        $("h1.top").html(title).css('background','#568DC6').css("color","#fff");
	    	    },
	    	    dataType: 'jsonp'
	    	});	    	
	    },
	    getPointProfileSidebar: function(id){
                var url = path_to_point_profile_sidebar+'&id='+id+'&domain='+this.url_helper.getDomain();
	    	var container = $("#searchcontainer");
	    	//var frame = $('<iframe id="myFrame" name="myFrame" width="174" height="330" scrolling="no" frameborder="0" src="'+url+'">');
	    	//container.html(frame);
                if(id!=null){                    
                    socket = new easyXDM.Socket({
                            remote : url,
                            channel : "xyz2",
                            container : document.getElementById('searchcontainer'),
                            onMessage : function(data, origin) {
                                    data = JSON.parse(data);                                    
                                    if (typeof(data) !== undefined) {                             
                                       $("#searchcontainer").height(data.height);
                                       $("#searchcontainer iframe").height(data.height);
                                    }
                            },
                            onReady: function(){
                            }
                    });
                };
	    },
            setPointProfileTitle: function(config){
                if(config.id==0)
                    window.location = lang_title + '/error/index.html';

                var path = path_to_point_profile + "&id="+config.id + "&mode=" + config.mode +'&domain=' + this.url_helper.getDomain();
                var container = $("#container");
		        var socket = new easyXDM.Socket({
		            // Link to search form
		            remote : path,
		            channel : "profile",
		            container : document.getElementById('container'),
		            onMessage : function(data, origin) {
		                data = JSON.parse(data);
		                if (data.height) {
		                    window.top.$('#container > iframe:first-child').attr('height', data.height);
		                }else{
                                    window.top.$('#container > iframe:first-child').attr('height', 700);
                                }
                                window.top.$('#container > iframe:first-child').attr('width', 540);
		            },
		            onReady : function(){
			            
			            
			        }
		        });
	    	//var frame = $('<iframe id="myFrame" name="myFrame" width="540" height="700" scrolling="no" align="left" frameborder="0" src="'+path+'">');
	    	//frame.load(setHeight)
	    	//container.html(frame);
            },
	    createFrame: function(){}
	}
};

