
(function($){$.fn.filestyle=function(options){var settings={width:250, idInputText:null};if(options){$.extend(settings,options);};return this.each(function(){var self=this;var wrapper=$("<div>").css({"width":settings.imagewidth+"px","height":settings.imageheight+"px","background":"url("+settings.image+") 0 0 no-repeat","background-position":"right","display":"block","overflow":"hidden","cursor":"pointer","margin-top":"3px","margin-bottom":"10px"});var filename=$('<div class="input_text"><div><input class="file" id="'+settings.idInputText+'"/></div></div>').addClass($(self).attr("class")).css({"width":settings.width+"px"});$(self).before(filename);$(self).wrap(wrapper);$(self).css({"position":"relative","height":settings.imageheight+"px","width":settings.width+"px","display":"inline","cursor":"pointer","opacity":"0.0"});if($.browser.mozilla){if(/Win/.test(navigator.platform)){$(self).css("margin-left","-142px");}else{$(self).css("margin-left","-168px");};}else{$(self).css("margin-left",settings.imagewidth-settings.width+"px");};$(self).bind("change",function(){if(settings.idInputText!=null) {$('#'+settings.idInputText).val($(self).val()); }});});};})(jQuery);


