function guestbook_check()
{
	if(document.guestbook.Guest_Name.value=="")
	{
		alert("Please fill in your name");
		document.guestbook.Guest_Name.focus();
		return false
	}
	if(document.guestbook.Guest_Email.value=="")
	{
		alert("Please e-mail address");
		document.guestbook.Guest_Email.focus();
		return false
	}
	var reEmail=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	if (!reEmail.test(document.guestbook.Guest_Email.value))
	{
		alert("E-mail address format error");
		document.guestbook.Guest_Email.focus();
		return false;
	}
	if(document.guestbook.Content.value=="")
	{
		alert("Please fill out the feedback content");
		document.guestbook.Content.focus();
		return false
	}
	if(document.guestbook.checkcode.value=="")
	{
		alert("Please fill out the verification code");
		document.guestbook.checkcode.focus();
		return false
	}
	if(document.guestbook.checkcode.value.length<4)
	{
		alert("Verification code must be 4");
		document.guestbook.checkcode.focus();
		return false;
	}
	var reCheckcode = /^[0-9]+[0-9]*$/;
	if (!reCheckcode.test(document.guestbook.checkcode.value))
	{
		alert("Verification code must be numeric");
		document.guestbook.checkcode.focus();
		return false;
	}
	return true;
}

//友情连接访问统计
function Click_Hit(pagename,sid){
	var re = /^[1-9]+[0-9]*$/;
	if (!re.test(sid))
	{
		alert("ID号必须是大于0的整数");
		return false;
	}
	var xmlhttp;
	try{
		xmlhttp=new XMLHttpRequest();
		}
	catch(e){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	xmlhttp.open("post",pagename+"?Action=Click_Hit&ID="+sid,true);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send();
}