//<![CDATA[
function captcha(which) {
	focusOnSpirit();
	var txtCaptcha=document.getElementById('txtCaptcha');
	var hidToken=document.getElementById('hidToken');
	var xmlHttp;
	try {
		xmlHttp=new XMLHttpRequest();
	} catch (e) {
		try {
			xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e) {
			try {
				xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
			} catch (e) {
				alert('Your browser does not support AJAX!');
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			/*if(txtCaptcha.value==xmlHttp.responseText) {
				eval(which+';');
			} else {
				alert('您輸入的驗證碼錯誤，請重新輸入！');
				txtCaptcha.focus();
			}*/
		}
	}
	xmlHttp.open('POST', '.captcha/Captcha.php', true);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlHttp.send('t='+hidToken.value);
}
function reCaptcha() {
	focusOnSpirit();
	var imgCaptcha=document.getElementById('imgCaptcha');
	var txtCaptcha=document.getElementById('txtCaptcha');
	var hidToken=document.getElementById('hidToken');
	var xmlHttp;
	try {
		xmlHttp=new XMLHttpRequest();
	} catch (e) {
		try {
			xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e) {
			try {
				xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
			} catch (e) {
				alert('Your browser does not support AJAX!');
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			document.getElementById('imgCaptcha').src='Captcha.php?sid='+xmlHttp.responseText;
			txtCaptcha.value='';
			txtCaptcha.style.display='inline';
			hidToken.value=xmlHttp.responseText;
			txtCaptcha.focus();
		}
	}
	xmlHttp.open('GET', '.reCaptcha.php?sid='+hidToken.value, true);
	xmlHttp.send(null);
}
function reply() {
	var validated=false;
	if(document.getElementById('txtNick').value.length>0) {
		if(document.getElementById('txtContent').value.length>1&&document.getElementById('txtContent').value.length<=100) {
			if(document.getElementById('txtCaptcha').value.length>0) {
				validated=true;
				alert('感謝您的加持！');
			} else {
				alert('您輸入的驗證碼錯誤，請重新輸入！');
			}
		} else {
			alert('拍謝，內容限制在100個字元內喔！');
		}
	} else {
		alert('記得留下您的暱稱唷！');
	}
	validated?document.getElementById('insPush').submit():void(0);
}
function validate() {
	var validated=false;
	if(document.getElementById('txtNick').value.length>0) {
		if(document.getElementById('txtContent').value.length>1&&document.getElementById('txtContent').value.length<=100) {
			if(document.getElementById('txtCaptcha').value.length>0) {
				validated=true;
				alert('感謝您的留言！');
			} else {
				alert('您輸入的驗證碼錯誤，請重新輸入！');
			}
		} else {
			alert('拍謝，內容限制在100個字元內喔！');
		}
	} else {
		alert('記得留下您的暱稱唷！');
	}
	validated?document.getElementById('insInvocation').submit():void(0);
}
//]]>
