// JavaScript Document
// Homepage Cycle Slideshow

$(function() {
	$('#slider').cycle({
		fx: 'fade',
		speed: 'slow',
		timeout: 5000,
		pager: '#slider-nav',
		slideExpr: 'img'
	});
}); 

// Navigation blind effect
$(function() {
	$('.artists-toggle').click(function() {
		 $('.artists-ul').animate({ opacity: 'toggle', height: 'toggle'});
		return false;
	});
});

// add a class to the even ul li inside recent work to get rid of margin
$(function() {
	$('.work-thumbs ul li:odd').addClass('no-margin');
	
});



$(document).ready(function(){

	//Recent Work captions
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
	
	$('.thumb-box').hover(function(){
		$(".cover", this).stop().animate({top:'115px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({top:'180px'},{queue:false,duration:300});
	});
	
	
	
});





$(function(){
	//Horizontal Sliding for homepage #Slider
	
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute

	$('#slider').hover(function(){
		$(".cover", this).stop().animate({left:'500px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({left:'770px'},{queue:false,duration:300});
	});
	
});

$(function () {
	// use jQuery to remove hover-state class, but keep it if they have JavaScript turned off
	$('.image-split div').removeClass('highlight');
	// Append a new span to be added with jquery
	$('.image-split-left a').append('<span class="home-button-news-hover" />').each(function () {
		var $span = $('> span.home-button-news-hover', this).css('opacity', 0);
		$(this).hover(function () {
			// on hover
			$span.stop().fadeTo(300, 1);
		}, function () {
			// off hover
			$span.stop().fadeTo(300, 0);
		});
	});
	
	$('.image-split-right a').append('<span class="home-button-work-hover" />').each(function () {
		var $span = $('> span.home-button-work-hover', this).css('opacity', 0);
		$(this).hover(function () {
			// on hover
			$span.stop().fadeTo(300, 1);
		}, function () {
			// off hover
			$span.stop().fadeTo(300, 0);
		});
	});			
});
