window.addEvent('load',function(){
 inputfile();
});

var inputfile = function(){
 if (Browser.Engine.gecko == true){
 if (navigator.userAgent.match(/Firefox\/([0-9\.]+)$/)[1].toInt() < 3){
 return false;
 }
 var i = $$('input[type="file"]');
 i.each(function(e){
 // hide the inputs
 var inp = new Element('input',{'type':'text','style':'width:153px;position:absolute;top:0;left:73px;'});
 var but = new Element('input',{'type':'button','value':'Browse...','style':'width:auto;padding:1px 3px 0;position:absolute;top:0;left:230px;font-size:9px;'});
 e.setStyles({'opacity':0,'visibility':'visible'}).addEvent('change',function(){
 inp.set('value',this.get('value'));
 }).getParent().setStyles({'position':'relative'}).grab(inp).grab(but,'top');
 });

 }
}

