// $Id:$

function PopupWindow(url,width,height){
    var num = Math.round(Math.random()*10000000);
    var str = new String(num);
    var win = window.open(url,str,"toolbar=no,location=no,directories=no,"+
      "status=no,menubar=no,scrollbars=no,resizable=no,"+
      "copyhistory=no, width="+width+",height="+height+",left=50,top=50");
}

function PopupImage(url,width,height,title)
{
    var windowheight = height+40;
    var windowwidth = width+20;

    var left = (screen.width - windowwidth)/2;
    var top = (screen.height - windowheight)/2 - 18;
    
    var scrollbars = "no";
    
    if (left<0) { scrollbars = "yes"; left = 32; windowwidth = screen.width - 2*left; }
    if (top<0) { scrollbars = "yes"; top = 32; windowheight =  screen.height - 2*top - 18; top = top - 18; }

    var num = Math.round(Math.random()*10000000);
    var str = new String(num);
    var win = window.open("",str,"toolbar=no,location=no,directories=no,"+
        "status=no,menubar=no,scrollbars=" + scrollbars + ",resizable=no,"+
        "copyhistory=no, width="+windowwidth+",height="+windowheight+",left=" + left + ",top=" + top);
    win.document.write("\<HEAD\>\<link rel=\"stylesheet\" type=\"text\/css\" href=\"\/style.css\"\/\>\<meta http-equiv=\"pragma\" content=\"no-cache\"\>\<TITLE\>"+title+"\<\/TITLE\>");
    win.document.write("\<link rel=\"STYLESHEET\" type=\"text/css\" href=\"css/style.css\"\>");
    win.document.write("\<\/HEAD\>");
    win.document.write("\<BODY topmargin=0 leftmargin=0 bottommargin=0 style='margin: 0px' marginwidth=0 marginheight=0\>\<center\>\<img src=\""+url+"\" width=\""+width+"\" height=\""+height+"\" border=0 vspace=\"10\" height=\"10\"\>\<BR\>\<a href=\"javascript:window.close();\" class=\"popup\"\>Close\<\/a\>\<\/center\>\<\/BODY\><\/HTML\>");
}

function jmShowHelp(url)
{
	if (url.indexOf("?")==-1)
		url+="?";
	else
		url+="&";
	url+="media=popup";

    var width  = 750;
    var height = 580;
    var left   = (screen.width - width)/2;
    var top    = (screen.height - height)/2

    var win = window.open(url,null,"toolbar=no,location=no,directories=no,"+
      "status=no,menubar=no,scrollbars=yes,resizable=yes,"+
      "copyhistory=no, width="+width+",height="+height+",left=" + left + ",top=" + top);
   
    return false;
}
