// JavaScript Document
function voteActive(act)
{
	vote_active = act ;
}
function on_sub()
{
	frm = document.getElementById("comment_form");
	comuser = document.getElementById("comment_user");	
	if (comuser.value == "")
	{
		alert("กรุณาใส่ชื่อก่อนครับ");
	}
	else
	{
		commentValue = document.getElementById("comment_text").value;
		
		if (commentValue.replace(/^\s+|\s+$/g, '')!="")
		{
			status1 = document.getElementById("comment_status");
			status1.innerHTML= "กำลังดำเนินการ";
			status1.style.color = "yellow";
			frm.submit();
		}
		else
		{
			alert("คุณไม่ได้แสดงความเห็น");
			status1.innerHTML= "พร้อมใช้งาน";	
			status1.style.color = "green";			
			return false ;
		}
	}
}
function completeComment()
{
	status1 = document.getElementById("comment_status");
	setReadyState();
	get_comment(1);
}
function errComment()
{
	frm = document.getElementById("comment_form");
	status1 = document.getElementById("comment_status");
	status1.innerHTML= "ดำเนินการผิดพลาด";
	status1.style.color = "red";
	setTimeout("setReadyState()",1000);
	
}
function setReadyState()
{
//	frm = document.getElementById("comment_form");
//	status1 = document.getElementById("comment_status");
//	status1.innerHTML= "พร้อมใช้งาน";	
//	status1.style.color = "green";	
//	frm.src = "";
//	frm.reset();
}
function cltab(a,b)
{
	frm1 = document.getElementById("ifrm");
	comuser = document.getElementById("comment_user");
	comuser.value = b;
	
	if (a==1)
	{
		frm1.style.height = "120px";
	}
	else
	{
		frm1.style.height = "170px";	
	}
}

