
// qa_11.0

function $(id){return document.getElementById(id)}

function qa(id,str) 
{
	var qa_content = $("qa_body_content_list_content"+id);
	var qa_content_img = $("qa_body_content_list_title_right_img_"+id);
	var arrContentDiv = new Array();
	arrContentDiv = document.getElementById("qa_body_content").getElementsByTagName("input");
	
	for(var i=1;i<=arrContentDiv.length;i++)
	{
	if(i!=id)	
		{
			$("qa_body_content_list_content"+i).style.display="none";
			$("qa_body_content_list_title_right_img_"+i).src="/img/jiahao.gif";
		}
	}
	
	if (qa_content.style.display=="none") 
	{
		qa_content.style.display="block";
		qa_content_img.src="/img/jiaNhao.gif";
		window.location.hash=str;
	}
	else 
	{
		qa_content.style.display="none";
		qa_content_img.src="/img/jiahao.gif";
		window.location.hash=str;
	}
}
function search()
{
	if (document.frm1.key.value=="")
	{
		window.alert("Please enter a key word.")
		document.frm1.key.focus();
		return;
	}
	else
	{
		document.frm1.submit();
	}
}

function checkall()
{
	var myRadio = document.questionform.type;
	
	var flag=false;
	for(var i=0;i<myRadio.length;i++)
		if(myRadio[i].checked){flag=true;break;}
	if(flag==false){alert("Choose a Type, Please!"); return false;}
	
	if (cTrim(document.questionform.Title.value,0)=="")
	{
		alert("Please enter a title.");
		document.questionform.Title.focus();
		return false;
	}
	else 
	{
		if(document.questionform.Title.value.length>200)
		{
			alert("Title must be fewer than 200 characters.");
			document.questionform.Title.focus();
			return false;
		}
	}
		
	//jian_chen 9-25
	if(document.questionform.Content.value.length>5000)
	{
		alert("Content must be fewer than 5000 characters.");
		document.questionform.Content.focus();
		return false;
	}
	
	//if (cTrim(document.questionform.Content.value,0)=="")
	//{
		//alert("There is no Content.");
		//document.questionform.Content.focus();
		//return false;
	//}
	//else 
		//{
		//if(document.questionform.Content.value.length>5000)
		//{
			//alert("The length of the Content must be less than 5000.");
			//document.questionform.Content.focus();
			//return false;
		//}
		//}
	document.questionform.submit();
}
