﻿document.write('<div style="display:none; position:absolute; z-index:99; background-color:Black;filter:Alpha(Opacity=95);-moz-opacity:0.95;" id="dialog" align="center" onclick="this.style.display=\'none\';"></div>')
function FixImgWin(url){ 
    var imgwin=window.open('','img','width=0,height=0') 
    imgwin.focus()
    var HTML="<html>\r\n<head>\r\n<title>图片浏览</title>\r\n</head>\r\n<body leftmargin=\"0\" topmargin=\"0\">\r\n<img src=\""+url+"\" onload=\"window.resizeTo(this.width+10,this.height+40);window.moveTo((screen.width-this.width)/2,(screen.height-this.height)/2)\">\r\n</body>\r\n</html>" 
    var doc=imgwin.document 
    doc.write(HTML)           
    doc.close()               
} 
//function OpenSimpleWindow(url,width,height){
//    window.open(url,"","toolbar=no,location=no,scrollbars=no,status=no,resizable=yes,width="+width+",height="+height);
//}
function OpenSimpleWindow(url,width,height){
    var panel=document.getElementById("dialog");
    panel.style.width=document.documentElement.clientWidth+'px';
    panel.style.height=document.body.scrollHeight+'px';
    panel.style.left=document.documentElement.scrollLeft+'px';
    panel.style.top=document.documentElement.scrollTop+'px';
    panel.style.display='';
    panel.style.paddingTop=(document.documentElement.clientHeight-height)/2+'px';
    height+=50;
    panel.innerHTML='<div align="center"><div style="height:50px; width:'+width+'px;" align="right"><span onclick="closeDialog();"><img src="images/close.png" alt="关闭"/></span></div><iframe src="'+url+'" width="'+width+'" " height='+height+' marginwidth="0" marginheight="0" scrolling="No" frameborder="no""/></div>';    
}
function closeDialog()
{
    document.getElementById('dialog').style.display='none';
}

function ShowPhoto(e,src)
{
    var panel=document.getElementById("DivPhoto");
    panel.innerHTML='<div style="padding:5px 5px 5px 5px;background-color:Black;"><img src="'+src+'"/></div>';
    var MaxLeft = document.documentElement.scrollLeft+document.documentElement.clientWidth-panel.scrollWidth;
    var MaxTop = document.documentElement.scrollTop+document.documentElement.clientHeight-panel.scrollHeight;
    var left= document.documentElement.scrollLeft+e['clientX']+10;
    var top=document.documentElement.scrollTop+e['clientY']+10;    
    panel.style.top = top+'px';//始终在下面显示 (top > MaxTop ? top-panel.scrollHeight : top)+'px';
    panel.style.left = (left > MaxLeft ? left-panel.scrollWidth-20 : left)+'px';
    panel.style.display='';
}
function HidePhoto()
{
    document.getElementById("DivPhoto").style.display='none';
}

