jQuery(document).ready(function() {
    // Initialise the first and second carousel by class selector.
	// Note that they use both the same configuration options (none in this case).
	jQuery('.first-and-second-carousel').jcarousel();
	
	// If you want to use a caoursel with different configuration options,
	// you have to initialise it seperately.
	// We do it by an id selector here.
	jQuery('#homevert-carousel').jcarousel({
        vertical: true
    });
	jQuery('#prod_dtl-carousel').jcarousel({
        vertical: true
    });	
});

//fader
	  $(function() {
   var $sequence = $('[class$=fader]').hide(), div = 0;
   (function(){
       $($sequence[div++]).fadeIn('fast', arguments.callee);
   })();
}); 
//fancybox	
		$(document).ready(function() {
			$("a[rel=quick_buy_v]").fancybox({
				'width'				: 480,
				'height'			: 530,
				'padding'			: 0,
				'margin' 			: 0,
				'scrolling'			: 'no',
				'autoScale'			: 'false',
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'type'				: 'iframe'

			});
			$("a[rel=quick_buy]").fancybox({
				'width'				: 480,
				'height'			: 530,
				'padding'			: 0,
				'margin' 			: 0,
				'scrolling'			: 'no',
				'autoScale'			: 'false',
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'type'				: 'iframe'

			});			
			$("a[rel=swatch]").fancybox({
				'titleShow'		: true,
				'titlePosition'	: 'over',	// 'outside', 'inside' or 'over'
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic',
				'speedIn'		:  300,
				'speedOut'		:  300,
				'easingIn'		:  'swing',
				'easingOut'		:  'swing',
				'autoScale'		:	true,
				'autoDimensions':	true,
				'centerOnScroll':	false
			});
			
			$("a[rel=betsey]").fancybox({
                'width'             : 640,
                'height'            : 640,
                'scrolling'         : 'no',
                'autoScale'         : 'false',
                'transitionIn'      : 'elastic',
                'transitionOut'     : 'elastic',
                'type'              : 'iframe'

			});
			
			$("a[rel=nyfno]").fancybox({
				'titleShow'		: true,
				'titlePosition'	: 'over',	// 'outside', 'inside' or 'over'
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic',
				'speedIn'		:  300,
				'speedOut'		:  300,
				'easingIn'		:  'swing',
				'easingOut'		:  'swing',
				'autoScale'		:	true,
				'autoDimensions':	true,
				'centerOnScroll':	false
			});
			
			$("a[rel=lafno]").fancybox({
				'titleShow'		: true,
				'titlePosition'	: 'over',	// 'outside', 'inside' or 'over'
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic',
				'speedIn'		:  300,
				'speedOut'		:  300,
				'easingIn'		:  'swing',
				'easingOut'		:  'swing',
				'autoScale'		:	true,
				'autoDimensions':	true,
				'centerOnScroll':	false
			});
			
			$("a[rel=ASI]").fancybox({
				'titleShow'		: true,
				'titlePosition'	: 'over',	// 'outside', 'inside' or 'over'
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic',
				'speedIn'		:  300,
				'speedOut'		:  300,
				'easingIn'		:  'swing',
				'easingOut'		:  'swing',
				'autoScale'		:	false,
				'autoDimensions':	true,
				'centerOnScroll':	false
			});			
			$("a#example1").fancybox({
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic',
				'speedIn'		:  300,
				'speedOut'		:  300,
				'easingIn'		:  'swing',
				'easingOut'		:  'swing',
				'autoScale'		:	true,
				'autoDimensions':	true,
				'centerOnScroll':	false
			});
			
            $("a[rel=video]").fancybox({
                'width'             : 640,
                'height'            : 360,
                'scrolling'         : 'no',
                'autoScale'         : 'false',
                'transitionIn'      : 'elastic',
                'transitionOut'     : 'elastic',
                'type'              : 'iframe'

            }); 
			
			
			$("a[rel=daysofgiving]").fancybox({
				'width'				: 500,
				'height'			: 560,
				'padding'			: 0,
				'margin' 			: 0,
				'scrolling'			: 'false',
				'autoScale'			: 'false',
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'type'				: 'iframe'

			});
			
		});

			function display (content) {
			$.fancybox({
			'href': content,
			'titleShow'		: true,
			'titlePosition'	: 'over',	// 'outside', 'inside' or 'over'
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic',
			'autoScale'		: 'false'
			
			 });
			}
			
			
			function openShadowbox (content,type,title,w,h) {
			$.fancybox({
			'href': content,
			'width'				: w,
			'height'			: h,
			'titleShow'		: true,
			'titlePosition'	: 'over',	// 'outside', 'inside' or 'over'
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic',
			'autoScale'		: 'false',
			'type'			: type
			
			 });
			}
			
			
//nice tooltip style for title attributes	& open offsite links in new window	
    $(document).ready(function(){
	    $("[class=nTooltip]").niceTitle({showLink: false});
		$("a").filter(function() {  // offsite links detection
     return this.hostname && this.hostname !== location.hostname;  

 }).attr('target', '_blank'); 

    });			
//smooth scroll to anchor
//$(function(){
//    $('a[href*=#]').click(function() {    
//    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
//        && location.hostname == this.hostname) {        
//            var $target = $(this.hash);            
//            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');            
//            if ($target.length) {            
//                var targetOffset = $target.offset().top;                
//                $('html,body').animate({scrollTop: targetOffset}, 1000);                   
//                return false;                
//            }            
//        }        
//    });    
//});

///carousel
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel();
});
//<![CDATA[
    $(document).ready(function() {
      function addMega(){
        $(this).addClass("hovering");
        }
      function removeMega(){
        $(this).removeClass("hovering");
        }
    var megaConfig = {
         interval: 100,
         sensitivity: 4,
         over: addMega,
         timeout: 300,
         out: removeMega
    };
    $("li.mega").hoverIntent(megaConfig)      
    });
    //]]>
	

