/* Cycle Images */
function cycle() {
  $('.pics').cycle({
    pause: 1,
    timeout: 50000,
    random: 1 
  });
}

/* Preload Images */
function preloadImages() {
    for(var i = 0; i<arguments.length; i++)
    {
      jQuery("<img>").attr("src", arguments[i]);
    }
  }

function pause() {	
  $('#pause').css('display', 'block');
  
  if ($.browser.msie)
  {
  	$('#pause').css('-ms-filter', 'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)');
	$('#pause').css('filter', 'alpha(Opacity=0)');
	
  }
  else
  {
  	$('#pause').css('opacity', '0.0');
  }
  
  $('.pics').hover (
    function() {
	  $('#pause').stop().fadeTo('fast', 1.0);
	},
	function() {
	  $('#pause').stop().fadeTo('fast', 0.0);
	}
  );

  $('#pause').hover ( 
	function() {
      $(this).stop().fadeTo('fast', 1.0);
    },
    function() {
	  $(this).stop().fadeTo('fast', 1.0);
	}
  );
}

/* go */
$(document).ready(function() {
  	preloadImages("/_includes/images/home/noteworthy/dance4.jpg", "/_includes/images/home/noteworthy/autumncorridor.jpg", "/_includes/images/home/noteworthy/violin.jpg", "/_includes/images/home/noteworthy/fallart.jpg", "/_includes/images/home/noteworthy/fourgirls.jpg", "/_includes/images/home/noteworthy/leavesschaeffer.jpg", "/_includes/images/home/noteworthy/physics.jpg");
	cycle();
	pause();
});