/*

	Plugin PNG fix voor IE6;
	 
	Versie 3.0.3;
		
	Datum 30-01-2008;
	
	Project http://www.appelsiini.net/projects/filestyle;
	
*/
 
/*
 * Style File - jQuery plugin for styling file input elements
 *  
 * Copyright (c) 2007-2008 Mika Tuupola
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Based on work by Shaun Inman
 *   http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom
 *
 * Revision: $Id: jquery.filestyle.js 303 2008-01-30 13:53:24Z tuupola $
 *
 */

(function($) {
    
    $.fn.filestyle = function(options) {
                                        
        return this.each(function() {
            
            var self = this;
            var wrapper = $('<div class="jquery-file-wrapper">');
            var filename = $('<input class="jquery-file-input">').addClass($(self).attr("class"));

            $(self).before(filename);
            $(self).wrap(wrapper);

            $(self).addClass('jquery-file-button').css({"opacity": "0.0"});

            if ($.browser.mozilla) {
                if (/Win/.test(navigator.platform)) {
                    $(self).css("margin-left", "-142px");                    
                } else {
                    $(self).css("margin-left", "-120px");                    
                };
            };

            $(self).bind("change", function() {
                filename.val($(self).val());
            });
      
        });
        

    };
    
})(jQuery);

