/**
 * addRandomClass plugin
 *
 * Copyright (c) 2009 Jamie Thompson (jamazon.co.uk)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Adds a random class to each matched element, taken from an array
 * default classes are .one, .two, .three, .four and .five (imaginayshun i haz one!)
 *
 * @example $('#element').addRandomClass();
 * @desc adds a random class to the element with an id of 'element'
 * @example $('#element').addRandomClass({classes: ['bert','ernie','big_bird']});
 * @desc overried the default classes with an array brought to you by the children's television workshop
 */



(function($) {
	$.fn.addRandomClass = function(options) {
		var opts = $.extend({}, $.fn.addRandomClass.defaults, options);
		return this.each(function() {
			$this = $(this);
			var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
			$this.addClass(o.classes[Math.floor(Math.random() * o.classes.length)]);	
		});
	};
	$.fn.addRandomClass.defaults = {
		classes: ['sn1','sn2','sn3','sn4']
	};
})(jQuery);
