jQuery(function( $ ){


$('#Home #Logo').delay(300).fadeTo(1200,1);
$('#Home #Signature ').delay(800).fadeTo(1200,1);
$('#Home #Slideshow').delay(1300).fadeTo(1200,1);
$('#Home #Navigation').delay(1800).fadeTo(1200,1);
$('#Home #Content').delay(1000).fadeTo(1200,1);
$('#Home #Utilities').delay(2300).fadeTo(1200,1);
$('#Home #Caption').delay(3300).fadeTo(1800,1);


if($.cookie("style") == "white"){ $('body').css('background-color','#FFF'); } else { $('body').css('background-color','#000'); };

   $('#Switch').delay(200).fadeIn(500); // CHANGE DELAY(#) or FADEIN(#)
   $('#Switch').click(
        function(){ 
        if($.cookie("style") == "white"){
        $.cookie('style', null); $('body').stop().animate({backgroundColor: 'black'},300); $.cookie("style", "black",{ expires: 1000, path: '/', domain: 'willstarphotography.com'}); 

        }else{
        $.cookie('style', null); $('body').stop().animate({backgroundColor: 'white'},300); $.cookie("style", "white",{ expires: 1000, path: '/', domain: 'willstarphotography.com'}); 
        }
        }); //CHANGE ANIMATE({...},#)

$('.Next').click( function(){ $('#Caption').fadeTo(200,0); }); // FADETO(#,0);

/*$('#Signature').hover(
function(){ $(this).find('SPAN').animate({ width: 'show', opacity: '1'}, 100); },
function(){ $(this).find('SPAN').animate({ width: 'hide', opacity: '0'}, 100); }
);*/



   
    $('#Slideshow').cycle({
        fx:      'fade',
        next:   '.Next',
        prev:   '.Prev',
        timeout:  0,
        speed: 600, // CHANGE SPEED 
        after: function(curr, next, opts) { $('.Counter').html("("+(opts.currSlide + 1) + " of " + opts.slideCount + ") &nbsp;&nbsp;");  }
        });
    
	$("a[rel=slideshow]").fancybox({
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'titlePosition' 	: 'outside',
				'padding'           : '0',
				'overlayOpacity'  	: '0.6',
				'overlayColor'  	: '#000',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over" style="display: block; height: 17px; background-color: #FFF; "><div style="float: left;">Photo ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</div><div class="AddThis" style="float: right; width: 130px; text-align: right;"><a name=\"fb_share\" type=\"icon_link\" share_url=\"'+location.href+'image'+ (currentIndex + 1) +'/\">Share</a><script src=\"http://static.ak.fbcdn.net/connect.php/js/FB.Share\" type=\"text/javascript\"></script></div></span>';
				}
					
			
		});
		
		$(".ContactPop").fancybox({
	'scrolling'     : 'no',
	'overlayOpacity'  	: '0.6',
	'overlayColor'  	: '#000'

		});

 $.preloadCssImages();


    


});

