var gmyWin = null;

function myOpenWindow(strImage, intWidth, intHeight, strMessage, winObj)
{
  // this will hold our opened window
  var theWin; 
  var winName = 'myWin';

  // first check to see if the window already exists
  if (winObj != null)
  {
    //if the window exists, close it
    if (!winObj.closed) {
      	winObj.close();
    }
  }

  //open the window with the new parameters
  theWin = window.open('', winName, 'width=' + intWidth + ',height=' + intHeight + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizeable=yes');
  theWin.document.write('<html><head><style>body {background: #2D0102; color: #fff; font-family: verdana; font-size: 0.9em; text-align: center;}</style></head><body>' + '<p>' + strMessage + '</p><img src=\"' + strImage + '\" />' + '</body></html>');
  theWin.document.close();
  
  if (window.focus) {
  		theWin.focus();
	}
  
  return theWin;
}