/*
 * version 1
 * 29-10-2008
 */

(function($){

	$.fn.classRandomizer = function(options){

		
		var opts = $.fn.extend({}, $.fn.classRandomizer.defaults, options);
		var count = 1;
		
		return this.each(function(){
		
			var $this = $(this);			
			var random = Math.floor(Math.random() * (opts.total)) + 1;
			var classAttr = $this.attr("class");
			var pos = classAttr.search(opts.prefix);
						
			if(pos != -1){
				classAttr = classAttr.substring(0,pos);
				
			}
			//$this.attr("class",classAttr);
			
			$this.css("background-image", "url(images/" + opts.prefix + random + ".jpg)");
		});
	
	};//hoverMenu
		
  $.fn.classRandomizer.defaults = {
		prefix : "",
		total  : 0
  };//defaults

	
})(jQuery);

