/*按比例生成缩略图*/
function DrawImage(MyPic,W,H){
  var flag=false;
  var image=new Image();
  image.src=MyPic.src;
  if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= W/H){
      if(image.width>W){  
        MyPic.width=W;
        MyPic.height=(image.height*W)/image.width;
      }
	  else{
        MyPic.width=image.width;  
        MyPic.height=image.height;
      }
    }
    else{
      if(image.height>H){  
        MyPic.height=H;
        MyPic.width=(image.width*H)/image.height;     
      }
	  else{
        MyPic.width=image.width;  
        MyPic.height=image.height;
      }
    }
  }
} 

//无图时显示的错误图片
//调用非法：
//在img里面加onerror="nofind();"
//作者:itlobo 邮箱i@itlobo.com
<!--   
	function nofind(){   
		var img=event.srcElement;   
		img.src="../images/nopic.jpg";   
	}   
//没有找到时 用事件获取 一个一个获取   
//-->  

//经过变色
//调用方法，在img属性加上onmouseover="this.style.filter='alpha(opacity=100)';high(this)" onmouseout="low(this)"
function high(which2){
	theobject=which2;theobject.filters.alpha.opacity=0
	highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
	clearInterval(highlighting)
	which2.filters.alpha.opacity=100
}
function highlightit(cur2){
	if(cur2.filters.alpha.opacity<100)
		cur2.filters.alpha.opacity+=15
	else if(window.highting)
		clearInterval(highlighting)
}

function secBoard(n){
	for(i=0;i<secTable.cells.length;i++){
		secTable.cells[i].className="t"+i;
		//secTable.cells[i].className="m"+i;
	}
		secTable.cells[n].className="tt"+n;
		//secTable.cells[n].className="mm"+n;
		for(i=0;i<2;i++){
			document.getElementById("itlobo"+i).style.display="none";
			document.getElementById("itlobo"+n).style.display="block";
		}
}

function secBoard2(n){
	for(i=0;i<secTable.cells.length;i++){
		//secTable.cells[i].className="t"+i;
		secTable.cells[i].className="m"+i;
	}
		//secTable.cells[n].className="tt"+n;
		secTable.cells[n].className="mm"+n;
		for(i=0;i<2;i++){
			document.getElementById("itlobo"+i).style.display="none";
			document.getElementById("itlobo"+n).style.display="block";
		}
}

