(function ($) {
jQuery.fn.fillme = function (options) {
var opts = $.extend({},
        $.fn.fillme.defaults, options);
        var $this = $(this);
        $this.data('opts', opts);
        return this.each(function (i, e) {
            var $t = jQuery(this);
	    
	    $(opts.target).change(function() {
		//console.log($(this+':selected').text());
		//$('#telephone').val("");
		//$(opts.target).focus();
		//$("#formSignup").validate().element( "#telephone" );

		if($t.is('input')){
		    if(opts.fill_with=='value'){
			$t.val($(this).val());			
		    }else if(opts.fill_with=='text'){
			//THIS WORK IN FF BUT NOT IN IE - what a surprise
			//$t.val($(this+':selected').text());
			//workaround
			$t.val($(this).find('option:selected').text());
		    }
		    
		
		}else{
		    //$t.html($(this).val());
		    if(opts.fill_with=='value'){
			$t.html($(this).val());			
		    }else if(opts.fill_with=='text'){
			//THIS WORK IN FF BUT NOT IN IE - what a surprise 
			//$t.html($(this+':selected').text());
			//workaround
			$t.html($(this).find('option:selected').text());
		    }
		}			
	    }).change();
	})
}
//defaults
jQuery.fn.fillme.defaults = {
	target:'.master',
	fill_with:'value'
    };
    //private part
    
})(jQuery);
