jQuery(document).ready(function() {
	/* Controls Carousel */
    jQuery('#kiaCarousel').jcarousel();
    jQuery('#suzukiCarousel').jcarousel();
    /* Controls Hover */
    $("#kiaCarousel img, #suzukiCarousel img").hover(
 		function()
 			{
 				 this.src = this.src.replace("-off","-on");
 			},
 		function()
 			{
  				this.src = this.src.replace("-on","-off");
 			}
		);
	});
	
	//give each column in the row a class of row1
	$(document).ready(function(){
	    	$(function(){
	    	    $('.row1').equalHeight();
	   	});
	    });
	
	
	// make sure the $ is pointing to JQuery and not some other library
	
	(function($){
	// add a new method to JQuery
	$.fn.equalHeight = function() {
	// find the tallest height in the collection
	// that was passed in (.column)
	tallest = 0;
	this.each(function(){
	thisHeight = $(this).height();
	if( thisHeight > tallest)
	tallest = thisHeight;
	});
	
	// set each items height to use the tallest value found
	this.each(function(){
	$(this).height(tallest);
	});
	}
	})(jQuery);
	
	
	//Controls Random Images
$(document).ready(function(){
	header=4;
	randomNumberHeader = Math.round(Math.random()*(header-1))+1;
	imgPathHeader=('/img/site/home-header-'+randomNumberHeader+'.jpg');
	$('#rotate').css('background-image', ('url("'+imgPathHeader+'")'));
})

$(document).ready(function() {
	$('#printButton').click(function() { window.print(); });
});
