$(document).ready(function()
{
	/*$('#gallery ul li:first-child img').removeClass('first');*/
	
	var content = $('#dropdown .content');
	content.hide();
	
	
	
	
	
	$('#dropdown-tab a').click(function()
	{
			content.slideToggle('medium');
			$(this).toggleClass('open');
			return false;
	});
	
	
												
		 $('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;
      }
    }
  });
			
			//Activate FancyBox
			
			
			
			
			$("p#fancy a").fancybox({
				'hideOnContentClick': true
			});
			
			$("p#fancy2 a").fancybox({
				'hideOnContentClick': true
			});
			
			$("p#fancy3 a").fancybox({
				'hideOnContentClick': true
			});
			
			$("p#fancy4 a").fancybox({
				'hideOnContentClick': true
			});
			
			$("p#fancy5 a").fancybox({
				'hideOnContentClick': true
			});
			
			$("p#fancy6 a").fancybox({
				'hideOnContentClick': true
			});
			
			$("p#fancy7 a").fancybox({
				'hideOnContentClick': true
			});
			
			$("p#fancy8 a").fancybox({
				'hideOnContentClick': true
			});
			
			$("p#test2 a").fancybox({
				'zoomSpeedIn':	0, 
				'zoomSpeedOut':	0, 
				'overlayShow':	true
			});
			
			$("a#custom_1").fancybox({
				'itemLoadCallback': getGroupItems
			});
			
			$(".pic2 a").fancybox({
				'zoomSpeedIn':	0, 
				'zoomSpeedOut':	0
				
				
			});
			
			$("a#custom_2, a#custom_3").fancybox({
				'zoomSpeedIn':	0, 
				'zoomSpeedOut':	0
			});
			
			$(".pic3 a").fancybox({
				'zoomSpeedIn':	0, 
				'zoomSpeedOut':	0
			});
			
		});

		//List can contain mixed media too
		//Parameter "o" ir optional and used to override settings, example: {url: "http://www.google.com", title: false,  o: {'frameWidth': 200} }
		var imageList = [
			{url: "/img/examples/6_b.jpg", title: "First image"},
			{url: "/img/examples/7_b.jpg", title: "Second image"},
			{url: "/img/examples/8_b.jpg", title: "Third image"}
		];
		
		function getGroupItems(opts) {
			jQuery.each(imageList, function(i, val) {
		        opts.itemArray.push(val);
		    });
		}
