(function($) {
	$.fn.customFadeIn = function(speed, callback) {
		$(this).fadeIn(speed, function() {
			if(jQuery.browser.msie)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
	$.fn.customFadeOut = function(speed, callback) {
		$(this).fadeOut(speed, function() {
			if(jQuery.browser.msie)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
})(jQuery);


var numImages = 3;
var currentImage = 1;
$(document).ready(function() {
  $("#img1_en").css("display", "block");
  var imageInterval = setInterval("switchBild()", 3000);
});



function switchBild()
  { 
    $("#img" + currentImage + "_en").customFadeOut("normal", function() {
      if (currentImage >= numImages)
      {
              currentImage = 0;
      }
      $("#img" + (currentImage + 1) + "_en" ).customFadeIn("normal", function() {
              currentImage++;
      });
    });   
  }
