﻿// JScript 文件

//打开弹出窗口
    function openWin(url,title,width,height)
    {
        window.open(url,title,'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=' + width.toString() +',height=' + height.toString());
    }

//修改图片显示的大小
function checkImageSize(theImage)
{
    var maxWidth=480;
    var maxHeight=400;

    if (theImage.width>maxWidth)
    {
	    theImage.width=maxWidth;
	 }
}


function openDynaWin(theTitle,theContent){
var winEx=window.open();
winEx.document.write("<html>");
winEx.document.write("<head>");
winEx.document.write("<title>"+theTitle+"</title>");
winEx.document.write("</head>");
winEx.document.write("<body>");
winEx.document.write("<table align='center' width='100%'>"); 
winEx.document.write("<tr><td align='center' >"+theContent+"</td></tr>"); 
winEx.document.write("<tr><td align='center'><input type='button' style='font-size:9pt' value='关闭窗口' onclick='javascript:window.close()'></td></tr>"); 
winEx.document.write("</table>");
winEx.document.write("</body>");
winEx.document.write("</html>");
//winEx.document.title='Preview==='+themovie.stage.width; 
winEx.document.close();
}

function openDynaImageWin(theTitle,url)
{
    openDynaWin('预览',"<img src='"+url+"' />");
}

function openDynaImageWinPreview(url)
{
    if (url==0) return 0;

    temp="<font color='red'><b>如果不能正确显示，请检查文件格式。</b></font><br><span style='font size:9pt'>某些非标准格式的的图片IE不能正确显示，但是能用AcdSee等软件浏览。</span><br><br>";
	temp=temp+"<img src='"+url+"' />";
alert(temp);
    openDynaWin('预览',temp);
}