(function($){
	$.fn.dropdown = function(params){
		
		var init = function (obj) {
			obj.find('div').css('height', Math.round(obj.height()/2)*2 + 'px').corner('tr br 15px');
			obj.find('a:first').click(function () {
				if (obj.find('ul').css('display') != 'block') {
					obj.parent().find('ul').hide();
					obj.find('ul').show();
					obj.parent().find('li:has(ul)').each(function(){
						//$(this).find('div').uncorner();
						$(this).find('div:first').css('height', Math.round($(this).height()/2)*2 + 'px');
						//$(this).find('div').corner('tr br 15px');
					});
					return false;
				}
			});
		}
		
		return this.find('li:has(ul)').each(function(){
			init($(this));
		});
	};
})(jQuery)