/**
 * Robert Baumann JS
 * @author Kyle Robinson Young <kyle at epiphanet.com>
 * 
 */
(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)
$(function() {
	jQuery.preLoadImages("text_fade_shelter.gif", "/img/text_fade_shelter.gif");
	jQuery.preLoadImages("text_fade_imagination.gif", "/img/text_fade_imagination.gif");
	jQuery.preLoadImages("text_fade_joy.gif.gif", "/img/text_fade_joy.gif");
	var delay = 500;
	$('.text-fade').each(function() {
		$(this).hide().delay(delay).fadeIn(3000);
		delay += 2000;
	});
	$('.slideshow').cycle({
		next: '#control-next',
		prev: '#control-prev',
		pause: 1
	});
	$('#control-stop').click(function() {
		$('.slideshow').cycle('pause');
		return false;
	});
	$('.slideshow-controls a').click(function() {
		$(this).effect('bounce', {times:1}, 200);
		return false;
	});
	$('a[rel=external]').attr('target','_blank');
});
