// JavaScript Document
function $(id)
{
	if(typeof(id)=="string")
	{
		return document.getElementById(id);
	}
	return id;
}

//北大法宝搜索 
function SearchBDFB_Select(objSelect,objItem1,objItem2,objItem3,objItem4,objItem5)
{
	$(objSelect).className="sousuo-Select";
	$(objItem1).className="sousuo-NoSelect";
	$(objItem2).className="sousuo-NoSelect";
	$(objItem3).className="sousuo-NoSelect";
	$(objItem4).className="sousuo-NoSelect";
	$(objItem5).className="sousuo-NoSelect";
	
	
	document.getElementById("BDFBSearch").action="http://www.pkulaw.cn";
	if (objSelect=="ItemLaw")
	{
		$("SearchText").innerHTML="法律法规检索：";
		$("menu_item").value="law";

	}
	if (objSelect=="ItemCase")
	{
		
		$("SearchText").innerHTML="司法案例检索：";
		$("menu_item").value="case";
	}
	
	if (objSelect=="ItemBook")
	{
		$("SearchText").innerHTML="法学期刊检索：";
		$("menu_item").value="journal";
	}
	if (objSelect=="ItemRef")
	{
		$("SearchText").innerHTML="专题参考检索：";
		$("menu_item").value="reference";
	}
	if (objSelect=="ItemEng")
	{
//		document.getElementById("BDFBSearch").action="http://en.pkulaw.cn";
//		$("SearchText").innerHTML="英文译本检索：";
//		$("menu_item").value="";
        window.open("http://en.pkulaw.cn")
	}
		if (objSelect=="ItemVideo")
	{
//		document.getElementById("BDFBSearch").action="http://vlib.pkulaws.com/";
//		$("SearchText").innerHTML="法宝视频检索：";
//        $("menu_item").value="";
         window.open("http://v.pkulaw.cn/")
	}
	
	
}

//法学文献、法律动态、法学论坛 搜索 
function SearchArticle_Select(objSelect,objItem1,objItem2,objItem3)
{
	$(objSelect).className="indexLeft-Select";
	$(objItem1).className="indexLeft-NoSelect";
	$(objItem2).className="indexLeft-NoSelect";
	if(objSelect=="ItemArticle")
	{
		$("FormAction").value="http://article.chinalawinfo.com/Article_List.asp"
	}	
	if(objSelect=="ItemFLDT")
	{
		$("FormAction").value="/fzdt/NewsList.aspx"
	}
	if(objSelect=="ItemForum")
	{
		$("FormAction").value="http://forum.chinalawinfo.com/"
	}
}

function funRightSearch()
{
	var strKeyWord=document.getElementById("FormRightSearch").KeyWord.value;
	
	
	 if (strKeyWord=="")
	 {
		alert("请输入要检索的关键字！")
		document.FormRightSearch.KeyWord.focus();
		return false;
	 }
	 else
	 {
		 document.getElementById("FormRightSearch").action=$("FormAction").value;
 		 document.getElementById("txtkeyword").value=document.getElementById("KeyWord").value  ;
		 document.getElementById("FormRightSearch").submit();
		 return true;
	 }
}


//公告 显示 
function SearchNotice_Select(objSelect,objItem1,objItem2)
{
	$(objSelect).className="left-5";
	$(objItem1).className="left-4";
	$(objItem2).className="left-4";
	
	$("div"+objSelect).style.display="block";
	$("div"+objItem1).style.display="none";
	$("div"+objItem2).style.display="none";
}


function Search_TwoItem(objSelect,objItem1)
{
	$(objSelect).className="left-5";
	$(objItem1).className="left-4";
	
	
	$("div"+objSelect).style.display="block";
	$("div"+objItem1).style.display="none";
	
}
function Search_TwoColumnItem(objSelect,objItem1)
{
	$(objSelect).className="leftColumn_1";
	$(objItem1).className="leftColumn_2";
	
	
	$("div"+objSelect).style.display="block";
	$("div"+objItem1).style.display="none";
	
}

function checkLogin()
	{
	 
		if (document.loginform.username.value=="" || document.loginform.password.value=="")
		{
			alert ("用户名和密码不能为空！请重填。");
			document.loginform.username.focus();
		}
		else
		{
			v_UserName = document.loginform.username.value;
			//v_UserPwd=document.getElementById("password").value;
            v_UserPwd=document.loginform.password.value;            			
			//v_UserPwd =$("password").value;
			
			//alert()
			
			//alert(v_UserName);
			//alert(v_UserPwd)
			//alert($("loginselect").value);
			if ($("loginselect").value==1)
			{
				$("loginform").action="http://vip.chinalawinfo.com/CheckUserPassword.asp";
				$("loginform").target="_blank";
				$("loginform").submit();
			}
			if ($("loginselect").value==2)
			{
				$("loginform").action="http://article.chinalawinfo.com/CheckLogin.asp";
				$("loginform").target="_blank";
				$("loginform").submit();
			}
			if ($("loginselect").value==3)
			{
				$("loginform").action="http://journal.chinalawinfo.com/CheckLogin.asp";
				$("loginform").target="_blank";
				$("loginform").submit();
			}
			if ($("loginselect").value==4)
			{
				$("loginform").action="http://forum.chinalawinfo.com/login.asp?action=chk";
				$("loginform").target="_blank";
				$("loginform").submit();
			}
			
		}
	}
	
	function checkReg(){
		switch (document.all.loginselect.value){
			case "1":
				window.open("http://vip.chinalawinfo.com/userreg/baseinfo.asp","","");
				break;
			case "2":
				window.open("http://article.chinalawinfo.com/Reg_Detail.asp","","");
				break;
			case "3":
				window.open("http://journal.chinalawinfo.com/User_Licence.asp","","");
				break;
			case "4":
				window.open("http://forum.chinalawinfo.com/reg.asp","","");
				break;
		}
	}
	
	
	
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	
	function MM_showHideLayers() { //v6.0
	
	window.event.cancelBubble = true;
	
	$("sub01").style.display="block";
	  Fun_ShowMenu();
	  var i,p,v,obj,args=MM_showHideLayers.arguments;
	  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
	    obj.visibility=v; }
	}	
	
	function MM_SelectLayers(v_Value,v_Text)
	{
		document.getElementById("LoginSelValue").innerHTML = v_Text;
		document.getElementById("loginselect").value = v_Value;
		$("sub01").style.display="none";
	}
	function HiddLoginChose()
	{
		$("sub01").style.display="none";
	}
	
 function funBDFBSearch()
 {
	
	//alert(document.getElementById("BDFBSearch").action);
	
	var strKeyWord=document.getElementById("key_word").value;
	 if (strKeyWord=="")
	 {
		alert("请输入要检索的关键字！")
		document.getElementById("key_word").focus();
		return false;
	 }
	 else
	 {
		 document.getElementById("key_word").value=strKeyWord;
		 document.getElementById("BDFBSearch").submit();
		 return false;
	 }
	 
 }
 
 function Fun_ShowMenu() 
 {
	sPop=null;
	curShow=null;
	tFadeOut=null;
	tFadeIn=null;
	tFadeWaiting=null;	
	
	 var h;
	 var w;
	 var l;
	 var t;
	 var topMar = 1;
	 var leftMar = -2;
	 var space = 1;
	 var isvisible;
	 var MENU_SHADOW_COLOR='';
	 var global = window.document
	 global.fo_currentMenu = null
	 global.fo_shadows = new Array	
	 vSrc = window.event.srcElement;
	 h = vSrc.offsetHeight;

	w = vSrc.offsetWidth;
	l = vSrc.offsetLeft + leftMar+4;
	t = vSrc.offsetTop + topMar + h + space-2;
	
	vParent = vSrc.offsetParent;
	
	while (vParent.tagName.toUpperCase() != "BODY")
	{
		
		l += vParent.offsetLeft;
		t += vParent.offsetTop;
		vParent = vParent.offsetParent;
	}
	sub01.style.top = t;
	sub01.style.left = l+5;

}
function fontZoom(size)
{
 document.getElementById('fontzoom').style.fontSize=size+'px'
}

function showDiv(objId)
{
	var divTotalNum=document.getElementById("divTotalNum").value;

	for(var i=1;i<divTotalNum;i++)
	{
		document.getElementById("div"+i).style.display="none";
	}
	document.getElementById(objId).style.display="block";	
}


function RefushNum()
{
    document.getElementById("imgcheck").src=document.getElementById('imgcheck').src+'?'+Math.random();
}


function Search_Select(objSelect,objItem1,objItem2,objDivMoreID,MoreHref)
{
	$(objSelect).className="main-biaotiN";
	$(objItem1).className="main-biaoti";
	$(objItem2).className="main-biaoti";
	
	$("div"+objSelect).style.display="block";
	$("div"+objItem1).style.display="none";
	$("div"+objItem2).style.display="none";
	
	$("href"+objSelect).className="MenuClick";
	
    //alert($("href"+objSelect).className+'--'+objSelect)
	//alert($("href"+objItem1).className+'--'+objItem1)
	//alert($("href"+objItem2).className+'--'+objItem2)
	
	//跳转到北大法宝 页面 写效力级别--------------
	if(objSelect=="VipLaw")
	{
		$("PreSearchWhere").value="效力级别=%#XA01%";	
	}
	if(objSelect=="VipAdminRegul")
	{
		$("PreSearchWhere").value="效力级别=%#XC02%";	
	}
	if(objSelect=="VipJudInter")
	{
		$("PreSearchWhere").value="效力级别=%#XG04%";	
	}
	
	if(objSelect=="DepRules")
	{
		//alert("1");
	    document.xlform2.action="http://vip.chinalawinfo.com/newlaw2002/chl/index.asp";	
		document.xlform2.ResultID.value="1";
		document.xlform2.orderby.value="2"
		document.xlform2.PreSearchWhere.value="效力级别=%#XE03%";	
		//alert(document.xlform2.PreSearchWhere.value);
	}

   if(objSelect=="LocalLaws")
	{
		
		 document.xlform2.action="http://vip.chinalawinfo.com/newlaw2002/lar/index.asp";	
		//document.xlform2.PreSearchWhere.value="";	
		document.xlform2.ResultID.value="";
		document.xlform2.orderby.value=""
		
	}
	 
	 if(objSelect=="LegBackground")
	{
		
		 document.xlform2.action="http://vip.chinalawinfo.com/newlaw2002/lfbj/index.asp";	
		//document.xlform2.PreSearchWhere.value="";	
		document.xlform2.ResultID.value="";
		document.xlform2.orderby.value=""
	}
	//alert($("xlform2").action);
	
	
	//-------------------------------------------
	if(objSelect!="DepRules")
	{
		if (MoreHref!="")
		{
			$(objDivMoreID).innerHTML ="<a href='"+MoreHref+"' target=_blank>更多>></a>";
		}
		else
		{
			$(objDivMoreID).innerHTML ="<a href='#'>更多>></a>";
		}
	}
	else
	{
		$(objDivMoreID).innerHTML ="<a href='#' target='_blank' onclick='javascript:document.xlform2.submit();return false;'>更多>></a>";
	}

}

function Search_Select_TwoItem(objSelect,objItem1,objDivMoreID,MoreHref)
{
    
	$(objSelect).className="main-biaotiN";
	$(objItem1).className="main-biaoti";
	
	
	$("div"+objSelect).style.display="block";
	$("div"+objItem1).style.display="none";
	
	$("href"+objSelect).className="MenuClick";
	
	$(objDivMoreID).innerHTML ="<a href='"+MoreHref+"' target=_blank>更多>>&nbsp;</a>";	
}


function Search_Select_TwoItem_En(objSelect,objItem1,objDivMoreID,MoreHref)
{
    
	$(objSelect).className="main-biaotiN";
	$(objItem1).className="main-biaoti";
	
	
	$("div"+objSelect).style.display="block";
	$("div"+objItem1).style.display="none";
	
	
	
	$(objDivMoreID).innerHTML ="<a href='"+MoreHref+"' target=_blank>More>>&nbsp;&nbsp;</a>";	
}

function checkSearchForm()
{	//alert(document.SearchForm.Inv_flag.checked);
	if ((document.form4.f_Lawyer_flag.checked==false)&&(document.form4.f_Lawfirm_flag.checked==false))
	{
		alert("请选择查询范围！");
		return false;
	}
	document.form4.submit();
}

// 首页 案例分类导航
function SelectCaseNav(objSelect,ojbItem1,objItem2)
{
	$("div"+objSelect).style.display="block";
	$("div"+ojbItem1).style.display="none";
	$("div"+objItem2).style.display="none";
	
	
	
	$(objSelect).src="/images/jianhao.gif";	
	$(ojbItem1).src="/images/jiahao.gif";
	$(objItem2).src="/images/jiahao.gif";


}

