function analyzeResult(res)
{
	if (res.indexOf(CONST_DBCALL_HEADER) != 0)
	{
		alert("网络发生错误！");
		return;
	}
	var res2 = res.substring(CONST_DBCALL_HEADER.length);
	var res3 = res2.split("\;");
	var code = res3[0];
	if (code == 0)
		alert("申请注册成功！");
	else
		alert("邮件发送失败！");
}

var btn_apply;
function ApplyPublicDemo(form1) 
{
	if (!CheckForm(form1)) return;

	var url = CONST_URL_ADMIN+"?url=dbcall.rol&cmdid=317";
	url += "&nickname="+document.all("nickname").value;
	url += "&telephone="+document.all("telephone").value;
	url += "&email="+document.all("email").value;
	url += "&fullname="+document.all("fullname").value;
	url += "&homepage="+document.all("homepage").value;
	url += "&province="+document.all("province").value;
	
	btn_apply = document.all("apply");
	btn_apply.disabled = true;
	btn_apply.style.cursor = "";
	//alert(encodeURI(url));
	executeURLResult(encodeURI(url), analyzeResult);
}
function ApplyPrivateDemo(form1) 
{
	if (!CheckForm(form1)) return;

	var url = CONST_URL_ADMIN+"?url=dbcall.rol&cmdid=318";
	url += "&nickname="+document.all("nickname").value;
	url += "&telephone="+document.all("telephone").value;
	url += "&email="+document.all("email").value;
	url += "&fullname="+document.all("fullname").value;
	url += "&homepage="+document.all("homepage").value;
	url += "&province="+document.all("province").value;
	url += "&occupy="+document.all("occupy").value;
	url += "&department="+document.all("department").value;
	url += "&industry="+document.all("industry").value;
	url += "&staffcount="+document.all("staffcount").value;
	// products
	url += "&product=";
	for (var i = 0; i < document.all("product").length; i++)
		if (document.all("product")[i].checked)
			url += document.all("product")[i].value+",";

	//alert(url);
	
	btn_apply = document.all("apply");
	btn_apply.disabled = true;
	btn_apply.style.cursor = "";
	executeURLResult(encodeURI(url), analyzeResult);
}
function ApplyOnlineMeeting(form1) 
{
	if (!CheckForm(form1)) return;

	var url = CONST_URL_ADMIN+"?url=dbcall.rol&cmdid=319";
	url += "&nickname="+document.all("nickname").value;
	url += "&telephone="+document.all("telephone").value;
	url += "&email="+document.all("email").value;
	url += "&fullname="+document.all("fullname").value;

	//alert(url);
	
	btn_apply = document.all("apply");
	btn_apply.disabled = true;
	btn_apply.style.cursor = "";
	executeURLResult(encodeURI(url), analyzeResult);
}
