function errorBmg(X, Y) {
  if (Y == null) { X.src = "banner.gif"; }
  else { X.src = Y;}}
  function errorTmg(X, Y) {
  if (Y == null) {X.src ="spacer.gif";}
  else {X.src = Y;}}
  function errorCmg(X, Y) {
  if (Y == null) {X.src ="images.gif";}
  else {X.src = Y;}}

function centerWindow(theURL,winName,width,height,features) {
    var window_width = width;
    var window_height = height;
    var edfeatures= features;
    var window_top = (screen.height-window_height)/2;
    var window_left = (screen.width-window_width)/2;
    newWindow=window.open(''+ theURL + '',''+ winName + '','width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + ',features=' + edfeatures + '');
    newWindow.focus();
}
var ap_name  = navigator.appName;
var ap_vinfo = navigator.appVersion;
var ap_ver   = parseFloat(ap_vinfo.substring(0,ap_vinfo.indexOf('(')));
var time_start = new Date();
var clock_start = time_start.getTime();
var dl_ok=false;

function init ()
{
  if(ap_name=="Netscape" && ap_ver>=3.0)
  dl_ok=true; 
  return true;
}
function get_time_spent ()
{ 
  var time_now = new Date();
  return((time_now.getTime() - clock_start)/1000); 
}
function show_secs ()  // show the time user spent on the side
{ 
  var i_total_secs = Math.round(get_time_spent()); 
  var i_secs_spent = i_total_secs % 60;
  var i_mins_spent = Math.round((i_total_secs-30)/60);   
  var s_secs_spent = "" + ((i_secs_spent>9) ? i_secs_spent : "0" + i_secs_spent);
  var s_mins_spent = "" + ((i_mins_spent>9) ? i_mins_spent : "0" + i_mins_spent);
  document.fm0.time_spent.value = s_mins_spent +"分"+ s_secs_spent+"秒";
  window.setTimeout('show_secs()',1000); 
}
