/*
** 2010.03.12 : jQuery 代替 以后不再使用
*/

if (typeof(KCAPTCHA_JS) == 'undefined') // 仅执行一次
{
    if (typeof g4_path == 'undefined')
        alert('g4_path 变数有误或设定错误！ js/kcaptcha.js');

    var KCAPTCHA_JS = true;

	var md5_norobot_key = '';

	function imageClick() {
		var url = g4_path+"/"+g4_bbs+"/kcaptcha_session.php";
		var para = "";
		var myAjax = new Ajax.Request(
			url, 
			{
				method: 'post', 
				asynchronous: true,
				parameters: para, 
				onComplete: imageClickResult
			});
	}

	function imageClickResult(req) { 
		var result = req.responseText;
		var img = document.createElement("IMG");
		img.setAttribute("src", g4_path+"/"+g4_bbs+"/kcaptcha_image.php?t=" + (new Date).getTime());
		document.getElementById('kcaptcha_image').src = img.getAttribute('src');

		md5_norobot_key = result;
	}

	Event.observe(window, "load", imageClick);
}