ï»?/ JScript æ–‡ä»¶

function ShowPics( picSrc )
{
    var flag;
    
    if( flag = window.document.getElementById("Pics") )
    {
        flag.parentNode.removeChild(flag);
    }
   
    var ShowDiv = window.document.createElement("div");
    	
	ShowDiv.id = "Pics";
	ShowDiv.style.position = "absolute";
	ShowDiv.style.left = "50%";
	ShowDiv.style.top = "50%";
	ShowDiv.style.marginLeft = "-200px";
	ShowDiv.style.marginTop = -150 + window.document.documentElement.scrollTop + "px";
	ShowDiv.style.zIndex = "9999";
    	
	var pic = "<img id='pic' alt='' title='ç‚¹å‡»å…³é—­å›¾ç‰‡' width='400' height='300' src='"  + picSrc
	            + "' onclick='CloseDiv()' style='filter:Alpha(opacity=0)' />";
	var picBox = "<table class='picBoxBody' border='0' cellspacing='0' cellpadding='0'>";	
	picBox += "<tr><td class='picBoxTitle'>å›¾ç‰‡æµè§ˆ</td></tr>";
	picBox += "<tr><td>" + pic + "</td></tr></table>"
    	
	ShowDiv.innerHTML = picBox;
    	
	window.document.body.appendChild(ShowDiv);

    this.CloseDiv = function()
    {
        window.document.body.removeChild(ShowDiv);
    }    
    
    displayPic();
}


var opc = 0;
function displayPic( )
{    
    if( opc == 100 )
    {
        opc = 0;
        clearTimeout( myTimer );
        
        return;
    }
    else
    {
        window.document.getElementById("pic").filters("alpha").opacity = (opc+=5);
    }
    
    var myTimer = setTimeout( "displayPic()" , 1 );
}
