jQuery.noConflict();

function mycarousel_initCallback(carousel){
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function(){
        carousel.startAuto(0);
    });
    
    carousel.buttonPrev.bind('click', function(){
        carousel.startAuto(0);
    });
    
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function(){
        carousel.stopAuto();
    }, function(){
        carousel.startAuto();
    });
}


(function($){
    $(document).ready(function(){
      
    	$('#allDescription,a[rel="fancybox"]').fancybox({
    		'autoDimensions': false,
            'padding': 20,
            'centerOnScroll': true,
            'width': 500
        });
  
    	
        $('.press li a[rel="fancybox"]').fancybox({
        	 'overlayShow': false,
             'hideOnContentClick': true,
             'imageScale': false,
             'centerOnScroll': true,
             'width':800,
             'height': 600,
             'scrolling':'yes'
        });
        
        
       $('#mainSlideshow').cycle({
    	   timeout: 3000
    	   //pause:   1 
       });
       
       $('#secSlideshow').cycle({
    	   timeout: 3000
    	   //pause:   1 
       });
       
       
       
	 $('#newsletter-validate-detail #newsletter').focus(function(){
	        if (jQuery(this).val() == this.defaultValue) {
	            jQuery(this).val('');
	        }
	    });  
      
	    //multiple product views carousel
	   $('#moreViewes').jcarousel({
	        auto: 1,
	        wrap: 'last',
	        scroll: 1,
			vertical: true,
	        initCallback: mycarousel_initCallback
	    });
  
	   $('.prod-detail-options .head a').click(function(){
	        if ($(this).attr('href') == '#') {
	            $(this).parent($('.content')).next().toggle();
	            return false;
	        }
	    });

	
	   $('#tweets').tweets({
		   username: 'dptlingerie',
		   timestamp: false,
		   cycle: true
		   }); 
	   
	   
	  
	  $('.slider').advancedSlider({
		  width: 920,
		  height: 634,
		  thumbnailsType:'navigation', 
		  thumbnailWidth: 133,
		  thumbnailHeight: 100,
		  visibleThumbnails: 6,
		  navigationButtons:false,
		  thumbnailButtons:false,
		  navigationArrows: false,
		  slideshowControls: false,
		  pauseSlideshowOnHover: true
	  });
	  $('.slider-ss10').advancedSlider({
		  width: 920,
		  height: 900,
		  thumbnailsType:'navigation', 
		  thumbnailWidth: 133,
		  thumbnailHeight: 100,
		  visibleThumbnails: 6,
		  navigationButtons:false,
		  thumbnailButtons:false,
		  navigationArrows: false,
		  slideshowControls: false,
		  pauseSlideshowOnHover: true
	  });
	  $('.slider-ss10').advancedSlider({
		  width: 920,
		  height: 800,
		  thumbnailsType:'navigation', 
		  thumbnailWidth: 133,
		  thumbnailHeight: 100,
		  visibleThumbnails: 6,
		  navigationButtons:false,
		  thumbnailButtons:false,
		  navigationArrows: false,
		  slideshowControls: false,
		  pauseSlideshowOnHover: true
	  });
	
	//hack for out of stock products
	$('#product-options-wrapper option').each(function(){
		if($(this).attr('disabled')) {
			$(this).text($(this).text() + ' - Out of stock');
		}		
	});
    });
})(jQuery);

