Source code for /src/msgBox.jsp.txt

//======================================================================//
// Author: Mark Qian <markqian@hotmail.com>                             //
// WWW: http://www.coolshare.com                                        //
// Copyright (c) 2006, Mark Qian                                        //
//                                                                      //
// You must contact Mark Qian to get a permission of use                //
// in case you want to make any use of the codes except viewing it     //
// on Mark's site.                                                      //
//======================================================================//


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<HTML>
<HEAD>
<SCRIPT>

var x = window.dialogArguments;
var top = x[0];
var title = x[1];
var msg = x[2];

var msgType = x[3];
var details = x[4];



function doOK() {

    window.returnValue = true
    window.close();
}
function doNo() {

    window.returnValue = false;
    window.close();
}

var w = dialogWidth;
    w = w.substring(0, w.length-2);
    w = parseInt(w)-6;

    var h = dialogHeight;
    h = h.substring(0, h.length-2);
    h = parseInt(h);

function doOnload()
{


	if (document.all.noButton!=null)
		document.all.noButton.focus();

    

}
function showDetails() {
  var dt = document.getElementById("details");
  var db = document.getElementById("detailButton");
  var ddd = document.getElementById("ddd");
  var cord;
  if (dt.style.display=="none") {
    db.innerHTML = "HideDetails";
    dt.style.display = "block";
    external.dialogWidth = ""+3*w+"px";
    external.dialogHeight = ""+3*h+"px";
    cord = top._centerPopup(3*w, 2*h);
    ddd.style.width = "100%";
  } else {
    db.innerHTML = "ShowDetails";
    dt.style.display = "none";
    external.dialogWidth = ""+w+"px";
    external.dialogHeight = ""+(h+50)+"px";
    cord = top._centerPopup(w, h);
    ddd.style.width = w-50;
  }
  external.dialogLeft = cord[0];
  external.dialogTop = cord[1];
}

document.writeln("<HEAD><TITLE>"+title+"</TITLE>");

</SCRIPT>
<STYLE>
BODY {background-color: #d8d8d8; color: #000000; font-size: 5pt; font-family: Verdana, Arial, Helvetica; }
</STYLE>

</HEAD>
<BODY >
<center>
<br><br><br>
<table border=0 height=90%><tr align="center"><td align="center">
<table><tr>
<SCRIPT>

if (msgType<4)
	document.writeln("<td wrap><div id=\"ddd\" STYLE='overflow: auto;width:300;height:120'><font face='Verdana, Arial, Helvetica, sans-serif' size='-1'>"+msg+"</Font></div></td>");
else if (msgType==4)
	document.writeln("<td wrap><div id=\"ddd\" STYLE='overflow: auto;width:300;height:120'><b><font face='Verdana, Arial, Helvetica, sans-serif' size='-1'>"+msg+"</Font></b></div></td>");
else if (msgType==5)
{
	document.writeln("<td wrap><TEXTAREA   NAME='tz'   style=\"width:600;height:500\">"+msg+"</TEXTAREA></td>");

}

if (details!=null) {
document.writeln("<tr><td align=center><textarea id='details' style='display:none;height:"+Math.round(1.5*h)+";width:"+(3*w-20)+"'>"+details+"</textarea></td></tr>");

}
</SCRIPT>
</tr>

</table>
</td></tr>
<tr><td valign=bottom align=center>
<table><tr>
<SCRIPT>

	if (msgType==5)
	{
		document.writeln("<td><input id=okButton width='160' type=button onclick='doOK()' value='OK'></td>");	
	}
	else if (msgType>2)
	{
		document.writeln("<td><input id=okButton width='160' type=button onclick='doOK()' value='Yes'></td><td>&nbsp</td><td><input type=button width='160' id=noButton onclick='doNo()' value='No'></td>");	
	}
	else
	{
		document.writeln("<td><button  onclick='doOK()' style='width:110'>OK</button></td>");
        if (details!=null) {
           document.writeln("<td align=center><button id='detailButton' onclick='showDetails()'>ShowDetails</button></td>");
        }
	}
	
</SCRIPT>
</tr></table></td></tr></table>
</center>

</BODY>
</HTML>