function image_zoom_image_open(element)
{
   $(element).animate({ 
      width       : parseInt($(element).find('.recipe-large').css('width')) + 'px',
      height      : (parseInt($(element).find('.recipe-large').css('height')) + 20) + 'px',
      marginLeft  : '25px',
      marginTop   : '-188px',
      opacity     : '100'
      }, 500, null, function(e) {
         $(element).css('display', 'block');
      });
}

function image_zoom_image_close(element)
{
   $(element).animate({ 
      width       : '0px',
      height      : '0px',
      marginLeft  : '0px',
      marginTop   : '0px',
      opacity     : '0'
      }, 500, null, function(e) {
         $(element).css('display', 'none');
      });
}

// Closes any existing images.   
function image_zoom_close_all_large(element) {
   $(element).each(function(i, val) {
      $(this).css('display', 'none')
         .css('width', '0px')
         .css('height', '0px')
         .css('marginLeft', '0px')
         .css('marginTop', '0px')
         .css('opacity', '0');
   });
}

function image_zoom(thumb_id) 
{
   image_zoom_close_all_large('.recipe-image-holder');   // Close all before opening more.
   
   // Get the enlarged image.   
   var current_element  = $('#' + thumb_id).parent().parent().find('.recipe-image-holder');

   // The current element isn't displayed so we open it on up.
   if ($(current_element).css('width') == '0px' || $(current_element).css('display') == 'none') {
      image_zoom_image_open(current_element);
   } 
   
   // If the current element is displayed already, we must close it.
   else {
      image_zoom_image_close(current_element);
   }
}