// JavaScript Document

/* Katlistenintro verschieben */

jQuery(document).ready(function(){
	jQuery('#content>#kliste1').appendTo( jQuery('#kliste2') );
        })
		
/* Tabs */
jQuery(document).ready(function(){
            jQuery(".tabs").accessibleTabs({
                tabhead:'h3.tabkopf',
				fx:"show",
                fxspeed:null,
				autoAnchor:true
            });
        })
	
/* Runde Ecken bei Bildern */

jQuery(function(jQuery) {
				jQuery('.produktbild img, #bildervorschau img').wrap(function() {
					return '<span style="background-image:url(' + jQuery(this).attr('src') + '); background-repeat: no-repeat; background-position: center center;" class="rounded" />';
				});
			});
			
/* img center */

(function ($) {
$.fn.vAlign = function() {
	return this.each(function(i){
        $(this).children().wrapAll('<div class="nitinh-vAlign" style="position:relative;"></div>');
        var div = $(this).children('div.nitinh-vAlign');
        var ph = $(this).innerHeight();
        var dh = div.height();
        var mh = (ph - dh) / 2;
        div.css('top', mh);
	});
};
})(jQuery); 

$(window).load(function(){$("a.katlistenbild, a.artikelhauptbild").vAlign()});

/* Toggle Detailsuche */

jQuery(document).ready(function(){

	//Hide (Collapse) the toggle containers on load
	jQuery(".detailsuche").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	jQuery("a#toggle").click(function(){
		jQuery(this).toggleClass("active").next(".detailsuche").slideToggle("slow");
		return false; //Prevent the browser jump to the link anchor
	});

});

// Tabelle mit wechselnden HG-Farben - jQuery

jQuery(document).ready(function(){
   jQuery(".artikelbeschreibung tr").mouseover(function(){jQuery(this).addClass("over");}).mouseout(function(){jQuery(this).removeClass("over");});
   jQuery(".artikelbeschreibung tr:odd").addClass("alternate");
});


jQuery(document).ready(function(){
   jQuery(".artikelbeschreibung td").mouseover(function(){jQuery(this).addClass("over");}).mouseout(function(){jQuery(this).removeClass("over");});
   jQuery(".artikelbeschreibung td:odd").addClass("wert");
});

jQuery(document).ready(function(){
	jQuery("a.zeigebutton").click(function () {
	jQuery(".zeigetext").toggle("slow");
});    
});

