function openWindow(strUrl,sw,sh,strTitle){
	if(!strUrl)return false;
	if(!strTitle)strTitle="";
	if(strUrl.indexOf("?")>-1){
		strUrl=strUrl+"&sh="+sh+"&sw="+sw
	}else{
		strUrl=strUrl+"?sh="+sh+"&sw="+sw
	}
	top.Thickenbox.tb_showframe(strUrl,strTitle);
}

function closeWindow(){try{top.Thickenbox.tb_close();}catch(e){}}

function getBestSelectCnt(form2)
{
	var bs = form2.bestAnswerID;
	if(!bs) return 0;
	
	var cnt = 0;
	if(bs.length)
	{
		for(var i=0; i<bs.length; i++)
			if(bs[i].checked) cnt++;
	}
	else
	{
		if(bs.checked) cnt++;
	}		
	return cnt;
}
function checkBestStar(checkbox,sID)
{
	var selCnt = getBestSelectCnt(checkbox.form);
	if (checkbox.checked){
		if (selCnt<3){
            document.getElementById(sID).style.display="";
        } else {
			alert('您最多只能选择两个满意答案。');
			checkbox.checked=false;
		}
	} else {
		document.getElementById(sID).style.display="none";
    }
}
function checkBestAnswerSubmit(form2)
{
	var selCnt = getBestSelectCnt(form2);
	if(selCnt <= 0)
	{
		alert('请选择满意答案。');
		return false;
	}
	else if(selCnt > 2)
	{
		alert('您最多只能选择两个满意答案。');
		return false;
	}
	//return true;
	return confirm('您确定将此答案采纳为最佳答案吗?');
}

function checkDelAnswer(s)
{
	if(confirm('您确定要删除此答案吗?')){_hideframe.location=s;return true;}return false;
}
function checkDelComment(s)
{
	if(confirm('您确定要删除此评论吗?')){_hideframe.location=s;return true;}return false;
}