﻿window.onerror = ignoreError;
var oldobj=null;
var menuclass="";
var menucode="";
var selectnode="";
	var webPath="";
function IsDigit() 
{ 
return ((event.keyCode >= 48) && (event.keyCode <= 57)); 
} 
function ignoreError() {
  return true;
}
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_validateForm() 
{ //v4.0
  var i,p,q,nm,test,num,min,max,errors='',
  args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  { 
  	test=args[i+2]; 
  	val=MM_findObj(args[i]);
    if (val) 
    { 
    	nm=val.name; 
    	if ((val=val.value)!="") 
    	{
      		if (test.indexOf('isEmail')!=-1) 
      		{ 
      			p=val.indexOf('@');
        		if (p<1 || p==(val.length-1)) 
        			errors+='- '+nm+' must contain an e-mail address.\n';
      		} 
      		else 
      			if (test!='R') 
      			{ 
      				num = parseFloat(val);
        			if (isNaN(val)) 
        			{
        				errors+='- '+nm+' must contain a number.\n';
        			}
        			if (test.indexOf('inRange') != -1) 
        			{ 
        				p=test.indexOf(':');
          			  	min=test.substring(8,p); 
          			  	max=test.substring(p+1);
          				if (num<min || max<num) 
          				{
          					errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
          				}
    				}
    				
    			} 
    	} 
    	else 
    		if (test.charAt(0) == 'R') 
    		{
    			errors += '- '+nm+' sorry! 您忘记填写了.\n'; 
    		}
  	}
  } 
  if (errors) alert('下面的项目是必须填写的: \n \n'+errors);
  document.MM_returnValue = (errors == '');
}
		
//   var CalendarWebControl = new atCalendarControl();
var interValue,IfCloseAll;
function onclk()
{
		var d = new dialog();d.init();
		d.set('src','../images/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event("该功能还未开通！", 'window.close();','','');	

}
function scrollMenu(mDir,mStatus){
     
		var str = window.parent.main.cols;
		if(str == "130,*")
		{
			window.parent.main.cols="16,*";
      document.all("pimg").src='../images/zc_ly.gif';
		}
		else
		{
			window.parent.main.cols="130,*";
      document.all("pimg").src='../images/zc_gh.gif';
		}
}

function scrolle(m){
    if (m==0)
       top.left.scrollTo(0,0)
    else
       top.left.scrollTo(3000,3000)
}

function scroll_By(m){    
    if (m==0)
       top.left.scrollBy(-20,-20);
    else
       top.left.scrollBy(20,20);

}

function menuSwitch(m){
   if (m==0){
      top.document.all('MenuFrame').cols='0,9,*';
      }
   if (m==1){
      top.document.all('MenuFrame').cols='150,9,*';
     
      }
 }
 
function showMenu(){
    if (event.clientY<=20){
	     scrollMenu(0,0);
	     return;
	     }
	else
	   if ((document.body.clientHeight-event.clientY)<=20){
	       scrollMenu(1,0);
	       return;
	       }
    clearInterval(interValue);
}

function closeAll(){
	var i,subName;
	var myDiv=document.all.tags("div");	
	checkMenuState();
    if (IfCloseAll==0){
		for (i=0;i<myDiv.length;i++){
			if (myDiv(i).id!='D500'){			
			    var subName=myDiv(i).id.substr(1);
			    myDiv(i).style.display='none';
			    document.all('simg'+subName).style.display='';
				document.all('oimg'+subName).style.display='none'
				document.all('off'+subName).style.display='';
				document.all('on'+subName).style.display='none'; 
				IfCloseAll=1
				document.all.menuHome.title="打开所有菜单"
			}
		}
	}
	else{
		for (i=0;i<myDiv.length;i++){
			if (myDiv(i).id!='D500'){			
				var subName=myDiv(i).id.substr(1);
			    myDiv(i).style.display='block';
			    document.all('simg'+subName).style.display='none';
				document.all('oimg'+subName).style.display='block'
				document.all('off'+subName).style.display='none';
				document.all('on'+subName).style.display='block'; 
				IfCloseAll=0
				document.all.menuHome.title="关闭所有菜单"
			}
		}
	}
}

function checkMenuState(){
	var i;
	var myDiv=document.all.tags("div");	
	IfCloseAll=1
	for (i=0;i<myDiv.length;i++){
		if (myDiv(i).id!='D500'){
			if (myDiv(i).style.display!='none'){
				IfCloseAll=0;
				document.all.menuHome.title="关闭所有菜单";
			}
		}
	}
	if (IfCloseAll==1)
		document.all.menuHome.title="打开所有菜单"
}
function switchSysBar(){
	if (switchPoint.innerText==3){
		switchPoint.innerText=4
		document.all("mnuList").style.display="none"
		top.content.cols="10,*"
	}
	else{
		switchPoint.innerText=3
		document.all("mnuList").style.display=""				
		top.content.cols="150,*"		
	}
}
function vod()
{}

function onout()
{
	var obj=window.event.srcElement;
		obj.style.color="#C2D9ED";
	    obj.style.background="transparent url(\"../images/menu_off.gif\") no-repeat left top";
		obj.style.fontWeight="normal";
	
	}
function onov()
{	var obj=window.event.srcElement;
		obj.style.color="#FFFFFF";
	    obj.style.background="transparent url(\"../images/menu_over.gif\") no-repeat left top";
		obj.style.fontWeight="bold";
	
}
function div_onclick(id,code,http)
{
	var obj=window.event.srcElement;
	if(oldobj!=null)
	{
		oldobj.style.color="#C2D9ED";
	    oldobj.style.background="transparent url(\"../images/menu_off.gif\") no-repeat left top";
		oldobj.style.fontWeight="normal";
	oldobj.onmouseover=function anonymous(){onov()};
	oldobj.onmouseout=function anonymous(){onout()};

	}
	
	obj.style.color="#FFFFFF";
	obj.style.background="transparent url(\"../images/menu_over.gif\") no-repeat left top";
	obj.style.fontWeight="bold";
	oldobj=obj;
	obj.onmouseover=function anonymous(){onout()};
	obj.onmouseout=function anonymous(){onov()};
	
	while(obj.tagName!="DIV")
	{
		obj=obj.parentElement;
	}
	
	selectnode=id;
	
	for(var i=1;i<obj.children.length;i++)
	{

		if(obj.children(i).style.display=="none")
		{
			obj.children(i).style.display="#C2D9ED";
			obj.children(0).childNodes(0).firstChild.firstChild.firstChild.src=webPath+"menupic/a3.jpg" ;
			window.parent.mainFrame.location=http;
			
		}
		else
		{
			obj.children(i).style.display="none";
			obj.children(0).childNodes(0).firstChild.firstChild.firstChild.src=webPath+"menupic/a2.jpg" ;
			window.parent.mainFrame.location=http;
			
		}
	}
	window.parent.left.location=http;	
	
}


function onout1()
{
	var obj=window.event.srcElement;
		obj.style.color="#445588";
	    obj.style.background="url(\"../images/left_1.gif\")";
		obj.style.fontWeight="normal";
	}
  //onclick="return div_onclick('1','1','lookcote.aspx?id=1')"
function onov1()
{
	var obj=window.event.srcElement;
		obj.style.color="#ff7300";
	    obj.style.background="url(\"../images/left_2.gif\")";
		obj.style.fontWeight="bold";

	}
function div_onclick2(id,code,http)
{
	var obj=window.event.srcElement;
	if(oldobj!=null)
	{
		oldobj.style.color="#445588";
	    oldobj.style.background="url(\"../images/left_1.gif\")";
		oldobj.style.fontWeight="normal";
	oldobj.onmouseover=function anonymous(){onov1()};
	oldobj.onmouseout=function anonymous(){onout1()};
	}
	obj.style.background="url(\"../images/left_2.gif\")";
	
	obj.style.color="#ff7300";
	obj.style.fontWeight="bold";
	obj.onmouseover=function anonymous(){onout1()};
	obj.onmouseout=function anonymous(){onov1()};
	oldobj=obj;	
	selectnode=id;
	window.parent.mainFrame.location=http;		
}
function div_onclick1(id,code,http)
{

	var obj=window.event.srcElement;
	if(oldobj!=null)
	{
		oldobj.style.color="#3E465B";
	    oldobj.style.background="url(\"\")";
		oldobj.style.fontWeight="normal";
	oldobj.onmouseover=function anonymous(){onov2()};
	oldobj.onmouseout=function anonymous(){onout2()};
	}
	
	obj.style.background="url(\"../images/bg_3.gif\")";
	obj.style.fontWeight="bold";
	obj.onmouseover=function anonymous(){onout2()};
	obj.onmouseout=function anonymous(){onov2()};
	oldobj=obj;	
	selectnode=id;
	window.parent.mainFram.location=http;		
}

function onout2()
{
	var obj=window.event.srcElement;
		obj.style.color="#3E465B";
	    obj.style.background="transparent url(\"\") no-repeat left top";
		obj.style.fontWeight="normal";
	}
  //onclick="return div_onclick('1','1','lookcote.aspx?id=1')"
function onov2()
{
	var obj=window.event.srcElement;
	    obj.style.background="transparent url(\"../images/bg_3.gif\") no-repeat left top";
		obj.style.fontWeight="bold";

	}
function div_onclick3(id,code,http)
{

	var obj=window.event.srcElement;
	if(oldobj!=null)
	{
		oldobj.style.color="#3E465B";
	    oldobj.style.background="url(\"\")";
		oldobj.style.fontWeight="normal";
	oldobj.onmouseover=function anonymous(){onov2()};
	oldobj.onmouseout=function anonymous(){onout2()};
	}
	
	obj.style.background="url(\"../images/bg_3.gif\")";
	obj.style.fontWeight="bold";
	obj.onmouseover=function anonymous(){onout2()};
	obj.onmouseout=function anonymous(){onov2()};
	oldobj=obj;	
	selectnode=id;
	window.parent.mainFram.location=http;		
}

function div_onclick0(id,code,http)
{
	var obj=window.event.srcElement;
	if(oldobj!=null)
	{
		oldobj.style.color="black";
	    oldobj.style.background="transparent url(\"../images/menu_off.gif\") no-repeat left top";
		oldobj.style.fontWeight="normal";
	oldobj.onmouseover=function anonymous(){onov()};
	oldobj.onmouseout=function anonymous(){onout()};
	}
	
	obj.style.color="#FFFFFF";
	obj.style.background="transparent url(\"../images/menu_over.gif\") no-repeat left top";
	obj.style.fontWeight="bold";
	oldobj=obj;
	obj.onmouseover=function anonymous(){onout()};
	obj.onmouseout=function anonymous(){onov()};
	
	while(obj.tagName!="DIV")
	{
		obj=obj.parentElement;
	}
	
	selectnode=id;
	
	for(var i=1;i<obj.children.length;i++)
	{

		if(obj.children(i).style.display=="none")
		{
			obj.children(i).style.display="block";
			obj.children(0).childNodes(0).firstChild.firstChild.firstChild.src=webPath+"menu_over.gif" ;
			window.parent.mainFrame.location=http;
			
		}
		else
		{
			obj.children(i).style.display="none";
			obj.children(0).childNodes(0).firstChild.firstChild.firstChild.src=webPath+"menupic/a2.jpg" ;
			window.parent.mainFrame.location=http;
			
		}
	}
	
	window.parent.mainFrame.location=http;
	
}
	function alink(http){	
		window.location=http;
//		window.status=date();
	}
	function mfrmlink(http){	
		window.parent.mainFrame.location=http;
	}
	function delc(http){	
	if(confirm("你确定此操作吗?"))
	{
		window.location=http;
	 }
	else{ 
	return false;
	}
	}
//选择律师事务所
function getEnterPrises(WinURL,WinName,wh,ht){
var xposition=0; 
var yposition=0;
    xposition = (screen.width - 700) / 2;
    yposition = (screen.height - 530) / 2;
 window.open(WinURL,WinName,'width='+wh+',height='+ht+',left='+xposition+',top='+yposition+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0')
 return false;
} 
function MyselTime(obj)
                {
                showDatePicker(event.srcElement.parentElement.parentElement.cells[0].children(0),obj);
                }
                function selRows(obj)
                {
                if(obj.parentElement.style.backgroundColor=='#B9D6F4')//red
                {
                obj.parentElement.style.backgroundColor='#B9D6F4';//#ffffff
                }
                else
                {
                obj.parentElement.style.backgroundColor='#B9D6F4';//red
                }
                }
                function selcell(obj)
                {
                if(obj.color=='1')
                {
                obj.color='0';
                selColor(obj,'');
                }
                else
                {
                obj.color='1';
                //selColor(obj,red);
                selColor(obj,'#B9D6F4');
                }
                }
                function selColor(obj,Color)
                {
                var cNum=obj.cellIndex;//+2;
                for(var n=1;n<table1.rows.length;n++)
                {
                table1.rows[n].cells[cNum].style.backgroundColor=Color;
                }
                }
function go(ctrl,max){        
  if(ctrl.value >= 1 && ctrl.value <= max){    
          var url;              
          var index;         
          url = location.href;     
          index = url.indexOf('?');   
          if(index == -1){}     
          else{          
            url = url.substring(0,index);    
          }                 
		frms.submit();
         // location.href = url + '?page=' + ctrl.value;     
  }                    
  else{                              
    alert('您输入的页码必须是符合页面要求的数字,最大值是：' + max);  
    return false;                          
  }                         
}      
   function ldck(){ 
//frms.lawids.value=opener.frms.lawids.value;
frms.lawnms.value=opener.frms.lawnms.value;
if(frms.lawnms.value.indexOf('全部人员')!=-1)
{
frms.lawnms.value=frms.lawnms.value.substring(frms.lawnms.value.indexOf('全部人员')+4,frms.lawnms.value.length);
}
    if(frms.del != null){          
        frms.all.checked=true;
      for(var i=0;i<frms.del.length;i++){  
        frms.del[i].checked=true;  
         if(frms.lawnms.value.indexOf(frms.del[i].alt+',')==-1)
        {
        frms.del[i].checked=false; 
        frms.all.checked=false;
        }
      }          
    }    
}
   function ldck1(){ 
    if(frms.del != null){          
        frms.all.checked=true;
      for(var i=0;i<frms.del.length;i++){  
        frms.del[i].checked=true;  
         if(frms.lawnms.value.indexOf(frms.del[i].alt+',')==-1)
        {
        frms.del[i].checked=false; 
        frms.all.checked=false;
        }
      }          
    }    
}
function allck(obj){   
  if(frms.del != null){          
      for(var i=0;i<frms.del.length;i++){  
        frms.del[i].checked=obj.checked;  
			if(obj.checked)
			{
			  if(frms.lawnms.value.indexOf(frms.del[i].alt+',')==-1){
				// frms.lawids.value=frms.lawids.value+frms.del[i].value+',';
				frms.lawnms.value=frms.lawnms.value+frms.del[i].alt+',';
			  }
			  frms.ckd.value=1;
			}
			else
			{
			  if(frms.lawnms.value.indexOf(frms.del[i].alt+',')!=-1){
				// frms.lawids.value=frms.lawids.value.replace(frms.del[i].value+',','');
				frms.lawnms.value=frms.lawnms.value.replace(frms.del[i].alt+',','');
			  }
			  frms.ckd.value=0;
			} 
      }          
        frms.all.checked=obj.checked;                       
  }            
}   
function ckclick(obj){   
	if(obj.checked)
	{
		
			  if(frms.lawnms.value.indexOf(obj.alt+',')==-1){
		frms.lawnms.value=frms.lawnms.value+obj.alt+',';
			  }
	}
	else
	{
			  if(frms.lawnms.value.indexOf(obj.alt+',')!=-1){
		frms.lawnms.value=frms.lawnms.value.replace(obj.alt+',','');
			  }
	}          
} 
function getlaws(){	
  opener.frms.lawids.value = frms.lawids.value;
  opener.frms.lawnms.value = frms.lawnms.value;
window.close();
	}  
function getlaws1(){	
  opener.frms.lawids.value =frms.lawtp.value;
  opener.frms.lawnms.value =frms.txts.value;
window.close();
	} 
function getlaws2(){
  opener.frms.lawids.value = frms.lawid.value;
  opener.frms.lawnms.value = frms.lawnm.value;
window.close();
	}  
  function getEP(id,name,sfj){
  
	if(opener.frms.nocjs.value.indexOf(',')<0)
	{
	if(opener.frms.nocjs.value.indexOf(name)<0)
	{
if(opener.frms.nocjs.value.length>2)
{
name=opener.frms.nocjs.value+','+name;
id=opener.frms.noswsid.value+'#'+id;
}
  opener.frms.nocjs.value = name;
  opener.frms.noswsid.value = id;
  }
  else
  {
  opener.frms.noswsid.value = opener.frms.noswsid.value.replace(id,'');
  opener.frms.nocjs.value=opener.frms.nocjs.value.replace(name,'');
  }
	}
	else
	{
	if(opener.frms.nocjs.value.indexOf(','+name)<0 && opener.frms.nocjs.value.indexOf(name+',')<0)
	{
if(opener.frms.nocjs.value.length>2)
{
name=opener.frms.nocjs.value+','+name;
id=opener.frms.noswsid.value+'#'+id;
}
  opener.frms.nocjs.value = name;
  opener.frms.noswsid.value = id;
  }
  else
  {
  opener.frms.noswsid.value = opener.frms.noswsid.value.replace('#'+id,'');
  opener.frms.noswsid.value = opener.frms.noswsid.value.replace(id+'#','');
  opener.frms.nocjs.value=opener.frms.nocjs.value.replace(','+name,'');
  opener.frms.nocjs.value=opener.frms.nocjs.value.replace(name+',','');
  }
}
window.close();
	}          
function allclick(obj){   
  if(frms.del != null){     
    if(frms.del.length >= 2){    
      for(var i=0;i<frms.del.length;i++){      
        frms.del[i].checked=obj.checked;  
        frms.all.checked=obj.checked;
        frms.all1.checked=obj.checked; 
      }          
    }     
    else{    
      frms.del.checked=obj.checked; 
      frms.all.checked=obj.checked;  
      frms.all1.checked=obj.checked; 
    }                    
  }            
}         
  function sub_mit(str)
    {
    	frms.clickd.value = str;
    	frms.submit();
    }
    function sub_del()
    {
    	var num = confirm('你确定要删除所选项?');
    	if(num == true)
    	{
frms.delstxt.value = "del";
        	frms.submit();
        }else
        {
frms.delstxt.value = "del";
        }
	}  
	document.writeln("	<script language=\"vbscript\">");
document.writeln("	<!--");
document.writeln("	sub bb(obj)");
document.writeln("if document.getElementById(obj) is nothing then");
document.writeln("exit sub");
document.writeln("end if");
document.writeln("if document.getElementById(obj).style.display=\"none\" then");
	   document.writeln("     document.getElementById(obj).style.display=\"block\"");
document.writeln("document.getElementById(\"img\" & mid(obj,3)).src=\"../image/menu_open.gif\"");
	 document.writeln("   else");
	 document.writeln("       document.getElementById(obj).style.display=\"none\"");
	 document.writeln("       document.getElementById(\"img\" & mid(obj,3)).src=\"../image/menu_close.gif\"");
	document.writeln("    end if");
	document.writeln("end sub");
	document.writeln("//-->");
	document.writeln("	</script>");
