$(function() {
	//wraps work images in a span and adds info
    $(".entry.workPost img").wrap("<span class=\"clickzoom\"></span>");
    $(".clickzoom").prepend("<strong style=\"display:none\">Click to zoom</strong>");
	
	//adds a class to work images
    $(".entry.workPost img").addClass("forcedSize");
	
	//adds instructions to 'click' when you hover over work images
	$(".entry.workPost span").hover(
    function(){
        if ( $(this).children("img").hasClass("forcedSize") ) {
            $(this).children(".clickzoom strong").fadeIn(100);
            $(this).children("img").fadeTo(100, 0.50);
        }
    },
    function () {
        $(".clickzoom strong").fadeOut(20)
        $(this).children("img").fadeTo(20, 1.00);
    });
	
	// this zooms/unzooms work images when clicked
    $(".entry.workPost img").click(
    function(){
        var $imgs = $(this);
        if( $imgs.is('.forcedSize') ) {
            $(".clickzoom strong").fadeOut(200);
            $imgs.fadeTo(400, 1.00);
            $imgs.removeClass('forcedSize');
            $imgs.addClass('actualSize');
            } else {
            $imgs.removeClass('actualSize');
            $imgs.addClass('forcedSize');
        }
        return false;
    }); 

});
