/*
  
  Home page - hero image rotation

  requires jquery.innerfade.js
  
  Preload and add images dynamically instead of innerfade's default method
  of using elements in the markup to avoid excessive home page load time.

*/
jQuery(window).load(function(){
	
	if(!jQuery("#hero").length) return;

	var images = new Array(
		'images/kei_mouth/kei-hero-2.jpg', 
	    'images/kei_mouth/kei-hero-3.jpg',
		'images/kei_mouth/kei-hero-4.jpg',
		'images/kei_mouth/kei-hero-5.jpg',
		'images/kei_mouth/kei-hero-6.jpg'
	);
				
	for(var i = 0; i<images.length; i++){
		var img = jQuery("<img>").attr("src", images[i]);
		jQuery('#hero').append(img);
	}

	jQuery("#hero").innerfade({
		speed: 2000,
		timeout: 4000,
		type: 'sequence',
		containerheight: '450px'
	});
});
