$(document).ready(function(){
	

	///// SHOW LOADING IMAGE ON AJAX ACTIVITY ////////////////
	$('.ajax')
	    .hide()  // hide it initially
	    .ajaxStart(function() {
	        $(this).show();
	    })
	    .ajaxStop(function() {
	        $(this).delay(350).fadeOut();
	    });
    

	///// SLIDER 1,2,3 ////////////////////////////////////////

	$('#slider1').anythingSlider({
		easing: 'swing',
		autoPlay: true,
		delay: 3000,
        animationTime: 1000 	
	});
	
	$('#slider2').nivoSlider({
		directionNav:true, 
		directionNavHide:false 
	});

	$('#slider3').anythingSlider({
		easing: 'swing',
		autoPlay: true,
		delay: 3000,
        animationTime: 1000 	
	});
	
	
	/// wrap the #thumbNav div to create a flexible slider
	
	$('#thumbNav').wrap('<div id="thumbOuter" />');
	$('.nivo-controlNav').wrap('<div id="thumbOuter2" />');
	$('#thumbNav').show();
	
	$('#thumbOuter2').appendTo('#slider2wrapper');
	$('.nivo-directionNav').appendTo('#slider2wrapper');
	
	
	/// CURVY CORNERS ON IMAGES FOR FIREFOX //////////////////////////

 	   	$('#tabs img').bloooming_roundPic();
 	   	$('.content_left img').bloooming_roundPic();
 	   	$('.content_right img').bloooming_roundPic();


	/// TABS ////////////////////////////////////////////
	
	$(".tabcontent").hide(); 
	$("ul.tabs li:first").addClass("active").show(); 
	$(".tabcontent:first").show(); 


		//On Click Event
		$("ul.tabs li").click(function() {
	
			$("ul.tabs li").removeClass("active"); 
			$(this).addClass("active"); 
			$(".tabcontent").hide(); 
			var activeTab = $(this).find("a").attr("href"); 
			$(activeTab).show(); 
			return false;
		});
	
	$('.logo_small').click(function(){
   		 $('html, body').animate({scrollTop:0}, 'slow');
   		 return false;
	});
	
	
	/// CUFON ////////////////////////////////////////////
 
    Cufon.replace('h1');
	Cufon.replace('h2');
	Cufon.replace('h3');
	Cufon.replace('.price');
	Cufon.replace('.addCount');

	/// COLLAPSIBLE MENU //////////////////////////////////
	$(".productsmenu a.more").click(function(){
	
		if($(this).children('ul').is(':visible') == false) {
			$(this).next().slideToggle(300);
		}
		else {
		
		}
	});
	
	$('.productsmenu > li ul:first').show();	

	$('.content_right .littlegal li').bloooming_alternate(2);
	
	/// SHOP FUNCTIONS //////////////////////////////////

	$('.products').bloooming_shop();	


	/// GALLERIES FUNCTIONS //////////////////////////////////

	$('.zoom').colorbox({
		opacity:0.6
	});	
	

	$('.videozoom').colorbox({
		iframe:true, innerWidth:425, innerHeight:344,opacity:0.6
	});	
	
	$('.zoom').bloooming_picHover();
	$('.videozoom').bloooming_picHover();
	
	
	//// STRIPES for GENERAL CONTENT LAYOUT ////////////
	
	$('#generalcontent').append('<div id="stripes"></div>');
	


});
