// JavaScript Document
$(document).ready(function() {
	var theImages = "";
	$('#mainbkgimg img').each(function(i){// This section grabs the image paths for all images in the hidden div.
		theImages += ""+ $(this).attr('src') +",";
		});		
		var theLength = theImages.length-1;		
		var theImgs = theImages.substring(0, theLength);//This strips off the last comma in the list of image paths.		
		var theSplit = theImgs.split(",");//This turns each path into individual items and therefore preping it to be turned into an array. 

	
 var el = jQuery.makeArray(theSplit);// This turns the paths into an array so you can feed it into the randomImage plugin.	
  $("#shuffle").randomImage({
	  path: '',
	  myImages: el
	  });
});
