dealResult = function(returnString,returnLoading)
{
	var errorMsg = "請確定下列之錯誤:\n\n";
	
	if(returnString == "LS")
	{
		alert("登入成功");
		window.location = "main/main.php";
	}
	else if(returnString == "RS2")
	{
		window.location = "member_join_step3.php";
	}
	else if(returnString == "RS3")
	{
		window.location = "member_join_step4.php";
	}
	else if(returnString == "DS")
	{
		alert("已刪除成功");
		window.location.reload();
	}
	else if(returnString == "MUS")
	{
		alert("已修改密碼成功");
		window.location = "index.php";
	}
	else
	{
		eMessage = returnString.split(divideKey2);
		for(i=0;i<eMessage.length;i++)
		{
			if(eMessage[i] != "")
			{
				giveMsg = eMessage[i].split(divideKey1);
				errorMsg += giveMsg[1] + "\n";
				if(giveMsg[0] == "verify_err")
				{
					$('VerifyFrameObject').src = "../material/verify.php";
				}
			}
		}
		
		alert(errorMsg);
	}
};

logonToolkit = function(obj)
{
	url = "../main/member_logon_toolkit.php";
	
	switch(obj)
	{
		case "on":
			act = $F('l_act');
			pwd = $F('l_pwd');
			ver = $F('l_ver');
			
			if(act && pwd && ver)
			{
				pars = "act=" + act + "&pwd=" + pwd + "&ver=" + ver +"&aci=on";
				var myAjax = new Ajax.Request(
				url,
				{
				method: 'post',
				parameters: pars,
				onComplete: logonToolkitResult
				});
			}
			else
			{
				alert("請輸入帳號及密碼及認證碼");
			}
		break;
		
		case "out":
			pars = "aci=out";
			var myAjax = new Ajax.Request(
			url,
			{
			method: 'post',
			parameters: pars,
			onComplete: logonToolkitResult
			});
		break;
	}
}

logonToolkitResult = function(obj)
{
	mResult = obj.responseText.split(divideKey1);
	
	switch(mResult[0])
	{
		case "ONS":
			top.window.location.reload();	
		break;
		
		case "OUTS":
			top.window.location.reload();	
			//top.window.location = '../ulog/';	
		break;
		
		case "M":
			$('VerifyFrameObject').src = "../material/verify.php";
			alert(mResult[1]);
		break;
		
		case "V":
			$('VerifyFrameObject').src = "../material/verify.php";
			alert(mResult[1]);
		break;
	}
}
