Element.extend({
	"submitToIframe": function(options) {
                var options = options || {};
		if(this.getTag() != "form") return false
		var iFrame = new Element("iframe", {
			"id": "fileUpload",
			"name": "fileUpload",
		})
		$("content").empty().setHTML("<h1>" + this.getProperty("title") + "</h1>").adopt(iFrame)
		window.frames["fileUpload"].name = "fileUpload"
		iFrame.addEvent("load", function() {
			iFrame.removeEvent("load", arguments.callee)
			if($type(options.onComplete) == "function")
				options.onComplete(iFrame.contentDocument.body.innerHTML)
		})
		this.setProperties({
			"target": "fileUpload",
			"enctype": "multipart/form-data",
			"encoding": "multipart/form-data",
			"method": "post"
		})
		return this
	}
})