jQuery(document).ready(
				function() {
					var imagebg = Drupal.settings.htmlElements.inputFormSubmitImage;
					if (imagebg) {
						jQuery("input.form-submit").mouseover(
										function() {
											jQuery(this).css(
															{
																'opacity' : '0.8',
																'filter' : 'progid:DXImageTransform.Microsoft.Alpha(opacity= 80)',
																'-moz-opacity' : '0.8',
																'-khtml-opacity' : '0.8'
															});
										});
						jQuery("input.form-submit").mouseout(
										function() {
											jQuery(this).css(
															{
																'opacity' : '1',
																'filter' : 'progid:DXImageTransform.Microsoft.Alpha(opacity= 100)',
																'-moz-opacity' : '1',
																'-khtml-opacity' : '1'
															});
										});
						htmlelementsButton = function() {
							if(this.clientWidth){
							var selw = jQuery(this).width();
							// jQuery(this).after(selw);
							if (selw < 51) {
								w = 50;
								bg = 'transparent url(' + imagebg + ') no-repeat 0 0';
							} else if (selw < 76) {
								w = 75;
								bg = 'transparent url(' + imagebg + ') no-repeat -50px 0';
							} else if (selw < 101) {
								w = 100;
								bg = 'transparent url(' + imagebg + ') no-repeat -125px 0';
							} else if (selw < 126) {
								w = 125;
								bg = 'transparent url(' + imagebg + ') no-repeat -225px 0';
							} else if (selw < 151) {
								w = 150;
								bg = 'transparent url(' + imagebg + ') no-repeat -350px 0';
							} else if (selw < 176) {
								w = 175;
								bg = 'transparent url(' + imagebg + ') no-repeat -500px 0';
							} else if (selw < 201) {
								w = 200;
								bg = 'transparent url(' + imagebg + ') no-repeat -675px 0';
							} else if (selw < 226) {
								w = 225;
								bg = 'transparent url(' + imagebg + ') no-repeat -875px 0';
							} else {
								w = 250;
								bg = 'transparent url(' + imagebg + ') no-repeat -1100px 0';
							}
							jQuery(this).css( {
								'background' : bg,
								'height' : 25,
								'width' : w,
								'border' : 'none',
								'vertical-align' : 'middle'
							});
							}
						};
						jQuery(this).find("input.form-submit").each(htmlelementsButton);
						jQuery("a").click(
								function () { 
									jQuery(this).parent().parent().find("input.form-submit").each(htmlelementsButton);
								}	
						);
					}
				});