﻿jQuery(function($){
	$.randombg = {
	        defaults: {
	            directory: "images_layout/front-headers/",
	            howmany: 3

	        }
	    }
	    $.fn.extend({
	        randombg:function(config) {
	            var config = $.extend({}, $.randombg.defaults, config);
	            return this.each(function() {
	                var directory = config.directory, howmany = config.howmany;
	                var which = Math.floor(Math.random()*howmany)+1;
	                $(this).css({"background" : "url(" +directory + '_FPO_imgFront-header-'+ which + ".jpg)"});

	            })
	        }
	    })
	
});
