function setsrch(c){
	for(i=0;i<=2;i++){
		document.getElementById("stab"+i).className = "";
	}
	c.className = "so1";
	if(c.id=="stab0"){
	document.getElementById("searchq").style.display="";
	document.getElementById("searchq1").style.display="none";
	document.getElementById("searchq2").style.display="none";
		document.getElementById("stab10").innerHTML='书籍名称';
		document.getElementById("stab11").innerHTML='<a title="按作者名称搜索书籍"  href="javascript:void(0);" target=_self class="so2">作者名称</a>';
		document.getElementById("stab12").innerHTML='<a title="按主角名称搜索书籍"  href="javascript:void(0);" target=_self class="so2">主角名称</a>';
		document.srchfrm.action="name";document.srchfrm.q.value="请输入书籍名称关键字！";
		 if(document.srchfrm.q.value=='请请输入书籍名称关键字！'){
			 document.srchfrm.q.style.color='#989797';
		}
	}
	if(c.id=="stab1"){
	document.getElementById("searchq").style.display="none";
	document.getElementById("searchq1").style.display="";
	document.getElementById("searchq2").style.display="none";
		document.getElementById("stab10").innerHTML='<a title="按书籍名称搜索"  href="javascript:void(0);" target=_self class="so2">书籍名称</a>';
		document.getElementById("stab11").innerHTML='作者名称';
		document.getElementById("stab12").innerHTML='<a title="按主角名称搜索书籍"  href="javascript:void(0);" target=_self class="so2">主角名称</a>';
		document.srchfrm.action="author";document.srchfrm.q1.value="请输入作者名称关键字！";
		 if(document.srchfrm.q1.value=='请输入作者名称关键字！'){
			document.srchfrm.q1.style.color='#989797';
		}
	}

	if(c.id=="stab2"){
	document.getElementById("searchq").style.display="none";
	document.getElementById("searchq1").style.display="none";
	document.getElementById("searchq2").style.display="";
		document.getElementById("stab10").innerHTML='<a title="按书籍名称搜索"  href="javascript:void(0);" target=_self class="so2">书籍名称</a>';
		document.getElementById("stab11").innerHTML='<a title="按作者名称搜索书籍"  href="javascript:void(0);" target=_self class="so2">作者名称</a>';
		document.getElementById("stab12").innerHTML='主角名称';
		document.srchfrm.action="director";document.srchfrm.q2.value="请输入主角名称关键字！";
		 if(document.srchfrm.q2.value=='请输入主角名称关键字！'){
			document.srchfrm.q2.style.color='#989797';
		}
	}
}

function submitForm(){
	if(document.srchfrm.action=='name'){
		var fundvalue=document.srchfrm.q.value;
		fundvalue=fundvalue.valueOf();
		if(fundvalue>=1 && document.srchfrm.q.value.length==6){
			top.location.href= "/modules/article/search.php?searchkey="+document.srchfrm.q.value+"";
			//window.open("/modules/article/search.php?searchkey="+document.srchfrm.q.value) ;
		}else{
			top.location.href= "/modules/article/search.php?searchkey="+document.srchfrm.q.value+"";
			//window.open("/modules/article/search.php?searchkey="+document.srchfrm.q.value) ;
		}
	}else if(document.srchfrm.action=='director'){
		top.location.href= "/modules/article/search.php?searchkey="+document.srchfrm.q2.value+"";
		//window.open("/modules/article/search.php?searchkey="+document.srchfrm.q2.value);
	}else if(document.srchfrm.action=='author'){
		top.location.href= "/modules/article/search.php?searchkey="+document.srchfrm.q1.value+"";
		//window.open("/modules/article/search.php?searchkey="+document.srchfrm.q1.value);
	}
}

