<?xml version="1.0" encoding="utf-8"?>

<snippet name = "信息窗口" description = "显示包含给定信息和标题的新浏览器窗口。" preview="code" type="block">

<insertText location="beforeSelection">

<![CDATA[function messageWindow(title, msg)

{

  var width="300", height="125";

  var left = (screen.width/2) - width/2;

  var top = (screen.height/2) - height/2;

  var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;

  var msgWindow = window.open("","msgWindow", styleStr);

  var head = '<head><title>'+title+'</title></head>';

  var body = '<center>'+msg+'<br><p><form><input type="button" value="   Done   " onClick="self.close()"></form>';

  msgWindow.document.write(head + body);

}

]]>

</insertText>

<insertText location="afterSelection"><![CDATA[]]>

</insertText>

</snippet>

