$j = jQuery.noConflict();

$mf = new Object();
$mf.abutton = function(){
	var $ = jQuery;
	$('.abutton').each(function(i){
		var buttonLeft = document.createElement('img');
		jQuery(buttonLeft).attr({src: jQuery.NiceJForms.options.imagesPath + "button_left.gif"}).addClass("abuttonImg");
		$(this).before(buttonLeft);
		
		var buttonRight = document.createElement('img');
		jQuery(buttonRight).attr({src: jQuery.NiceJForms.options.imagesPath + "button_right.gif"}).addClass("abuttonImg");
		
		if($(this).next()) {$(this).after(buttonRight)}
		else {$(this).parent().append(buttonRight)};
		
		$(this).hover(
			function(){$(this).attr("class", $(this).attr("class") + "Hovered"); $(this).prev().attr("src", jQuery.NiceJForms.options.imagesPath + "button_left_xon.gif"); $(this).next().attr("src", jQuery.NiceJForms.options.imagesPath + "button_right_xon.gif")},
			function(){$(this).attr("class", $(this).attr("class").replace(/Hovered/g, "")); $(this).prev().attr("src", jQuery.NiceJForms.options.imagesPath + "button_left.gif"); $(this).next().attr("src", jQuery.NiceJForms.options.imagesPath + "button_right.gif")}
		);
	});	
}
$j($mf.abutton);
