function upload(filepath) {
    var p0, p1, s0, mimetype;
	WebForm.Action = "http://www.radikal.ru/action.aspx";
	WebForm.Method = "POST";
	WebForm.Enctype = "multipart/form-data";
	WebForm.AddField("upload", "yes");
	WebForm.AddField("GEO_POINT_ID", "");
	WebForm.AddField("URLF", "");
	WebForm.AddField("M", "640");	//Уменьшить до
	WebForm.AddField("JQ", "85");	//Качество JPEG
	WebForm.AddField("IM", "7");
	WebForm.AddField("VM", "180");	//Превью (пикселей)
	WebForm.AddField("R", "0");
	WebForm.AddField("VE", "yes");
	WebForm.AddField("V", "");	//Надпись на превью
	WebForm.AddField("X", "");
	WebForm.AddField("FS", "");
	switch(filepath.substring(filepath.lastIndexOf(".")).toLowerCase) {
	case ".gif":
		mimetype = "image/gif";		//GIF image
		break;
	case ".jpg", ".jpe", ".jpeg":
		mimetype = "image/jpeg";	//JPEG image
		break;
	case ".tif", ".tiff":
		mimetype = "image/tiff";	//TIFF image
		break;
	case ".png":
		mimetype = "image/png";		//PNG image
		break;
	case ".bmp":
		mimetype = "image/bmp";		//Bitmap image
	}
	WebForm.AddFile("F", filepath, mimetype);

	XMLHTTP.Open(WebForm.Method, WebForm.Action, false);
	XMLHTTP.setRequestHeader("Content-type", WebForm.Enctype);
	XMLHTTP.send(WebForm.VarBody);
	switch(XMLHTTP.Status) {
	case 200: //OK
		s0 = XMLHTTP.responseText;
		p0 = s0.indexOf("url4res");
		if(p0 > -1) {
			p0 = s0.indexOf("http://", p0);
			if(p0 > -1) {
				p1 = s0.indexOf("\"", p0);
				if(p1 > p0)
					return s0.substring(p0, p1);
			}
		}
	break;
	default: //Error
		WshShell.Popup(XMLHTTP.statusText, 0, XMLHTTP.Status, 16);
	}
}
