function MFUInit(TotalMaxSize, UnitMaxSize, MaxFileCount, nWidth, nHeight)
{
	if (nWidth == undefined) {
		nWidth = "100%";
	}

	if (nHeight == undefined) {
		nHeight = "100%";
	}

	var tStr = "<object id=\"MFU\" classid=\"CLSID:A467F790-7C53-41BE-B87E-48A64729E5B7\" " +
				"codebase=\"http://mfu.innorix.com/InnorixMFU.cab#version=1,2,0,3\" " +
				"width=\"" + nWidth + "\" height=\"" + nHeight + "\">" +
				"<param name=\"TotalMaxSize\" value=\"" + TotalMaxSize + "\">" +
				"<param name=\"UnitMaxSize\" value=\"" + UnitMaxSize + "\">" +
				"<param name=\"MaxFileCount\" value=\"" + MaxFileCount + "\">" +
				"</object>";

	document.writeln(tStr);
}

function MFUSubmit(obj)
{
	if (document.MFU == undefined) {
		return true;
	}

	if (document.MFU.CurrentFileCount == 0) {
		return true;
	}

	for (var i = 0; i < obj.length; i++)
	{
		if (obj[i].type == "checkbox") {
			if (obj[i].checked == true) {
				document.MFU.AddPostData(obj[i].name, obj[i].value);
			}

		} else if (obj[i].type == "radio") {
			if (obj[i].checked == true) {
				document.MFU.AddPostData(obj[i].name, obj[i].value);
			}

		} else if (obj[i].type == "select-one") {
			if (obj[i].options[obj[i].selectedIndex].value.length > 0) {
				document.MFU.AddPostData(obj[i].name, obj[i].options[obj[i].selectedIndex].value);

			} else {
				document.MFU.AddPostData(obj[i].name, obj[i].options[obj[i].selectedIndex].text);
			}

		} else if (obj[i].type == "hidden"
					|| obj[i].type == "text"
					|| obj[i].type == "textarea"
					|| obj[i].type == "password")
 		{
			document.MFU.AddPostData(obj[i].name, obj[i].value);
		}
	}

	document.MFU.StartUpload();

	return false;
}
