(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)

jQuery.fn.customShow = function() {
	return this.each(function() {
		if( jQuery.support.opacity) {
			jQuery(this).show("drop", { direction: "up" }, 300);
		} else {
			jQuery(this).show();
		}
	});
}

jQuery.fn.customHide = function() {
	return this.each(function() {
		if( jQuery.support.opacity) {
			jQuery(this).hide("drop", { direction: "up" }, 300);
		} else {
			jQuery(this).hide();
		}
	});
}



jQuery(document).ready(function() {
//------------------------------------------------//

	// Bildpreloader
	jQuery.preLoadImages("/fileadmin/template/media/ajax_loading.gif");
	
	// Hauptsitze
	jQuery('div.container_box').hide();
	jQuery('div.container h3').addClass("ausklapper");
	 
	jQuery('div.container h3').toggle( function() {
		jQuery(this).removeClass("ausklapper").addClass("einklapper");
		jQuery(this).parent().children('div').customShow();
	}, function() {
		jQuery(this).removeClass("einklapper").addClass("ausklapper");
		jQuery(this).parent().children('div').customHide();
	});
	
	jQuery("table.zebra tr:nth-child(odd)").addClass("farbe");
	
//------------------------------------------------//
});
