$(function(){ 
		   
		   
	  $(window).load(function() {
       $('#slider').nivoSlider({
        effect:'sliceDownLeft,sliceUpDown,sliceUpDownLeft', // Specify sets like: 'fold,fade,sliceDown'
        slices:7, // For slice animations
        boxCols: 5, // For box animations
        boxRows: 3, // For box animations
        animSpeed:500, // Slide transition speed
        pauseTime:5500, // How long each slide will show
        startSlide:0, // Set starting Slide (0 index)
        directionNav:false, // Next & Prev navigation
        directionNavHide:false, // Only show on hover
        controlNav:false, // 1,2,3... navigation
        controlNavThumbs:false, // Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, // Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', // Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
        keyboardNav:false, // Use left & right arrows
        pauseOnHover:true, // Stop animation while hovering
        manualAdvance:false, // Force manual transitions
        captionOpacity:0.8, // Universal caption opacity
        prevText: '', // Prev directionNav text
        nextText: '', // Next directionNav text
        beforeChange: function(){}, // Triggers before a slide transition
        afterChange: function(){}, // Triggers after a slide transition
        slideshowEnd: function(){}, // Triggers after all slides have been shown
        lastSlide: function(){}, // Triggers when last slide is shown
        afterLoad: function(){} // Triggers when slider has loaded
   		 });
	 });



		   
		   
	
 $('#takeAlookNav').hide();
	$('#takeAlook').hover(
	function () {
		$('#takeAlookNav').slideDown('normal');
		$('#takealookBTN').addClass("sel")
	}, 
	function () {
	$("#takeAlookNav").fadeOut("fast");
	$('#takealookBTN').removeClass("sel")
	});

	


 	$('#navStrategy').hover(
	function () {
		$('.navPanelStrategy').slideDown('normal', function() { $(this).css("height", "331px");});
		$('.strategy').addClass("sel");
	}, 
	function () {
	$(".navPanelStrategy").stop().slideUp("fast", function() { $(this).css("height", "331px");});
	$('.strategy').removeClass("sel")
	});
	
	$('#navDev').hover(
	function () {
		$('.navPanelDev').slideDown('normal', function() { $(this).css("height", "331px");});
		$('.development').addClass("sel");
	}, 
	function () {
	$(".navPanelDev").stop().slideUp("fast", function() { $(this).css("height", "331px");});
	$('.development').removeClass("sel");
	});
	
	$('#navExposure').hover(
	function () {
		$('.navPanelExposure').slideDown('normal', function() { $(this).css("height", "331px");});
		$('.exposure').addClass("sel");
	}, 
	function () {
	$(".navPanelExposure").stop().slideUp("fast", function() { $(this).css("height", "331px");});
	$('.exposure').removeClass("sel");
	});
	
	
	
	/*  Hide last Bottom Border on Twitter Feed in Bio & ShopTalk Page */
	$("#twitterFeed ul li").last().css('border-bottom', 'none'); 
	$("#mainCol .article").last().css('border-bottom', 'none');
	$("#comments .commentWrapper .sub").last().css('border-bottom', 'none');
	
	
	
	$("#shopTalkContainer #shopTalkBody #mainCol .article #metaData span .ptags").click(function () {
      			if ($(this).next('.tagContainer').is(":hidden")) {
        			 $(this).next('.tagContainer').slideDown("normal");
					 $(this).addClass("sel");     		
				 } else {
       					  $(this).next('.tagContainer').hide();
			  }
			  	 $(this).next('.tagContainer').hover(
				 function () {
			 	}, 
			  	function () {
				 $('.tagContainer').fadeOut("fast");
				 $("#shopTalkContainer #shopTalkBody #mainCol .article #metaData span .ptags").removeClass("sel")

				 
				});
			  
			});
	
	
	
		/* Set and Remove Default Value on form fields   */
		$('#getUpdatesEmail').defaultValue();
		$('#s').defaultValue();
	
			

			$(function() {
			$("#spotlightSliderImageContainer").jCarouselLite({
			btnNext: ".spotlightSliderRight",
			btnPrev: ".spotlightSliderLeft", 
			visible: 1
			});
		});
			
			//Color Box
			$("#spotlightSliderImageContainer ul li a").colorbox();
			$("ul.ourHolder li a").colorbox();
			
			
			
			
			
			
		
		/*Form Validation */
		
		$("#contactForm").validationEngine();
					 
			
     				 
		/* Gallery */
		
		
		/*$('#filterOptions li.all').addClass("sel");
		
		$('#filterOptions li').click(function() {
 			 $('#filterOptions li').removeClass("sel");
			 $(this).addClass("sel");
		});*/
		
		
		
		
		
			// get the action filter option item on page load
  var $filterType = $('#filterOptions li.active a').attr('class');
	
  // get and assign the ourHolder element to the
	// $holder varible for use later
  var $holder = $('ul.ourHolder');

  // clone all items within the pre-assigned $holder element
  var $data = $holder.clone();

  // attempt to call Quicksand when a filter option
	// item is clicked
	$('#filterOptions li a').click(function(e) {
		// reset the active class on all the buttons
		$('#filterOptions li').removeClass('active');
		
		// assign the class of the clicked filter option
		// element to our $filterType variable
		var $filterType = $(this).attr('class');
		$(this).parent().addClass('active');
		
		if ($filterType == 'all') {
			// assign all li items to the $filteredData var when
			// the 'All' filter option is clicked
			var $filteredData = $data.find('li');
		} 
		else {
			// find all li elements that have our required $filterType
			// values for the data-type element
			var $filteredData = $data.find('li[data-type=' + $filterType + ']');
		}
		
		// call quicksand and assign transition parameters
		$holder.quicksand($filteredData, {
			duration: 800,
			easing: 'easeInOutQuad'
		}, function()  { // callback function
    		$("ul.ourHolder li a").colorbox();
		});
		return false;
	});
	
	
});


