function chen_anh()
{
	document.checkout.pagetext.focus();
	document.getElementById("pagetext").value = document.getElementById('pagetext').value + '\n[IMG]Link ảnh[/IMG]';
}

function chen_smilies(kitu)
{
	document.checkout.pagetext.focus();
	document.getElementById("pagetext").value = document.getElementById('pagetext').value + kitu;
}



function check()
  {
	  
	check_lao=/^.*(địt|lồn|cặc|kặc|ăn cứt|ăn cức|con chó|buồi|dit. c|d.it|di.t|lo^n|l0^n).*$/;
	if(check_lao.test(document.checkout.u_name.value)==true || check_lao.test(document.checkout.pagetext.value)==true)
		{
			alert("");
			document.checkout.u_name.focus();
			return false;
		}  

  	if(document.checkout.u_name.value=="")
	{
		alert("Bạn chưa nhập tên");
		document.checkout.u_name.focus();
		return false;
	}
	
		if(document.checkout.u_email.value=="")
	{
		alert("Bạn chưa nhập email");
		document.checkout.u_email.focus();
		return false;
	}
	re_email= /^([a-zA-Z0-9_.])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
	if(document.checkout.u_email.value=='')
	{
		alert("Bạn chưa nhập email");
		document.checkout.u_email.focus();
		return false;
	}
	if(document.checkout.pagetext.value=='')
	{
		alert("Bạn chưa nhập nội dung");
		document.checkout.pagetext.focus();
		return false;
	}
	
	if(re_email.test(document.checkout.u_email.value)==false)
	{
		alert("Email gồm các ký tự chữ và số\nVD: chiplove.9xpro@gmail.com");
		document.checkout.u_email.focus();
		return false;
	}
	

	
	
	if(document.checkout.capchat.value!=document.checkout.capchat_type.value)
	{
		alert("Sai mã bảo vệ");
		document.checkout.capchat_type.focus();
		return false;
	}
	
	
	return true;
  }



function docheck(status,from_){
	var alen=document.form1.checkbox.length;
	cb = document.form1.checkbox;
	if (alen>0)
	{
		for(var i=0;i<alen;i++)
			if(document.form1.checkbox[i].disabled==false)
				document.form1.checkbox[i].checked=status;
	}
	else
		if(cb.disabled==false)
			cb.checked=status;
	if(from_>0)
		document.form1.checkall.checked=status;
}



