function upload(filepath) {
	var p0, p1, s0, server;
	XMLHTTP.Open("GET", "http://www.filefactory.com/upload/upload.if.php", false);
	XMLHTTP.send();
	s0 = XMLHTTP.responseText;
	p0 = s0.indexOf("action=\"");
	if(p0 > -1) {
		p0 = p0 + 8; //8 = "action=""
		p1 = s0.indexOf("\"", p0);
		if(p1 > p0)
			server = s0.substring(p0, p1);
	}
	if(server != "") {
		WebForm.Action = server;
		WebForm.Method = "POST";
		WebForm.Enctype = "multipart/form-data";
		WebForm.AddFile("file", filepath, "");

		XMLHTTP.Open(WebForm.Method, WebForm.Action, false);
		XMLHTTP.setRequestHeader("Content-type", WebForm.Enctype);
		XMLHTTP.send(WebForm.VarBody);
		switch(XMLHTTP.Status) {
		case 200: //OK
			return "http://www.filefactory.com/file/" + XMLHTTP.responseText;
		break;
		default: //Error
			WshShell.Popup(XMLHTTP.statusText, 0, XMLHTTP.Status, 16);
		}
	}
}
