// JavaScript Document

jQuery.fn.fadeToggle = function(speed, easing, callback) { 
   return this.animate({opacity: 'toggle'}, speed, easing, callback); 
};

jQuery.preloadImages = function(){
  for(var i = 0; i<arguments.length; i++){
    jQuery("<img>").attr("src", arguments[i]);
  }
}


jQuery.preloadAndReplace = function(array, showSpeed){
	
	var _images = [array];
	alert(_images);
	
	$.each(_images,function(e) {
		$(new Image()).load(function() {
		var tgtIm = $("img[title='"+$(this).attr('src')+"']");
		alert($(this).attr('src') + 'has loaded!');
		$(tgtIm).hide();
		$(tgtIm).attr("src",$(this).attr('src'));
		$(tgtIm).attr("title","");
		$(tgtIm).show(400);
		
		}).attr('src',this);
	});
	
}