// Date: 2010-08-10 17:46
// File: jquery.brthTv.js
// The jquery plugin for slide-show widget
// All rights reserved
//

;(function($) {
	// jQuery plugin definition
	$.fn.swapAttr = function(params){
		params = $.extend({attr1:'src',attr2:'osrc'}, params);
		
		this.each(function(){
			temp=$(this).attr(params.attr1);
			$(this).attr(params.attr1, $(this).attr(params.attr2));
			$(this).attr(params.attr2, temp);
		});
	};
	
	$.fn.imgBtn = function(params) {
		params = $.extend({attr1:'src',attr2:'osrc'}, params);
		// traverse all nodes
		this.hover(function(){ $(this).swapAttr(params); }, function(){$(this).swapAttr(params);} );
		//Preload image
		this.each(function(){
			$('<img/>').attr('src', $(this).attr(params.attr2));
		});
		// allow jQuery chaining
		return this;
	};
})(jQuery);

