$.fn.cv = function() {
	$.support = {
		opacity: !($.browser.msie && /MSIE 6.0/.test(navigator.userAgent))
	};
	if ($.support.opacity) {
		$(this).each(function(i) {
			if ($(this).is(":file")) {
				var $input = $(this);
				$(this).wrap('<label class="cabinet" id="cabinetcv'+i+'"></label>');
				$("label#cabinetcv"+i)
					.wrap('<div class="cvi"></div>')
					.after('<div class="cvButton"><div></div></div><label class="selectedFile"></label>')
				
				$(this).change(function() {
					$container = $(this).closest("div.cvi");
					$("label.selectedFile", $container).html($(this).val());
				})
			}
		});
	}
};

$.fn.archive = function() {
	$.support = {
		opacity: !($.browser.msie && /MSIE 6.0/.test(navigator.userAgent))
	};
	if ($.support.opacity) {
		$(this).each(function(i) {
			if ($(this).is(":file")) {
				var $input = $(this);
				$(this).wrap('<label class="cabinet" id="cabinetarchive'+i+'"></label>');
				$("label#cabinetarchive"+i)
					.wrap('<div class="si"></div>')
					.after('<div class="archiveButton"><div></div></div><label class="selectedFile"></label>')
				
				$(this).change(function() {
					$container = $(this).closest("div.si");
					$("label.selectedFile", $container).html($(this).val());
				})
			}
		});
	}
};
