(function($) {
 
jQuery.fn.addOptions = function(elements)
{
	return this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return;
			obj = $(this);
			$.each(elements, function(val, text) {
				obj.append(
					$('<option></option>').val(val).html(text)
				);
			});
		}
	);
};

jQuery.fn.exists = function()
{
	return ($(this).length > 0);
}

})(jQuery);
