$(document).ready(function() {
    /*$('#slideshow').orbit({
		animation: 'fade',                  // fade, horizontal-slide, vertical-slide, horizontal-push
		animationSpeed: 800,                // how fast animtions are
		timer: true, 			 // true or false to have the timer
		advanceSpeed: 8000, 		 // if timer is enabled, time between transitions 
		pauseOnHover: false, 		 // if you hover pauses the slider
		startClockOnMouseOut: false, 	 // if clock should start on MouseOut
		startClockOnMouseOutAfter: 1000, 	 // how long after MouseOut should the timer start again
		directionalNav: false, 		 // manual advancing directional navs
		captions: false, 			 // do you want captions?
		captionAnimation: 'fade', 		 // fade, slideOpen, none
		captionAnimationSpeed: 800, 	 // if so how quickly should they animate in
		bullets: false,			 // true or false to activate the bullet navigation
		bulletThumbs: false,		 // thumbnails for the bullets
		bulletThumbLocation: '',		 // location from this file where thumbs will be
	});*/
    $('#nav-toggle').click(function(){
        $("#main-nav ul").toggle();
    });
    
     $('.flexslider').flexslider({
          animation: "slide",
          directionNav: false,
          controlNav: true,
          pauseOnHover: true
     });
     if($('.jqzoom'))
     {
        $('.jqzoom').jqzoom({
             zoomType: 'standard',
             lens:true,
             preloadImages: true,
             alwaysOn:false,
             position:'center',
             title: false,
             preloadText: 'Laddar bild…',
             zoomWidth: 424,
             zoomHeight: 450,
             xOffset: 5,
             yOffset: 20,
             showEffect: 'fadein',
             hideEffect: 'fadeout',
             fadeinSpeed: 300,
             fadeoutSpeed: 300
        });
      }

     $('#product_form').submit(function() {
          options = { to: "#cart", className: "ui-effects-transfer" };
          $( "#image" ).effect( 'transfer', options, 500 );
         var url = $(this).attr('action');
         var data = $(this).serialize();
         $.post(url, data, function() {
             $('#cart').load('/webshop/cart');

         });
         return false;
     });

});

