/* 
	jQuery EasyThumb 1.0 Plugin
	Check www.hverven.net (For updates, etc)
	Updated: 06.01.08
*/

jQuery.fn.easyThumb = function(opt) {

	opt = jQuery.extend({
     		width: 50, /* Width of the thumb*/
     		height: 0, /* Height of the thumb. (optional) */
     		makeLink: false, /* This will make a link to the original image */
     		toolTip: false /* Show a tooltip with the ALT-text*/
  	},opt);

	return $(this).parent().each( function(){

  		jQuery(this).find(".loading").remove();

  		jQuery(this).find("li").each(function(n) {

  			var obj = jQuery(this).find("img");
  			var url = obj.attr("src");
  			var alt = obj.attr("alt");

  			obj.attr("src",url)
			obj.attr("width",opt.width);
			var pictW = obj.width();
			var pictH = obj.height();
			obj.attr("width",opt.width);

			if (opt.makeLink){
				obj.wrap("<a class=\"plain_link\" href=\""+url+"\" title=\""+alt+"\"></a>");
			}
  			if(opt.height > 0){
  				obj.css("height",opt.height);
  			}
			/* TODO */
  			if(opt.toolTip){}
  		});
		jQuery(this).removeClass("easyThumb").addClass("easyThumbview");
	});	
};