function DealerFilter(){
	
    this.init = function(){
    	(function($) {
    	})(jQuery);
    }

    
    this.doSelect = function(value) {
    	(function($) {
    		
    		if(value == "all") {
    			$('.country').slideDown("slow");
    			$('.postcode').slideDown("slow");
    		}
    		else {
	    		var tmp = value.split('_');
	    		
	    		$.each(tmp, function(k, v) { 
	    			var filter = v.split('-');

	    			if(filter[0] == "country") {
	    				if(tmp.length == 1)
	    	    			$('.postcode').slideDown("fast");
	    	    			
	    					
		    			//Hide Other Countries
	    				$('.country').each(function(k, v) {
	    					if($(v).attr('id') != "country-" + filter[1])
	    						$(v).slideUp("slow");
	    	    		});
	    	    		
		    			
		    			//Show Current Country
		    			$('#country-'+filter[1]).slideDown("slow");
	    			}
	    			
	    			if(filter[0] == "postcode") {
		    			//Hide Other Postcodes
	    				$('.postcode').each(function(k, v) {
	    					if($(v).attr('id') != "postcode-" + filter[1])
	    						$(v).slideUp("slow");
	    	    		});
	    	    		
		    			
		    			//Show Current Country
		    			$('#postcode-'+filter[1]).slideDown("slow");
	    			}
	    			
	    		});
    		}
    		
    	})(jQuery);
    }
  
    
    var self = this;
}

var dealerFilter = new DealerFilter();

(function($) {
	
	$(document).ready(function(){
		
	});

})(jQuery);
	
