new_window = null;

function colorize_on(obj)
{
        obj.style.backgroundColor = "#AEB5D8";
}

function colorize_off(obj)
        {
          obj.style.backgroundColor = "#969ECD";

          }


function view(pic0,title0,h0,w0,bg0,s0) {
      pic = pic0;
      title = title0;
      zu();
      setTimeout("view_window('"+h0+"','"+w0+"','"+bg0+"','"+s0+"')",1000);
   }

function view_window(h,w,bg,s) {
      window_height = h;
      window_width = w;
      options = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+s+',resizable=0,height='+window_height+',width='+window_width;
      new_window = window.open('','',options)
      with (new_window) {
         document.writeln('<HTML>\n<HEAD>\n<TITLE> P-GRADE </TITLE>\n<link rel="STYLESHEET" type="text/css" href="p-grad.css">\n</HEAD>');
         document.writeln('<BODY style = "margin:3px 3px 2px 3px ;" bgcolor = "'+bg+'">\n<DIV ALIGN=CENTER><TABLE BORDER="0" CELLSPACING=0 CELLPADDING=0 onclick = "javascript:self.close();">');
         document.writeln('<tr><td bgcolor = "'+bg+'" align="center" valign="middle"><img src="'+pic+'" border="0"></td></tr>');
         document.writeln('<tr><td bgcolor = "'+bg+'" align="center" valign="middle" height="20"><b style = "font-family:werdana,arial;font-size:12px">'+title+'</b></td></tr>');
         document.writeln('<tr><td bgcolor = "'+bg+'" align="center" valign="middle" height="20" style ="font-family:verdana,arial;font-size:10px;">[ click on the picture to close ]</td></tr>');
         document.writeln('</TABLE>\n</DIV>\n</BODY>\n</HTML>\n');
      }
   }

   function zu() {
      if (new_window != null)
         if (!new_window.closed)
            if (new_window.close)
              new_window.close();
   }

