function articlePopImg(fn,te,cm,wd,ht,siteName,contentID){

 //var newTitle = convertTitle(te);

 var screenWidth=screen.availWidth;
 var screenHeight=screen.availHeight;
 var requiredWidth=parseInt(wd)+53;
 var requiredHeight=parseInt(ht)+140;
 var actualWidth=requiredWidth;
 var actualHeight=requiredHeight;
 var scrollbars="no";

 if (requiredHeight > screenHeight) {
 actualHeight = screenHeight;
 scrollbars="yes";
 }

 if (requiredWidth > screenWidth) {
 actualWidth = screenWidth;
 scrollbars="yes";
 }

popwin=window.open("","popwin","toolbar=no,location=no,status=no,menubar=no,scrollbars="+scrollbars+",resizable=yes,width=1,height=1");
 popwin.document.open("text/html");
// write out html for formatted popup page here
// sadly, i was too slack to do it myself
// popwin.document.write(te+"<br><img src="+fn+" width="+wd+" height="+ht+"><br>"+cm);
popwin.document.write("<html>");
popwin.document.write("<head>");
popwin.document.write("<title>" + cm + "</title>");
popwin.document.write("<style type='text/css'>");
popwin.document.write("<!--");
popwin.document.write(".buttonTextCancel{color:#0099cc;font:12px Arial,Helvetica;font-weight:bold;text-decoration:none}");
popwin.document.write(".popup-header{font-size:12px;font-weight:bold;font-family:arial,helvetica}");
popwin.document.write(".popup-caption{color:#666666;font-size:10px;font-family:arial,helvetica;}");
popwin.document.write("-->");
popwin.document.write("</style>");
popwin.document.write("</head>");
popwin.document.write("<body onLoad='javascript:moveTo(0,0);resizeTo("+actualWidth+","+actualHeight+");window.focus();' bgcolor='ffffff'>");
popwin.document.write("<table cellpadding='0' cellspacing='0' border='0' width='100%' align='center'>");
popwin.document.write(" <tr>");
popwin.document.write(" <td valign='top'>");
//popwin.document.write(" <table cellpadding='0' cellspacing='0' border='0' width='100%'>");
//popwin.document.write(" <tr>");
//popwin.document.write(" <td><span class='popup-header'>"+cm+"</span></td>");
//popwin.document.write(" </tr>");
//popwin.document.write(" <tr>");
//popwin.document.write(" <td width='100' colspan='2' bgcolor='#0099cc'><img src='/"+siteName+"/sitewide/images/pix.gif' width='1' height='1' border='0'></td>");
//popwin.document.write(" </tr>");
//opwin.document.write(" </table>");

//popwin.document.write(" <img src='"+siteName+"/sitewide/images/pix.gif' width='1' height='12' border='0'><br>");
popwin.document.write(" <img src="+fn+" border='0' width="+wd+" height="+ht+" vspace='3' name='main'><br>");
popwin.document.write(" <span class='popup-caption'>"+cm+"</span>");
//popwin.document.write(" <table width='100%' cellspacing='0' cellpadding='0' border='0'>");
//popwin.document.write(" <tr>");
//popwin.document.write(" <td><img src='"+siteName+"/sitewide/images/pix.gif' width='1' height='10' alt='' border='0'></td>");
//popwin.document.write(" </tr>");
//popwin.document.write(" <tr>");
//popwin.document.write(" <td valign='top' rowspan='2'><img src='"+siteName+"/sitewide/images/pix.gif' width='1' height='4' alt='' border='0'></td>");
//popwin.document.write(" <td width='9' rowspan='5'><img src='"+siteName+"/sitewide/images/but_convex_left_white.gif' width='9' height='21' alt='' border='0'></td>");
//popwin.document.write(" <td bgcolor='#0099cc'><img src='"+siteName+"/sitewide/images/pix.gif' width='1' height='1' alt='' border='0'></td>");
//popwin.document.write(" <td width='9' rowspan='5'><img src='"+siteName+"/sitewide/images/but_convex_right_white.gif' width='9' height='21' alt='' border='0'></td>");
//popwin.document.write(" </tr>");
//popwin.document.write(" <tr>");
//popwin.document.write(" <td><img src='"+siteName+"/sitewide/images/pix.gif' width='1' height='3' alt='' border='0'></td>");
//popwin.document.write(" </tr>");
/*
popwin.document.write(" <tr>");
popwin.document.write(" <td width='100%' bgcolor='#0099cc'><img src='"+siteName+"/sitewide/images/pix.gif' width='1' height='1' alt='' border='0'></td>");
popwin.document.write(" <td align='center' nowrap rowspan='2'><a href='javascript:void' onClick='window.close();' class='buttonTextCancel' >&nbsp; &nbsp; Close Window &nbsp; &nbsp;</a></td>");
popwin.document.write(" </tr>");
popwin.document.write(" <tr>");
popwin.document.write(" <td><img src='"+siteName+"/sitewide/images/pix.gif' width='1' height='15' alt='' border='0'></td>");
popwin.document.write(" </tr>");
popwin.document.write(" <tr>");
popwin.document.write(" <td><img src='"+siteName+"/sitewide/images/pix.gif' width='1' height='1' alt='' border='0'></td>");
popwin.document.write(" <td bgcolor='#0099cc'><img src='"+siteName+"/sitewide/images/pix.gif' width='1' height='1' alt='' border='0'></td>");
popwin.document.write(" </tr>");
popwin.document.write(" </table></td>");
*/
popwin.document.write("</td>");
popwin.document.write(" </tr>");
popwin.document.write("</table>");
popwin.document.write("</body>");
popwin.document.write("</html>");

popwin.document.close();
popwin.opener.name="hivewin";
}
function convertTitle(entry) {
 if (entry.indexOf("~") != -1) {
 while (entry.indexOf("~") != -1) {
 var tempTitle = ((entry.substring(0, entry.indexOf("~")))+"'"+(entry.substring(entry.indexOf("~") + 1, entry.length)));
 entry = tempTitle;
 }
 }
 else var tempTitle = entry;
 return tempTitle;
} 

