<!--
function openImagesDiv(index,valueArray) 
{
    var _id="imageList"
    var m = "mask";
    if (docEle(_id)) document.body.removeChild(docEle(_id));
    if (docEle(m)) document.body.removeChild(docEle(m));
    
    //用来获取图片宽高
    var   OriginImage=new   Image(); 
    
    //mask遮罩层

    var newMask = document.createElement("div");
    newMask.id = m;
    newMask.style.position = "absolute";
    newMask.style.zIndex = "9900";
    newMask.style.top = "0px";
    newMask.style.left = "0px";
    newMask.style.background = "#33393C";
    newMask.style.filter = "alpha(opacity=40)";
    newMask.style.opacity = "0.40";
    
    newMask.ondblclick=function(){       
        document.body.removeChild(docEle(_id));
        document.body.removeChild(docEle(m));
        return false;
    }
    document.body.appendChild(newMask);
    
    //新弹出层
    var newDiv = document.createElement("div");
    newDiv.id = _id;
    newDiv.style.position = "absolute";
    newDiv.style.zIndex = "9999";    
    
    var newImg = document.createElement("img");
    newImg.src=valueArray[index];

    newImg.title="点击图片可以浏览下一张图片";
    newImg.alt="图片不能被访问";
    newImg.onclick=function(){
        findNextImage();
    }
    newImg.onload=function(){    
        newDivCenter();
    }
    newImg.onerror=function(){    
        this.src="/CustomAction/Images/nophoto.jpg";
    }
    newDiv.appendChild(newImg);
    newDiv.style.textAlign = "center";        
    newDiv.style.background = "#EFEFEF";
    newDiv.style.border = "8px solid #8ACCE3";
    newDiv.style.padding = "5px";
    newDiv.style.top = "50%"; 
    newDiv.style.left = "50%"; 
    document.body.appendChild(newDiv);  
    newDivCenter();
    
    //弹出层滚动居中
    function newDivCenter()
    {        
        _scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);
        _scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
        newMask.style.width = _scrollWidth + "px";
        newMask.style.height = _scrollHeight + "px";

        OriginImage.src=newImg.src;        
        var iwidth  = OriginImage.width;
        var iheight = OriginImage.height;
        var cwidth  = Math.min(document.body.clientWidth, document.documentElement.clientWidth) * 8/10;
        var cheight = Math.min(document.body.clientHeight, document.documentElement.clientHeight) * 8/10;

        while((iwidth > cwidth && cwidth>0) || (iheight > cheight && cheight > 0))
        {            
            iwidth  = iwidth  * 9/10;
            iheight = iheight * 9/10;
        }
        newImg.width =iwidth;
        newImg.height=iheight;
        
        _newDivWidth  = Math.max(newDiv.offsetWidth,newImg.width);
        _newDivHeight = Math.max(newDiv.offsetHeight,newImg.height);
        _scrollTop = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
        _scrollLeft= Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
        newDiv.style.margin=(_scrollTop - _newDivHeight/2) + "px 0 0 " + (_scrollLeft - _newDivWidth/2) + "px";
    }
    //下一张
    function findNextImage()
    {
        index=index+1;
        if(index==valueArray.length)
        {   
            index=0;
        }        
        newImg.src=valueArray[index];        
    }
    //上一张
    function findPrevImage()
    {
        index=index-1;
        if(index==-1)
        {   
            index=valueArray.length-1;
        }        
        newImg.src=valueArray[index];
    }
    //监听事件
    if(document.all)
    {
        window.attachEvent("onscroll",newDivCenter);
    }
    else
    {
        window.addEventListener('scroll',newDivCenter,false);
    }
    
    //关闭新图层和mask遮罩层
    var control=document.createElement("p");
    control.align="center";
    control.style.height="30px";
    control.style.paddingTop="0px";
    var spanA=document.createElement("span");
    spanA.innerHTML="<font color='#0000FF'>点击图片可以浏览下一张图片</font>"
    control.appendChild(spanA);
    
    var spanB=document.createElement("a");
    spanB.href = "#";
    spanB.style.paddingLeft="10px";
    spanB.innerHTML="上一张";
    spanB.onclick = function(){
        findPrevImage();
    }
    control.appendChild(spanB);
  
    var spanC=document.createElement("a");
    spanC.href = "#";
    spanC.style.paddingLeft="10px";
    spanC.innerHTML="下一张";
    spanC.onclick = function(){
        findNextImage();
    }
    control.appendChild(spanC);
    
    var spanD = document.createElement("a");
    spanD.href = "#";
    spanD.style.paddingLeft="10px";
    spanD.innerHTML = "关闭";
    spanD.onclick = function() 
    {
        if(document.all)
        {
            window.detachEvent("onscroll",newDivCenter);
        }
        else
        {
            window.removeEventListener('scroll',newDivCenter,false);
        }
        document.body.removeChild(docEle(_id));
        document.body.removeChild(docEle(m));
        return false;
    }
    control.appendChild(spanD);
    newDiv.appendChild(control);    
}
-->