/*
 *
 * Copyright (c) 2006 Sam Collett (http://www.texotela.co.uk)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 */

/*
 * Converts image and link elements to thumbnails
 *
 * @name     jThumb
 * @author   Joan Piedra (http://www.joanpiedra.com)
 * @example  $("a.thumb, img.thumb").thumbs();
 *
 */
$.fn.thumbs = function() {
	return this.wrap(
		'<div class="thumb-img"><div class="thumb-inner">' + '</div><div class="thumb-strip"></div><div class="thumb-zoom"></div></div>'
	);
};
$.fn.thumbssmall = function() {
	return this.wrap(
		'<div class="thumb-img-small"><div class="thumb-inner-small">' + '</div><div class="thumb-strip-small"></div><div class="thumb-zoom"></div></div>'
	);
};

/*
 * Absolute positions the image in the middle of the thumbnail frame
 *
 * @name     jThumbImg
 * @author   Joan Piedra (http://www.joanpiedra.com)
 * @example  $("a.thumb img, img.thumb").thumbsImg();
 *
 */
$.fn.thumbsImg = function()
{
/*	return this.each(function(){
			$(this).css('position','absolute');
			$(this).css('left', '-' + ( parseInt( $(this).width() ) / 2 ) + 'px' );
			$(this).css('top', '-' + ( parseInt( $(this).height() ) / 2 ) + 'px' );
			$(this).css('margin-left', '50%' );
			$(this).css('margin-top', '50%' );
	});
*/
	return this.each(function(){
			$(this).css('position','absolute');
			$(this).css('margin-left', '-' + ( parseInt( $(this).width() ) / 2 ) + 'px' );
			$(this).css('margin-top', '-' + ( parseInt( $(this).height() ) / 2 ) + 'px' );
			$(this).css('left', '50%' );
			$(this).css('top', '50%' );
	});
}
