		$(function(){
			$('#slides').slides({
				preload: true,
				preloadImage: 'images/slideshow/loading.gif',
				play: 5000,
				pause: 2500,
				hoverPause: true,
				animationStart: function(current){
					$('.caption').animate({
						bottom:-35
					},100);
					if (window.console && console.log) {
						// example return of current slide number
						console.log('animationStart on slide: ', current);
					};
				},
				animationComplete: function(current){
					$('.caption').animate({
						bottom:0
					},200);
					if (window.console && console.log) {
						// example return of current slide number
						console.log('animationComplete on slide: ', current);
					};
				},
				slidesLoaded: function() {
					$('.caption').animate({
						bottom:0
					},200);
				}
			});
		});

var dropdown_active;

$(document).ready(function() {

		var h;
    $("ul#nav > li").hover(function(){
				dropdown_active = $(this);

				$(this).addClass("hover");
				$('ul:first',this).fadeIn("slow");
				$('ul:first',this).css('visibility', 'visible');
				h = $('ul:first',this).height();
				if(h=='null' || h<1)
					{
						$('div.submenus').css('height', 'auto');
						$('div.submenus').css('display', 'none');
					}
				else
					{
						$('div.submenus').css('height', h+15);
						$('div.submenus').addClass('active');
						$('div.submenus').css('display', 'block');
						$('div.submenus').animate({height: h},{queue:false, duration:600, easing: 'easeOutExpo'});
						$('div.submenus').css('left', '0px');
						$('div.submenus').css('top', '75px');
					}

    }, function(){

			dropdown_reset();

    });

		$('div.submenus').hover(function(){
			dropdown_active.addClass("hover");
			dropdown_active.children('ul').css('visibility', 'visible');
			$('div.submenus').css('height', h+15);
			$('div.submenus').css('display', 'block');
		}, function(){dropdown_reset();});


});

function dropdown_reset()
{
	$('#nav ul').css('visibility', 'hidden');
	$('#nav > li').removeClass("hover");
	$('div.submenus').css('height', 'auto');
	$('div.submenus').css('display', 'none');
}

$(document).ready(function() {
	$('ul#filter a').click(function() {
		$(this).css('outline','none');
		$('ul#filter .current').removeClass('current');
		$(this).parent().addClass('current');
		
		var filterVal = $(this).text().toLowerCase().replace(' ','-');
				
		if(filterVal == 'all') {
			$('ul#gallery-item li.hidden').fadeIn('slow').removeClass('hidden');
		} else {
			
			$('ul#gallery-item li').each(function() {
				if(!$(this).hasClass(filterVal)) {
					$(this).fadeOut('normal').addClass('hidden');
				} else {
					$(this).fadeIn('slow').removeClass('hidden');
				}
			});
		}
		
		return false;
	});
});

$(document).ready(function() {
	$('ul#filter2 a').click(function() {
		$(this).css('outline','none');
		$('ul#filter2 .current').removeClass('current');
		$(this).parent().addClass('current');
		
		var filterVal = $(this).attr("title");

		if(filterVal == 'All') {
			$('ul#graphic-item li.hidden').fadeIn('slow').removeClass('hidden');
		} else {
			
			$('ul#graphic-item li').each(function() {
				if(!$(this).hasClass(filterVal)) {
					$(this).fadeOut('normal').addClass('hidden');
				} else {
					$(this).fadeIn('slow').removeClass('hidden');
				}
			});
		}
		
		return false;
	});
});

$(document).ready(function(){
		$("area[rel^='image-news']").prettyPhoto();
		$("area[rel^='prettyPhoto']").prettyPhoto();
		
		$("#slide-portfolio:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: false});
		$("#slide-portfolio:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true});
		$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: false});
		$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',hideflash: true});
		$(".detail-image:first a[rel^='image-news']").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: false});
		$("#graphic-item:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: false});
		$("#graphic-item:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: false});
		$("#right a[rel^='prettyPhoto']").prettyPhoto();
});

$(document).ready(function() {
	$('ul#graphic-item li, .sidebar-block-29 .graphics-index-item').hover(function() {
		$(this).find(".picture").stop().animate({"top":-30},500,"easeOutExpo");
		$(this).find(".picture a").find("img").stop().animate({"opacity":0.50},500,"easeOutExpo");
	}, function() {
		$(this).find(".picture").stop().animate({"top":0},500,"easeOutExpo");
		$(this).find(".picture a").find("img").stop().animate({"opacity":1},500,"easeOutExpo");
	});
});

$(function() {
	// Others
	$(".portfolio-items a[href$='.png'].hover, a[href$='.jpg'].hover, a[href$='.jpeg'].hover").removeClass("link_blog").addClass("link_img");
	// Video
	$(".portfolio-items a[href$='.swf'].hover, .hover a[href$='.mov'].hover, a[href$='.rft'].hover").removeClass("link_blog").addClass("link_vid");

});

