

$(document).ready(function() {
	
   

$('ul.sf-menu').superfish({ 
            delay:       1000,                            // one second delay on mouseout 
            animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
            speed:       'fast',                          // faster animation speed 
            autoArrows:  true,                           // disable generation of arrow mark-up 
            dropShadows: true,                            // disable drop shadows
            pathClass:     'currentitem',
            pathLevels:    0
             
        });
	
$('.snippet>div').hover(function() {
          
          //$(this).css("border", "3px solid #6fc0fe");
	      //$(this).css("padding", "7px");
	      //$(this).children().fadeIn('slow').css({'display': 'block', 'width': '276px', 'height': '75px', 'text-align': 'center', 'background': '#908f8f', 'color': '#ffffff', 'padding-top': '20px'});
	      //$(this).children().fadeIn('slow');
	      $(this).children().fadeIn('slow', 
	      function(){
          
		  } 
	      
	      );
	      //.css({'display': 'block', 'width': '276px', 'height': '75px', 'text-align': 'center', 'background': '#908f8f', 'color': '#ffffff', 'padding-top': '20px'});
	      

          //alert("hej");            
      }, function() {
      	$(this).children().fadeOut('slow')
          //$(this).css("border", "0px");
        //$(this).css("padding", "10px");

      });
        
 
$('.miniatyrer img').hover(function() {
          
          $(this).css("border", "3px solid #6fc0fe");
	      $(this).css("padding", "7px");

          //alert("hej");            
      }, function() {
          $(this).css("border", "0px");
        $(this).css("padding", "10px");

      });
      
$('.miniatyrer img').click(function(){
 	
    	
    	
 	
 	var test="/img/produkter/"+$(this).attr("alt");
 	var bilden=$(this);
 	 	if($(this).parents('.produktbild').children('.storbild').children('img').attr("src")==test)
 	 	
 	{
 		//alert('samma bild');
 	}
 	
 	else{
 		
 		var img = new Image();
  
  
  $(img).load(function () {
  	$(this).hide();
      
    
      
      bilden.parents('.produktbild').children('.storbild').children('img').remove();
      bilden.parents('.produktbild').children('.storbild').append(this);
        
    
      
      $(this).fadeIn(2000).css("margin", "0 auto");
    })
    
    
    .error(function () {
    
    })
    
    
    .attr('src', test);	
 	
 		
 	}
 	
 	

 	


 	
 	
 	
 	});

      
      

});




