
// JavaScript Document
function showMenu(baseID, divID) {	
	baseID =  document.getElementById(baseID);
    divID  =  document.getElementById(divID);
		baseID.className="bk";
		divID.style.display="block";
	function show(){
		baseID.className="bk";
		divID.style.display="block";
		}
	function hide(){
			baseID.className="none";
			divID.style.display="none";
		}
	baseID.onmouseover= show;
	divID.onmouseover=show;
	baseID.onmouseout=hide;
	divID.onmouseout=hide;
}

function regInput(obj, reg, inputStr)
	{
		var docSel	= document.selection.createRange()
		if (docSel.parentElement().tagName != "INPUT")	return false
		oSel = docSel.duplicate()
		oSel.text = ""
		var srcRange	= obj.createTextRange()
		oSel.setEndPoint("StartToStart", srcRange)
		var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
		return reg.test(str)
	}

function tab(name,id,tab){
	for(var i=1;i<=tab;i++){
		var NewId=name+i;
		var NewsId=name+"s"+i;
		if(i!=id){
			document.getElementById(NewId).className="none";
			document.getElementById(NewsId).style.display="none";
				}else{
						document.getElementById(NewId).className="bg";
						document.getElementById(NewsId).style.display="block";
						}		
		}	
}

function tabs(name,id,tab,bg,bg_1){
	for(var i=1;i<=tab;i++){
		var NewId=name+i;
		var NewsId=name+"s"+i;
		if(i!=id){
			document.getElementById(NewId).className=bg_1;			
			document.getElementById(NewsId).style.display="none";
				}else{
						document.getElementById(NewId).className=bg;
						document.getElementById(NewsId).style.display="block";
						}		
		}	
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function check()
{
  if(checkspace(document.pinglunform.pinglunname.value)) {
	document.pinglunform.pinglunname.focus();
    alert("请填写您的姓名！");
	return false;
  }
  if(checkspace(document.pinglunform.pingluntitle.value)) {
	document.pinglunform.pingluntitle.focus();
    alert("请填写评论标题！");
	return false;
  }
  if(checkspace(document.pinglunform.pingluncontent.value)) {
	document.pinglunform.pingluncontent.focus();
    alert("请填写评论正文！");
	return false;
  }
	  }

