function showNews(cates,rcount,img,dep,divName){  
   var ncate = cates;
   var dd=""; 
   var divobject = divName; 
   try{	
	var option={
		parameters:"action=news&cate="+ncate+"&RCount="+rcount+"&dep="+dep,
		method:"get",
		onSuccess:function(transport){		   
			var rp=transport.responseText;
			//alert(transport.getResponseHeader("X-Prototype-Version"));	
			var NArray =rp.split(";");	 
			var news_Id = NArray[2].split(","); 
			var news_Title= NArray[0].split(",");
			var news_Time = NArray[1].split(",");			
	        var newList = '<ul>\r\n';
		    var showNews_count = 5; 
		    var fontLenght=47;
		    switch (divName)
		     {
		       case "div_commonlaw":
		         fontLength =22;
		         showNews_count=7;
		         for(var i=0;i<showNews_count;i++)
		          {		        
		            newList = newList + "<div id=\"MiddleLeftChannelOneMiddleImg\"><img src=\"http://www.tzjjjx.com/img/web/images/icon_arrow2.gif\"></div><li><a href=\"javascript:MM_openBrWindow('http://www.tzjjjx.com/ShowNewsDetails.aspx?pid=" + news_Id[i] + "','view','width=530,height=250,resizable=yes,scrollbars=yes')\" class=\"Master_link02\">" + getsubstr(news_Title[i],fontLength) + "...</a></li>\r\n";		    
		          }			     	
		         newList = newList + "<ul>\r\n";
		         $(divName).innerHTML = newList;			        
		         break;
		      
		       default:
		        fontLength=47;
		        showNews_count=parseInt(rcount,10);
		        var psrc ="img/"+img;
		       
		        for(var i=0;i<showNews_count;i++)
		          {		        
		            newList = newList + "<div class=\PageTop-Middle-Context-IMG\><img src="+psrc+ "></div> <li><a href=ShowInfo.htm?pid=" + news_Id[i] +">" + getsubstr(news_Title[i],fontLength) + "</a></li><div class=\"PageTop-Middle-Context-Time\">"+news_Time[i]+"</div>\r\n";		    
		          }			     	
		         newList = newList + "<ul>\r\n";
		         $(divName).innerHTML = newList;
		        break;
		     }	    	              
		    },
		onFailure:function(transport){		
		 alert('dd');	
			
		}
	}	
	var request=new Ajax.Request("ajax/LoadData.aspx",option);	
	return;}
    catch(e){
	return;
	}
}
function showTNews(cates,rcount,img,dep,divName){  
   var ncate = cates; 
   var divobject = divName; 
   try{	
	var option={
		parameters:"action=tnews&cate="+ncate+"&RCount="+rcount+"&dep="+dep,
		method:"get",
		onSuccess:function(transport){		   
			var rp=transport.responseText;
			//alert(transport.getResponseHeader("X-Prototype-Version"));	
			var NArray =rp.split(";");	 
			var news_Id = NArray[2].split(","); 
			var news_Title= NArray[0].split(",");
			var news_Time = NArray[1].split(",");			
	        var newList = '<ul>\r\n';
		    var showNews_count = 5; 
		    var fontLenght=47;
		    switch (divName)
		     {
		       case "div_commonlaw":
		         fontLength =22;
		         showNews_count=7;
		         for(var i=0;i<showNews_count;i++)
		          {		        
		            newList = newList + "<div id=\"MiddleLeftChannelOneMiddleImg\"><img src=\"http://www.tzjjjx.com/img/web/images/icon_arrow2.gif\"></div><li><a href=\"javascript:MM_openBrWindow('http://www.tzjjjx.com/ShowNewsDetails.aspx?pid=" + news_Id[i] + "','view','width=530,height=250,resizable=yes,scrollbars=yes')\" class=\"Master_link02\">" + getsubstr(news_Title[i],fontLength) + "...</a></li>\r\n";		    
		          }			     	
		         newList = newList + "<ul>\r\n";
		         $(divName).innerHTML = newList;			        
		         break;
		      
		       default:
		        fontLength=47;
		        showNews_count=parseInt(rcount,10);
		        var psrc ="img/"+img;
		       
		        for(var i=0;i<showNews_count;i++)
		          {		        
		            newList = newList + "<div class=\PageTop-Middle-Context-IMG\><img src="+psrc+ "></div> <li><a href=ShowInfo.htm?pid=" + news_Id[i] +">" + getsubstr(news_Title[i],fontLength) + "</a></li><div class=\"PageTop-Middle-Context-Time\">"+news_Time[i]+"</div>\r\n";		    
		          }			     	
		         newList = newList + "<ul>\r\n";
		         $(divName).innerHTML = newList;
		        break;
		     }	    	              
		    },
		onFailure:function(transport){		
		 alert('dd');	
			
		}
	}	
	var request=new Ajax.Request("ajax/LoadData.aspx",option);	
	return;}
    catch(e){
	return;
	}
}

function showCommonNews(cates,rcount,img,dep,divName){  
   var ncate = cates; 
   var divobject = divName; 
   try{	
	var option={
		parameters:"action=news&cate="+ncate+"&RCount="+rcount+"&dep="+dep,
		method:"get",
		onSuccess:function(transport){		   
			var rp=transport.responseText;
			//alert(transport.getResponseHeader("X-Prototype-Version"));	
			var NArray =rp.split(";");	 
			var news_Id = NArray[2].split(","); 
			var news_Title= NArray[0].split(",");
			var news_Time = NArray[1].split(",");			
	        var newList = '<ul>\r\n';
		    var showNews_count = 5; 
		    var fontLenght=47;
		    switch (divName)
		     {
		      case "TopNews":
		      fontLength=47;
		        showNews_count=parseInt(rcount,10);
		        var psrc ="img/"+img;
		       
		        for(var i=0;i<showNews_count;i++)
		          {		        
		            if (typeof(news_Id[i])=='undefined')
		            break;
		            newList = newList + "<div class=\PageTop-Middle-Context-IMG\><img src="+psrc+ "></div> <li><a href=ShowInfo.htm?pid=" + news_Id[i] +">" + getsubstr(news_Title[i],fontLength) + "</a></li><div class=\"PageTop-Middle-Context-Time\">"+news_Time[i]+"</div>\r\n";		    
		          }			     	
		         newList = newList + "<ul>\r\n";
		         $(divName).innerHTML = newList;		      
		      break;
		       case "div_Notice":
		         fontLength =22;
		         showNews_count=8;
		          var psrc ="img/"+img;
		         for(var i=0;i<showNews_count;i++)
		          {		        
		            if (typeof(news_Id[i])=='undefined')
		            {
		            news_Title[i]="";
		            news_Time[i]="";          
		           
		            }
		            newList = newList + "<div class=\CommonNewsIMG\><img src="+psrc+ "></div> <li><a href=ShowInfo.htm?pid=" + news_Id[i] +" >" + getsubstr(news_Title[i],fontLength) + "</a></li><div class=\"PageTop-Middle-Context-Time1\">"+news_Time[i]+"</div>\r\n";		
		          }			     	
		         newList = newList + "<ul>\r\n";
		         $(divName).innerHTML = newList;			        
		         break;
		         case "div_qyfc":
		         fontLength =30;
		         showNews_count=8;
		          var psrc ="img/"+img;
		         for(var i=0;i<showNews_count;i++)
		          {		        
		            newList = newList + "<div class=\CommonNewsIMG\><img src="+psrc+ "></div> <li><a href=ShowInfo.htm?pid=" + news_Id[i] +" >" + getsubstr(news_Title[i],fontLength) + "</a></li>\r\n";		
		          }			     	
		         newList = newList + "<ul>\r\n";
		         $(divName).innerHTML = newList;			        
		         break;
		         
		        case "Middle-RC-Active-C":
		         fontLength =16;
		         showNews_count=3;		          
		         for(var i=0;i<showNews_count;i++)
		          {	
		            var ii=i+1;
		            var psrc ="img/"+img+ii.toString()+".gif";		            	        
		            newList = newList + "<li><span class=PageTop-Right-Context-Icon><IMG src="+psrc+ "></span><a href=ShowInfo.htm?pid=" + news_Id[i] +" >" + getsubstr(news_Title[i],fontLength) + "</a></li>\r\n";		
		          }			     	
		         newList = newList + "<ul>\r\n";
		         $(divName).innerHTML = newList;			        
		         break;	         
		         case "dzkw":
		         fontLength =16;
		         showNews_count=8;		          
		         for(var i=0;i<showNews_count;i++)
		          {	
		            var ii=i+1;
		            var psrc ="img/"+img+ii.toString()+".jpg";		            	        
		            newList = newList + "<li><span class=PageTop-Right-Context-Iconc><IMG src="+psrc+ "></span><a href=ShowInfo.htm?pid=" + news_Id[i] +" >" + getsubstr(news_Title[i],fontLength) + "</a></li>\r\n";		
		          }			     	
		         newList = newList + "<ul>\r\n";
		         $(divName).innerHTML = newList;			        
		         break;
		        
		       default:
		        fontLength=34;
		        showNews_count=parseInt(rcount,10);
		        var psrc ="img/"+img;
		       
		        for(var i=0;i<showNews_count;i++)
		          {	
		            if (typeof(news_Id[i])=='undefined')
		            break;   
		            newList = newList + "<div class=\CommonNewsIMG\><img src="+psrc+ "></div> <li class=\CommonNewsLh\><a href=ShowInfo.htm?pid=" + news_Id[i] +" >" + getsubstr(news_Title[i],fontLength) + "</a></li><div class=\"PageTop-Middle-Context-Time\">"+news_Time[i]+"</div>\r\n";		    
		          }			     	
		         newList = newList + "<ul>\r\n";
		         $(divName).innerHTML = newList;
		        break;
		     }	    	              
		    },
		onFailure:function(transport){		
		 alert('dd');	
			
		}
	}	
	var request=new Ajax.Request("ajax/LoadData.aspx",option);	
	return;}
    catch(e){
	return;
	}
}


function getsubstr(str,len)
{
 if(strLength(str)<=len)
    return str;
  var strLen=0;
  var newstr='';
  for(var i=0;i<str.length;i++)
  {
    if(str.charCodeAt(i)>256)
    {
	  strLen+=2;
	}
	else
	{
	  strLen++;
	}
	newstr=newstr+str.substr(i,1);
	if(strLen==len)
	{
	 return  newstr;
	}
	if(strLen>len)
	{
	 return newstr.substr(0,newstr.length-1);
	}
  }
}

function strLength(astr)
{
    var strLen=0;
    if(astr)
    {
        for(var k=0;k<astr.length;k++)
        {
            if(astr.charCodeAt(k)>256)
            {
                strLen+=2;
            }
            else
            {
                strLen++;
            }
        }
    }
    return strLen;
}
