﻿//大图片显示 ----------------------------------------------------------------------------------------------------------------------------   
function popImage(obj) 
{ 
    var href = "";
    if (obj.parentElement)
        href = obj.parentElement.toString();
        
    var img = obj.src;
	var layer = document.getElementById("popImageLayer");
	var t=obj.offsetTop;
	var l=obj.offsetLeft;
	while(obj=obj.offsetParent){
		t+=obj.offsetTop;
		l+=obj.offsetLeft;
	}
	var content = "<table onMouseOut='hideLayer();' border=0 width=180 height=180><tr><td align='center' valign='middle'>\n";
	if (href.length > 0)
	    content += " <a target='_blank' href='"+href+"'><IMG src='"+img+"' onload='DrawImage(this,180,180);'  onMouseOut='low(this);hideLayer();' onMouseOver=high(this) style='FILTER: alpha(opacity=0)' /></a></td></tr></table>"; // onClick='hideLayer();'
	else
	    content += " <IMG src='"+img+"' onload='DrawImage(this,180,180);'  onMouseOut='low(this);hideLayer();' onMouseOver=high(this) style='FILTER: alpha(opacity=0)' /></td></tr></table>"; // onClick='hideLayer();'

			layer.innerHTML=content;
			layer.style.left =l + 35 -90;
			layer.style.top = t+35-90;
			layer.style.visibility='visible';
} 

function onImgLoad(img,width,height)
{
   // img.width=width;
//	img.height=height;
    DrawImage(img,width,height);
}

function DrawImage(img,width,height){ 
	if(DrawImage.arguments.length <= 1) 
		width=height=70;
	var image=new Image(); 
	image.src=img.src; 
	if(image.width>0 && image.height>0)
	{
	  if(image.width>width)
	  {
	  	rate=image.height/image.width;
	  	newHeight=rate*width;
	  	img.width=width;
	  	img.height=newHeight;
	  } 
	}
	if(img.height>height)
	{
		rate=image.width/image.height;
		newWidth=rate*height;
		img.height=height;
		img.width=newWidth;
	}
}

function DrawImage50(img){ 
	DrawImage(img,50,50);
}
function high(which2){
	theobject=which2;
	highlighting=setInterval("highlightit(theobject)",40);
}
function highlightit(cur2){
	if (cur2.filters.alpha.opacity<100)
		cur2.filters.alpha.opacity+=99
	else if (window.highlighting)
		clearInterval(highlighting)
}
function low(which2){
	clearInterval(highlighting);
	which2.filters.alpha.opacity=40;
}
function hideLayer()
{	
	var layer = document.getElementById("popImageLayer");
	layer.style.visibility='hidden';
}

document.write("<DIV id=popImageLayer style='BORDER-RIGHT: orange 0pt solid; BORDER-TOP: orange 0pt solid; VISIBILITY: hidden; BORDER-LEFT: orange 0pt solid; WIDTH: 180px; CURSOR: hand; BORDER-BOTTOM: orange 0pt solid; POSITION: absolute; HEIGHT: 180px' align=center calss='' name='popImageLayer'></DIV>");
//end 大图片显示 ----------------------------------------------------------------------------------------------------------------------------

