function getObj(objId) {
	return document.getElementById(objId);
}

function initHot() {
	panel = getObj("panelHot");
	panel.style.display = "none";
}

function switchHot() {
	panel = getObj("panelHot");
	if (panel.style.display == "none") {
		panel.style.display = "block";
	} else {
		panel.style.display = "none";
	}
}

function initSearch() {
	panel = getObj("panelSearch");
	panel.style.display = "none";
}

function switchSearch() {
	panel = getObj("panelSearch");
	if (panel.style.display == "none") {
		panel.style.display = "block";
		document.forms.search.Keywords.focus();
	} else {
		q = document.forms.search.Keywords.value;
		if (q != "") {
			document.forms.search.submit();
		} else {
			panel.style.display = "none";
		}
	}
}
function qoute(id)
 {
 document.myform.content.focus();
 document.myform.content.value+="[quote]"+id+"[/quote]\n";
 document.myform.content.focus();
 }
 
function reply_quotes(id)
{
 reply_clearfield();
 document.myform.content.focus();
 document.myform.content.value+="[quote]"+id+"[/quote]\n";
 document.myform.content.focus();
}
 
function reply_sustain(id)
{
 reply_clearfield();
 document.myform.content.focus();
 document.myform.content.value+="[quote]"+id+"[/quote]\n";
 document.myform.content.focus();
}
 
function reply_clearfield()
{
 if (document.myform.content.value == tip)
 {
  document.myform.content.value = "";
 }
}
var tip = "";

 function replaceElementInnerHTML(TagId,sTagId){
	document.getElementById(TagId).innerHTML = document.getElementById(sTagId).innerHTML;
	document.getElementById(sTagId).innerHTML = "";
}
function check(obj) {
	if(document.myform.content.value=='') { 
		alert('请输入评论内容');
		document.myform.content.focus();
		return false;
	} else if(document.myform.content.value.length > 2000) { 
		alert('评论内容太长，字数不得超过2000');
		document.myform.content.focus();
		return false;
	}

	obj.disabled=true; 
	document.myform.submit();
}
