jQuery.noConflict();

/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */
function mycarousel_initCallback1(carousel) {
    jQuery('.jcarousel-control1 a').bind('mouseenter', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        jQuery(this).bind('mouseleave', function() {
            carousel.scroll(jQuery.jcarousel.stop());
            return false;
        });
        return false;
    });
    

    jQuery('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });
};


function mycarousel_initCallback2(carousel) {

    
	jQuery('.jcarousel-control2 a').bind('click', function() {
	    carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
	    return false;
	});
 
};


jQuery(document).ready(function() {

	
	
	jQuery(".blog-index .postContent a:last").addClass('button');
	

			
	jQuery('.downloads td.glucosinolate, .block-teaser').not(":has('.issuu'), .block-news").hover(function() {
	    jQuery(this).addClass('hover');	
	}, function() {
	    jQuery(this).removeClass('hover');
	});
	
	jQuery('.category-products tbody tr').live("mouseenter", function() {
	    jQuery(this).addClass('hover');	
	}).live("mouseleave", function() {
	    jQuery(this).removeClass('hover');
	});
	
	jQuery(".downloads td, .block-teaser").not(":has('.issuu'), .block-news").click(function(){
			  window.location=jQuery(this).find("a").attr("href"); return false;
			});
	jQuery(".category-products tbody tr").live("click", function(){
			  window.location=jQuery(this).find("a").attr("href"); return false;
			});
	
	jQuery('#introCarousel').jcarousel({
	    auto: 0,
	    wrap: 'both',
	    scroll: 1,
	    initCallback: mycarousel_initCallback1,
	    // This tells jCarousel NOT to autobuild prev/next buttons
	    buttonNextHTML: null,
	    buttonPrevHTML: null,
	    size: 6,
	    animation: 'fast'
	});
	jQuery('#serviceCarousel').jcarousel({
	    auto: 0,
	    wrap: 'last',
	    scroll: 1,
	    initCallback: mycarousel_initCallback2,
	    // This tells jCarousel NOT to autobuild prev/next buttons
	    buttonNextHTML: null,
	    buttonPrevHTML: null,
	    size: 7
	});
	jQuery('.jcarousel-control1 a:first-child, .jcarousel-control2 a:first-child').addClass('active');
	jQuery('.jcarousel-control1 a').hover(function () {
		jQuery('.jcarousel-control1 a.active').removeClass('active');  
		jQuery(this).stop().addClass('active');
	});
	jQuery('.jcarousel-control2 a').click(function () {
		jQuery('.jcarousel-control2 a.active').removeClass('active');  
		jQuery(this).stop().addClass('active');
	});
	
	
	
	// animate #-Scrolling
	jQuery('.worldmap a, .toolbar .button').bind("click", function(event) {
		event.preventDefault();
		var ziel = jQuery(this).attr("href");

		jQuery('html,body').animate({
			scrollTop: jQuery(ziel).offset().top
		}, 1000 , function (){location.hash = ziel;});
	});
	return false;
	
	
	
	
	
	
    
    			
});

