<!-- 

// Project Black and White effect

// wrap as a jQuery plugin and pass jQuery in to our anoymous function
(function ($) {
    $.fn.cross = function (options) {
        return this.each(function (i) { 
            // cache the copy of jQuery(this) - the start image
            var $$ = $(this);
            
            // get the target from the backgroundImage + regexp
            var target = $$.css('backgroundImage').replace(/^url|[\(\)'"]/g, '');

            // nice long chain: wrap img element in span
            $$.wrap('<span style="position: relative;"></span>')
                // change selector to parent - i.e. newly created span
                .parent()
                // prepend a new image inside the span
                .prepend('<img>')
                // change the selector to the newly created image
                .find(':first-child')
                // set the image to the target
                .attr('src', target);

            // the CSS styling of the start image needs to be handled
            // differently for different browsers
            if ($.browser.msie || $.browser.mozilla) {
                $$.css({
                    'position' : 'absolute', 
                    'left' : 0,
                    'background' : '',
                    'top' : this.offsetTop
                });
            } else if ($.browser.opera && $.browser.version < 9.5) {
                // Browser sniffing is bad - however opera < 9.5 has a render bug 
                // so this is required to get around it we can't apply the 'top' : 0 
                // separately because Mozilla strips the style set originally somehow...                    
                $$.css({
                    'position' : 'absolute', 
                    'left' : 0,
                    'background' : '',
                    'top' : "0"
                });
            } else { // Safari
                $$.css({
                    'position' : 'absolute', 
                    'left' : 0,
                    'background' : ''
                });
            }

            // similar effect as single image technique, except using .animate 
            // which will handle the fading up from the right opacity for us
            $$.hover(function () {
                $$.stop().animate({
                    opacity: 0
                }, 250);
            }, function () {
                $$.stop().animate({
                    opacity: 1
                }, 250);
            });
        });
    };
    
})(jQuery);

// note that this uses the .bind('load') on the window object, rather than $(document).ready() 
// because .ready() fires before the images have loaded, but we need to fire *after* because
// our code relies on the dimensions of the images already in place.
$(window).bind('load', function () {
    $('img.fade').cross();
fadeOutImg();
});    




$(document).ready(function() {
		
	$("ul.gallery li").hover(function() { //On hover...
		//	var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'
			var thumbOver = 0; //Get image url and assign it to 'thumbOver'
	
			
			//Set a background image(thumbOver) on the &lt;a&gt; tag 
		//	$(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});
	
	$("li").each(function(index){ thumbOver = $(this).find("img").attr("src"); $(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});    });
	
				//Fade the image to 0 
			$(this).nextAll().find("span").stop().fadeTo('normal', 0 , function() {
				$(this).hide() //Hide the image after fade 
				
			}); 
		} , function() { //on hover out...
			//Fade the image to 1 
			$(this).nextAll().find("span").stop().fadeTo('normal', 1).show();
		});
	
	$("ul.gallery li").hover(function() { //On hover...
		//	var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'
			var thumbOver2 = 0; //Get image url and assign it to 'thumbOver'
	
			
			//Set a background image(thumbOver) on the &lt;a&gt; tag 
		//	$(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});
	
	$("li").each(function(index){ thumbOver2 = $(this).find("img").attr("src"); $(this).find("a.thumb").css({'background' : 'url(' + thumbOver2 + ') no-repeat center bottom'});    });
	
				//Fade the image to 0 
			$(this).prevAll().find("span").stop().fadeTo('normal', 0 , function() {
				$(this).hide() //Hide the image after fade 
				
			}); 
		} , function() { //on hover out...
			//Fade the image to 1 
			$(this).prevAll().find("span").stop().fadeTo('normal', 1).show();
		});
});

//  * Projects Black & White

$(document).ready(function() {
	
	$("ul.gallery li").hover(function() { //On hover...
	//	var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'
		var thumbOver = 0; //Get image url and assign it to 'thumbOver'

		
		//Set a background image(thumbOver) on the &lt;a&gt; tag 
	//	$(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});

$("li").each(function(index){ thumbOver = $(this).find("img").attr("src"); $(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});    });

			//Fade the image to 0 
		$(this).nextAll().find("span").stop().fadeTo('normal', 0 , function() {
			$(this).hide() //Hide the image after fade 
			
		}); 
	} , function() { //on hover out...
		//Fade the image to 1 
		$(this).nextAll().find("span").stop().fadeTo('normal', 1).show();
	});

$("ul.gallery li").hover(function() { //On hover...
	//	var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'
		var thumbOver2 = 0; //Get image url and assign it to 'thumbOver'

		
		//Set a background image(thumbOver) on the &lt;a&gt; tag 
	//	$(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});

$("li").each(function(index){ thumbOver2 = $(this).find("img").attr("src"); $(this).find("a.thumb").css({'background' : 'url(' + thumbOver2 + ') no-repeat center bottom'});    });

			//Fade the image to 0 
		$(this).prevAll().find("span").stop().fadeTo('normal', 0 , function() {
			$(this).hide() //Hide the image after fade 
			
		}); 
	} , function() { //on hover out...
		//Fade the image to 1 
		$(this).prevAll().find("span").stop().fadeTo('normal', 1).show();
	});

 
});

// *  * Projects Black & White		

// * Image Captions
$(document).ready(function(){
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
	//Vertical Sliding
	$('.boxgrid.slidedown').hover(function(){
		$(".cover", this).stop().animate({top:'-260px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
	});
	//Horizontal Sliding
	$('.boxgrid.slideright').hover(function(){
		$(".cover", this).stop().animate({left:'325px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
	});
	//Diagnal Sliding
	$('.boxgrid.thecombo').hover(function(){
		$(".cover", this).stop().animate({top:'260px', left:'325px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
	});
	//Partial Sliding (Only show some of background)
	$('.boxgrid.peek').hover(function(){
		$(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
	});
	//Full Caption Sliding (Hidden to Visible)
	$('.boxgrid.captionfull').hover(function(){
		$(".cover", this).stop().animate({top:'124px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'164px'},{queue:false,duration:160});
	});
	//Caption Sliding (Partially Hidden to Visible)
	$('.boxgrid.caption').hover(function(){
		$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'220px'},{queue:false,duration:160});
	});
});
// *  *Image Captions


// Fade images
function fadeOutImg() {	
	$(".fadeOut").hover(function(){
    $(this).animate({"opacity": .5}, {duration: 250, queue: false });
	},function () {  
	$(this).animate({"opacity": 1}, {duration: 250, queue: false });
	});
}


