/*  Author: VC3
	Date Modified:
*/

(function($){
	
	$.randomImage = {
		defaults: {
			
			//you can change these defaults to your own preferences.
			path: '/Style%20Library/vc3/images/', //change this to the path of your images
			myImages: ['webDesignSample1.png', 'mascHome.jpg', 'scacHome.jpg'] 
			
		}			
	}
	
	$.fn.extend({
			randomImage:function(config) {
				
				var config = $.extend({}, $.randomImage.defaults, config); 
				
				 return this.each(function() {
						
						var imageNames = config.myImages;
						
						//get size of array, randomize a number from this
						// use this number as the array index

						var imageNamesSize = imageNames.length;

						var lotteryNumber = Math.floor(Math.random()*imageNamesSize);

						var winnerImage = imageNames[lotteryNumber];

						var fullPath = config.path + winnerImage;
						
						
						//put this image into DOM at class of randomImage
						// alt tag will be image filename.
						$(this).attr( {
										src: fullPath,
										alt: winnerImage
									});
				
						
				});	
			}
			
	});
	
	
	
})(jQuery);

$(document).ready(function(){
	$('input[type=submit]').wrap('<span class="buttonWrapper"></span>');
	$('var').html(new Date().getFullYear());
	$('#vc3').click(function(){
		window.location='/';
	});
	$("header nav ul").superfish({hoverClass:'selected',autoArrows:false,animation:{height:'show'}}); 

	$('#testimonials').cycle({ 
		timeout: 5000, 
		pager:  '#testimonialPager', 
		// callback fn that creates a thumbnail to use as pager anchor 
		pagerAnchorBuilder: function(idx, slide) { 
			return '<a href="#">&#9679;</a> '; 
		} 
	});
	 $('#products').cycle({
			timeout: 5000
		});
	$('#billboard').cycle({
		timeout: 7000
	});
	$('.shuffle').randomImage();

});


