
function initCommentCaptcha() {
	document.actcommentform.postid.value=document.commentform.postid.value;
	document.actcommentform.name.value=document.commentform.name.value;
	document.actcommentform.emailid.value=document.commentform.emailid.value;
	document.actcommentform.comment.value=document.commentform.comment.value;

	Recaptcha.create("6LceUcYSAAAAAIWN4Rch2F7VU8AHdeJnaF3nSc-2",
    "captchahere",
    {
      theme: "white",
      callback: Recaptcha.focus_response_field
    }
  );

}

function commentFormCheck(form) {
	if (form.name.value.match(/^s+$/) || form.name.value == "" || form.name.value == "Name") {
		alert("Please give a valid name." );
		form.name.focus();
		return false;
	}
	if (form.emailid.value.match(/^s+$/) || form.emailid.value == "" || form.emailid.value == "Email id") {
		alert( "Please give a valid email id." );
		form.emailid.focus();
		return false ;
		
	}
	var filter2=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (! filter2.test(form.emailid.value)) {
		alert( "Invalid email address." );
		form.emailid.focus();
		return false ;
	}
	if (form.comment.value.match(/^s+$/) || form.comment.value == "" || form.comment.value == "Type your comment here") {
		alert( "Please give a valid comment." );
		form.comment.focus();
		return false ;
	}
	var filter3=/bitch|fuck|pussy|pussie|pussies|vagina|punkass|shit|viagra|penis|asshole|fucker|nigger|dike/i;
	if(filter3.test(form.comment.value)) {
		alert("Your comment seems to contain inappropriate words. No adult words are allowed. Please correct and re-submit.");
		form.comment.focus();
			return false;
	}
	TINY.box.show2('popup.html',1,350,220,1,'initCommentCaptcha','','');
	return false;
}

function clearAndActivateInput(obj, def) {
	obj.disabled=false;
	if((obj.value == def ) || (obj.value=='')) {
		obj.value="";
		obj.focus();
		obj.style.color="#000";
	}
}
