
	function createQuestion (){
		var varCreate = document.getElementById("createQuestion");
		var varFind = document.getElementById("find");
		varCreate.style.display="block";
		varFind.style.display="none";
	}
	function findQuestion (){
		var varCreate = document.getElementById("createQuestion");
		var varFind = document.getElementById("find");
		varCreate.style.display="none";
		varFind.style.display="block";		
		document.getElementById("findquestiontitle").focus();
	}
	function alertCreateQuestion(){
		return confirm( "Bạn có muốn gởi câu hỏi không ?" ) ;			
	}
	function checkIfEmpty(){
		var dear = document.getElementById("dear").value;	
		if(dear == '' || dear == ' '){
			alert("Nhập tên, chức danh người bạn muốn gửi góp ý!");
			document.getElementById("dear").focus();
			return false;
		}
		
		var senderName = document.getElementById("sendername").value;	
		if(senderName == '' || senderName == ' '){			
			alert("Nhập tên người gửi!");
			document.getElementById("sendername").focus();
			return false;
		}
		
		var senderAddress = document.getElementById("senderaddress").value;
		if(senderAddress == '' || senderAddress == ' '){
			alert("Địa chỉ người gửi !");
			document.getElementById("senderaddress").focus();
			return false;
		}
		/*var senderTelephone = document.getElementById("sendertelephone").value;
		if(senderTelephone == '' || senderTelephone == ' '){
			alert("Nhập vào số điện thoại ");
			return false;
		}
		
		var senderEmail = document.getElementById("senderemail").value;
		if(senderEmail == '' || senderEmail == ' '){
			alert("Nhập vào email ");
			return false;
		}*/
		var questionTitle = document.getElementById("questiontitle").value;
		if(questionTitle == '' || questionTitle == ' '){			
			alert("Nhập chủ đề góp ý  VD: đất đai, pháp lý… ");
			document.getElementById("questiontitle").focus();
			return false;
		}
		var questionContent = document.getElementById("questioncontent").value;
		if(questionContent == '' || questionContent == ' '){			
			alert("Nhập nội dung góp ý !");
			document.getElementById("questioncontent").focus();
			return false;
		}
		else{
			return confirm( "Bạn có muốn gởi câu hỏi không ?" ) ;
		}	
	}


	function adminFindQuestion (){		
		var varFind = document.getElementById("find");		
		varFind.style.display="block";
	}
	function replyQuestion (id){		
		document.reply.CommunicationPortlet_cmd.value="1301";
		document.reply.id.value=id;
		document.reply.txtUpdateOption.value=document.getElementById("txtOption").value;
		//alert(document.getElementById("txtOption").value);
		document.reply.submit();
	}
	
	function updateQuestion (id){		
		document.updated.CommunicationPortlet_cmd.value="1304";
		document.updated.id.value=id;
		document.updated.txtUpdateOption.value=document.getElementById("txtOption").value;
		document.updated.submit();
	}
	function deleteQuestion (id){	
		if(confirm("Bạn có muốn xóa câu hỏi này không ?") == false){
			return ;
		}	
		else{
			document.deleted.CommunicationPortlet_cmd.value="1303";
			document.deleted.id.value=id;
			document.deleted.submit();
		}
	}
//ta
	function selectHotQuestion(obj,id)
{
	//alert(obj.name);
	//alert(id);
	var ppage = document.getElementById("ppage").value;
	//alert(ppage);
	if(document.getElementById(obj.name).checked == 1)
	{
		//alert("Check roi")
		if(confirm("Đưa vào danh sách câu hỏi thường gặp ?"))
		{
			//thuc hien go bo
			document.change.idchange.value=id;
			document.change.typechange.value=1;
			document.change.page.value=ppage;
			document.change.submit();
		}
		else
		{
			 document.getElementById(obj.name).checked = 0;
			 
		}
	}
	else
	{
		//alert("chua check")
		if(confirm("Gỡ khỏi danh sách câu hỏi thường gặp ?"))
		{
			//thuc hien go bo
			document.change.idchange.value=id;
			document.change.typechange.value=0;
			document.change.page.value=ppage;
			document.change.submit();
		}
		else
		{
			 document.getElementById(obj.name).checked = 1;
		}
	}
}

//ta