/* Clear text
   usage: $("input[type='text']").clearText();
          $("input[type='text']").clearText({blurcolor:"#your_color", focuscolor:"#your_color"});
*/
(function($){
	$.fn.clearText = function(options){
		var defaults = {  
			   blurcolor: "#ccc",  
			   focuscolor: "#000"
		  };  
  		var options = $.extend(defaults, options);  
		return this.each(function(){
			var default_value = $(this).val();
			$(this).css("color",options.blurcolor);
				$(this).focus(function(){
					if ($(this).val() == default_value){
						$(this).val("");
						$(this).css("color",options.focuscolor);
					}
				});
				$(this).blur(function(){
					if ($(this).val() == ""){
						$(this).val(default_value);
						$(this).css("color",options.blurcolor);
					}
				});
		});
	};
})(jQuery); 
/* 
BC product thumb resizer
usage: $("ID_of_thumbnail_container").fitThumbs({
	tempImgContainerID: "", //id of tag_smallimage container
	imgWidth: 129,  //thumb width
	imgHeight: 96,   //thumb height
	thumbAlgorithm: "fill" //can also be fill_proportional, proportional
	});
*/
(function($){
	$.fn.fitThumbs = function(options){
		var defaults = {  
			   tempImgContainerID: "", 
			   imgWidth: 129,
			   imgHeight: 96,
			   thumbAlgorithm: "fill" 
		  };  
  		var options = $.extend(defaults, options);  
		return this.each(function(){
			var imgsrc = $(options.tempImgContainerID+" img").attr("src");
				$(this).html("<img src='"+imgsrc+"?Action=thumbnail&Width="+options.imgWidth+"&Height="+options.imgHeight+"&Algorithm="+options.thumbAlgorithm+"' alt='thumb' />");
		});
	};
})(jQuery); 
