﻿// 隔行换色, 鼠标经过换色
function turncolor(id,cl1,cl2,cl3)  //列表ID , 奇数行样式 , 偶数行样式 ,  鼠标经过样式
    {
        var zonvan=document.getElementById(id).getElementsByTagName("tr");
        for(var i=0;i<zonvan.length;i++){
            zonvan[i].className=(i%2==0)?cl1:cl2;
            zonvan[i].onmouseover=function(){
                this.className=cl3;
                }
            zonvan[i].onmouseout=function(){
                 for(var i=0;i<zonvan.length;i++){
                     zonvan[i].className=(i%2==0)?cl1:cl2;
                     }
                }
            }
    }

/*    截取字符串*/
function ReSetString(str,length)
{
    if(str=="")
    {
        document.write ("&nbsp");
    }
    else
    {
        str.length>length?document.write(str.substring(0,length)+"..."):document.write (str);
    }
}

function showact(id){
  window.open("activityview.asp?id="+id,"_blank","top=100,left=300,width=530,height=450,scrollbars=no,resizable=yes");
 }

function shownews(newsid){
  window.open("newsview.asp?newsid="+newsid,"_blank");
 }
 
function shownewspaper(newsid){
  window.open("newspaperview.asp?newsid="+newsid,"_blank");
 }
 
function showharvest(newsid){
  window.open("harvestview.asp?newsid="+newsid,"_blank");
 }
 
function showyearharvest(newsid){
  window.open("yearharvestview.asp?newsid="+newsid,"_blank");
 }

