$(document).ready(function () {

/*    $('#slideshow-blog').hover(

    function () {
        $('#controls').fadeIn();
    }, function () {
        $('#controls').fadeOut();
    });*/

    /*$('#slideshow, #slideshow-work').hover(

    function () {
        $('#controls, #slides-title').fadeIn();
    }, function () {
        $('#controls, #slides-title').fadeOut();
    });*/

//client page

$('#s7').cycle({
	fx: 'scrollHorz',
	timeout: 0, 
	next:   '#next', 
    prev:   '#previous'
	});

	$('#slideshow').hover(

    function () {
        $('#slides-title').fadeIn();
    }, function () {
        $('#slides-title').fadeOut();
    });

    $('#slides').cycle({
        fx: 'scrollHorz',
        speed: 1000,
        timeout: 4000,
        next: '#next',
        prev: '#previous',
        pause: 1,
        after: onAfter,
        before: function () {
            $('#box-quote').hide().html(this.title).fadeIn(1500);
            $('#box-source').hide().html(this.rel).fadeIn(1500);
        }
    });

	/*postslides*/
	$('#slides1').cycle({
        fx: 'scrollHorz',
        speed: 1000,
        timeout: 4000,
        next: '#next',
        prev: '#previous'
    });

    function onAfter(curr, next, opts) {
        var caption = (opts.currSlide + 1) + ' / ' + opts.slideCount;
        $('#slideshowCurrent').html(caption);
    }

    /*$('#slides-blog').cycle({
        fx: 'scrollHorz',
        speed: 1000,
        timeout: 4000,
        next: '#next',
        prev: '#previous',
        pause: 1
    });

    $('#slides-work').cycle({
        fx: 'scrollHorz',
        speed: 1000,
        timeout: 4000,
        next: '#next',
        prev: '#previous',
        pause: 1,
        after: onAfter,
        before: function () {
            $('#slides-title').hide().html(this.alt).fadeIn(1500);
        }
    });

    function onAfter(curr, next, opts) {
        var caption = (opts.currSlide + 1) + ' / ' + opts.slideCount;
        $('#slideshowCurrent').html(caption);
    }


    $('.calendar-hover', this).hide();

    $('#backstage li', this).hover(

    function () {
        $('.calendar-hover', this).fadeIn();
    }, function () {
        $('.calendar-hover', this).fadeOut();
    });

    $(".boxes li a", this).hover(

    function () {
        $(".box-hover", this).fadeIn(400);
    }, function () {
        $(".box-hover", this).fadeOut(400);
    });

	$("#notification").slideDown(400).delay(1500).slideUp(400);
*/

/*Previous button code */

$(function(){
	$('.prevButton img').css({'left':0});

	$(".prevButton a").hover(function(){
		$("img", this).stop().animate({left:"-43px"},{queue:false,duration:200});
	}, function() {
		$("img", this).stop().animate({left:"0px"},{queue:false,duration:200});
	});
	
});

/*Next button code */

$(function(){
	$('.nextButton img').css({'right':0});

	$(".nextButton a").hover(function(){
		$("img", this).stop().animate({right:"-43px"},{queue:false,duration:200});
	}, function() {
		$("img", this).stop().animate({right:"0px"},{queue:false,duration:200});
	});
});

/*Previous button client code */

$(function(){
	$('.sports_client_previous img').css({'left':0});

	$(".sports_client_previous a").hover(function(){
		$("img", this).stop().animate({left:"-17px"},{queue:false,duration:200});
	}, function() {
		$("img", this).stop().animate({left:"0px"},{queue:false,duration:200});
	});
	
});

/*Next button client code */

$(function(){
	$('.sports_client_next img').css({'right':0});

	$(".sports_client_next a").hover(function(){
		$("img", this).stop().animate({right:"-17px"},{queue:false,duration:200});
	}, function() {
		$("img", this).stop().animate({right:"0px"},{queue:false,duration:200});
	});
});

/*previous button code*/

$(function(){
	$('.prevButton1 img').css({'left':0});

	$(".prevButton1 a").hover(function(){
		$("img", this).stop().animate({left:"-33px"},{queue:false,duration:200});
	}, function() {
		$("img", this).stop().animate({left:"0px"},{queue:false,duration:200});
	});
	
});

/*Next button code */

$(function(){
	$('.nextButton1 img').css({'right':0});

	$(".nextButton1 a").hover(function(){
		$("img", this).stop().animate({right:"-33px"},{queue:false,duration:200});
	}, function() {
		$("img", this).stop().animate({right:"0px"},{queue:false,duration:200});
	});
});

$(function(){
    $('#sports_overview_box').hover(
	function(){$("#sports_overview_inside").stop().fadeTo("slow", 1.0);},
	function(){$("#sports_overview_inside").stop().fadeTo("slow", 0);});
});

$(function(){
    $('#sports_overview_box1').hover(
	function(){$("#sports_overview_inside1").stop().fadeTo("slow", 1.0);},
	function(){$("#sports_overview_inside1").stop().fadeTo("slow", 0);});
});

$(function(){
    $('#sports_overview_box2').hover(
	function(){$("#sports_overview_inside2").stop().fadeTo("slow", 1.0);},
	function(){$("#sports_overview_inside2").stop().fadeTo("slow", 0);});
});

$(function(){
    $('#sports_overview_box3').hover(
	function(){$("#sports_overview_inside3").stop().fadeTo("slow", 1.0);},
	function(){$("#sports_overview_inside3").stop().fadeTo("slow", 0);});
});

$(function(){
    $('#sports_overview_box4').hover(
	function(){$("#sports_overview_inside4").stop().fadeTo("slow", 1.0);},
	function(){$("#sports_overview_inside4").stop().fadeTo("slow", 0);});
});

$(function(){
    $('#sports_overview_box5').hover(
	function(){$("#sports_overview_inside5").stop().fadeTo("slow", 1.0);},
	function(){$("#sports_overview_inside5").stop().fadeTo("slow", 0);});
});

$(function(){
    $('#sports_overview_box6').hover(
	function(){$("#sports_overview_inside6").stop().fadeTo("slow", 1.0);},
	function(){$("#sports_overview_inside6").stop().fadeTo("slow", 0);});
});

/*homepage hover starts here*/

$(function() {
$('#sports_column_float_text1').hover(
function() { $('#sports_column_float_text_inside1').stop().fadeTo("slow", 1.0); },
function() { $('#sports_column_float_text_inside1').stop().fadeTo("slow", 0); }); 
});

$(function() {
$('#sports_column_float_text2').hover(
function() { $('#sports_column_float_text_inside2').stop().fadeTo("slow", 1.0); },
function() { $('#sports_column_float_text_inside2').stop().fadeTo("slow", 0); }); 
});

$(function() {
$('#sports_column_float_text3').hover(
function() { $('#sports_column_float_text_inside3').stop().fadeTo("slow", 1.0); },
function() { $('#sports_column_float_text_inside3').stop().fadeTo("slow", 0); }); 
});

/*homepage hover ends here*/

/*fancybox*/

/* This is basic - uses default settings */
	
	$("a#single_image").fancybox();
	
	/* Using custom settings */
	
	$("a#inline").fancybox({
		'hideOnContentClick': true
	});

	/* Apply fancybox to multiple items */
	
	$("a.group").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false
	});
	
/*fancybox*/

//Use the fad in out callback 
/*$("#toolbar").hover(function () {
    $(".image").fadeOut("slow", function () {
        $(this).addClass("imagehover").fadeIn("slow", function () {
            $(this).removeClass("imagehover");
        });
    });

});*/

});


