jQuery.fn.extend({captify:function(a){ var a=$.extend({speedOver:"fast",speedOut:"normal",hideDelay:500,animation:"slide",prefix:"",opacity:"0.35",className:"caption-bottom",position:"bottom",spanWidth:"100%"},a);
													 $(this).each(function(){
												       var b=this;$(this).load(function(){
														 $this=b;if(this.hasInit){return false}this.hasInit=true;var d=false;var m=false;var g=$("#"+$(this).attr("rel"));var f=!g.length?$(this).attr("alt"):g.html();g.remove();var h=this.parent&&this.parent.tagName=="a"?this.parent:$(this);var c=h.wrap("<div></div>").parent();c.css({overflow:"hidden",padding:0,fontSize:0.1});c.addClass("caption-wrapper");c.width($(this).width());c.height($(this).height());$.map(["top","right","bottom","left"],function(p){c.css("margin-"+p,$(b).css("margin-"+p));$.map(["style","width","color"],function(q){var r="border-"+p+"-"+q;c.css(r,$(b).css(r))})});$(b).css({border:"0 none"});var o=$("div:last",c.append("<div></div>")).addClass(a.className);var l=$("div:last",c.append("<div></div>")).addClass(a.className).append(a.prefix).append(f);$("*",c).css({margin:0}).show();var j=jQuery.browser.msie?"static":"relative";o.css({zIndex:1,position:j,opacity:a.animation=="fade"?0:a.opacity,width:a.spanWidth});if(a.position=="bottom"){var k=parseInt(o.css("border-top-width").replace("px",""))+parseInt(l.css("padding-top").replace("px",""))-1;l.css("paddingTop",k)}l.css({position:j,zIndex:2,background:"none",border:"0 none",opacity:a.animation=="fade"?0:1,width:a.spanWidth});o.width(l.outerWidth());o.height(l.height());var n=(a.position=="bottom"&&jQuery.browser.msie)?-4:0;var i=(a.position=="top")?{hide:-$(b).height()-o.outerHeight()-1,show:-$(b).height()}:{hide:0,show:-o.outerHeight()+n};l.css("marginTop",-o.outerHeight());o.css("marginTop",i[a.animation=="fade"||a.animation=="always-on"?"show":"hide"]);var e=function(){if(!d&&!m){var p=a.animation=="fade"?{opacity:0}:{marginTop:i.hide};o.animate(p,a.speedOut);if(a.animation=="fade"){l.animate({opacity:0},a.speedOver)}}};if(a.animation!="always-on"){$(this).hover(function(){m=true;if(!d){var p=a.animation=="fade"?{opacity:a.opacity}:{marginTop:i.show};o.animate(p,a.speedOver);if(a.animation=="fade"){l.animate({opacity:1},a.speedOver/2)}}},function(){m=false;window.setTimeout(e,a.hideDelay)});$("div",c).hover(function(){d=true},function(){d=false;window.setTimeout(e,a.hideDelay)})}});if(this.complete||this.naturalWidth>0){$(b).trigger("load")}})}});



 $(function() {
			/*
        $('#shopping_tab a img').click(function() {
			//clearInterval(document.x);
			//alert($(this).parent().attr("rel"));
			$(document.tab).attr('src','images/home/'+$(document.tab).parent().attr("rel")+'.png' );
			$("#"+$(document.tab).parent().attr("slider")).hide();
			//$(("#shopping_tab li#tab2 a img").parent().attr("slider")).css("display", "none");
			
			var last = $(this).parent().attr("rel");
			$(this).attr('src','images/home/'+last+'_on.png' );
			//alert($("#shopping_tab li#tab2 a img").parent().attr("slider"));
			
			//$("#"+$(this).parent().attr("slider")).show();
			//alert("#"+$(this).parent().attr("slider"));
			
			$("#"+$(this).parent().attr("slider")).fadeIn('slow',function(){});
			
			//$("#"+$(this).parent().attr("slider")).css("display", "block");
			document.tab = $(this);
			//alert($("#"+$(document.tab).parent().attr("slider")+'li a img'))
			
			$("#"+$(document.tab).parent().attr("slider") +' a img').mouseover(function() {
			clearInterval(document.x);

	        });
			
			$("#"+$(document.tab).parent().attr("slider") +' a img').mouseout(function() {
			clearInterval(document.x);
			document.x = setInterval("$('.next').trigger('click');",6000);

	        });
			
			
		});
		*/
		$('.prev').mouseover(function() {
			 clearInterval(document.x);

		});
		$('.next').mouseover(function() {
			clearInterval(document.x);

		});
		$('.prev').mouseout(function() {
			clearInterval(document.x);
			 document.x = setInterval("$('.next').trigger('click');",6000);

		});
		$('.next').mouseout(function() {
			clearInterval(document.x);
			document.x = setInterval("$('.next').trigger('click');",6000);

		});
		
		
});
 
 
 $(document).ready(function() {
    document.tab = $('#shopping_tab li#tab1 a img');
	//var tab = $('#shopping_tab li#tab1 a img').trigger("click");
	document.x = setInterval("$('.next').trigger('click');",6000);
	$("#best_seller").jCarouselLite({
				//auto: 3,
                speed: 500,
        		btnNext: ".next",
        		btnPrev: ".prev",
        		visible: 5,
				scroll: 1,
				start:0
				
    		});
  $("#new_arrivals").jCarouselLite({
				//auto: 3,
                speed: 2000,
        		btnNext: ".next",
        		btnPrev: ".prev",
        		visible: 5,
				scroll: 5,
				start:0
			//	circular: true
				//initCallback: mycarousel_initCallback()
				
    		});
	$("#hot_offers").jCarouselLite({
				//auto: 3,
                speed: 2000,
        		btnNext: ".next",
        		btnPrev: ".prev",
        		visible: 5,
				scroll: 5,
				start:0
				/*
				 beforeStart: function(a) {
                      //alert("Before animation starts:" + a);
                },
                  afterEnd: function(a) {
                     //alert("After animation ends:" + a);
                }
             */
			
				
    		});
		
			function mycarousel_initCallback(){
			// carousel1.stopAuto();
			 /*
              carousel.clip.hover(function() {
		
              carousel.stopAuto();
              }, function() {
                 carousel.startAuto();
                 });
			  */
            };
			
			$('img.captify').captify({
				// all of these options are... optional
				// ---
				// speed of the mouseover effect
				speedOver: 'fast',
				// speed of the mouseout effect
				speedOut: 'normal',
				// how long to delay the hiding of the caption after mouseout (ms)
				hideDelay: 300,	
				// 'fade', 'slide', 'always-on'
				animation: 'slide',		
				// text/html to be placed at the beginning of every caption
				prefix: '',		
				// opacity of the caption on mouse over
				opacity: '0.7',					
				// the name of the CSS class to apply to the caption box
				className: 'caption-bottom',	
				// position of the caption (top or bottom)
				position: 'bottom',
				// caption span % of the image
				spanWidth: '100%'
			});
			
			$("#new_arrivals").hide();
			$("#hot_offers").hide();
			
});





 
 

