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

$(window).bind('load', function() {
$.preloadImages("http://denkingredients.de/templates/denk/img/submenu_arrow.png");
});

$(document).ready(function(){
	 
  // Breiten für Hauptmenü
  var widths = new Array(71,157,115,125,129,72);
  $("#menu li").each(function(index){
	  $(this).css("width",widths[index]);
  });
  
  // Austausch des ersten und letzten Hauptmenüpunktes mit einem Symbol
  var firstmenuitem = $("#menu li:first-child a");
  var lastmenuitem = $("#menu li:last-child a");
  
  firstmenuitem.html("<img src='http://denkingredients.de/templates/denk/img/symbol_start.png' alt='' width='22px' height='16px' />");
  lastmenuitem.html("<img src='http://denkingredients.de/templates/denk/img/symbol_contact.png' alt='' width='21px' height='17px' />");
  
  // Produktseiten
  var items = $("#products img");
  $(items).filter(":lt(6)").css("margin-bottom","7px");
  $(items).slice(0,5).css("margin-right","7px").end().slice(6,11).css("margin-right","7px");
  
  $(".partner a img, .row img").hover(function(){
	                     $(this).everyTime(10,function(){$(this).animate({opacity:0.6},200).animate({opacity:1},200);
					     });
                     },function(){
						 $(this).stop(true).stopTime().animate({opacity:1},200);
					 });
	  
/*  if($(items).hasClass("active"))
  {
	 $(items).not(".active").fadeTo(0,0.5);
	 $(items).hover(function(){
		$(this).stop(true).fadeTo(300,1);
		 },function(){
		$(this).not(".active").stop(true).fadeTo(300,0.5);
	 });
  }
  else
  {
	 $(items).hover(function(){
		$(items).not(this).stop(true).fadeTo(300,0.5);
		},function(){
		$(items).not(this).stop(true).fadeTo(0,1);
	 });
  } */
  
  $('.tabs').smoothTabs(200);
  
  $(".tabs table p").each(function(){
	  var text = $(this).text();
	  var laenge = $(this).text().length;
	  if(laenge > 1) {
		switch (text) {
		  case "Deutsche Bezeichnung":
			break;
		  case "Botanische Bezeichnung":
			break;
		  default:
			$(this).prepend("<img alt='' src='http://denkingredients.de/media/pics/arrow.png' style='width: 5px; height: 11px;' /> ");
		}
	  }
	  });
  
});
