   function MM_swapImgRestore() { //v3.0
     var i, x, a=document.MM_sr; 
     for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) {
       x.src = x.oSrc;
     }
   }

   function MM_preloadImages() { //v3.0
     var d=document; 
     if(d.images) { 
       if(!d.MM_p) d.MM_p=new Array();
       var i, j=d.MM_p.length, a=MM_preloadImages.arguments; 

       for(i=0; i<a.length; i++) {
         if (a[i].indexOf("#")!=0) { 
           d.MM_p[j]       = new Image; 
           d.MM_p[j++].src = a[i];
         }
       }
     }
   }

   function MM_findObj(n, d) { //v3.0
     var p,i,x;  

     if(!d) {
       d=document; 
     }

     if((p=n.indexOf("?"))>0&&parent.frames.length) {
       d = parent.frames[n.substring(p+1)].document; 
       n=n.substring(0,p);
     }

     if(!(x=d[n])&&d.all) x=d.all[n]; 
     for (i=0;!x&&i<d.forms.length;i++) {
       x = d.forms[i][n];
     }

     for(i=0;!x&&d.layers&&i<d.layers.length;i++) {
       x=MM_findObj(n,d.layers[i].document); 
     }
     return x;
   }

   function MM_swapImage() { //v3.0
     var i, j=0, x, a=MM_swapImage.arguments; 
     document.MM_sr = new Array; 
     for(i=0;i<(a.length-2);i+=3) {
       if ((x=MM_findObj(a[i]))!=null) { 
         document.MM_sr[j++]=x; 
         if(!x.oSrc) x.oSrc = x.src; 
         x.src = a[i+2];
       }
     }
   }


/**
 * Detect browser type, netscape or ie
 *
 * @return "NS4"=Netscape Navigator 4, "NS6"=Netscape Navigator 6,
 *         "IE4"=Internet Explorer 4,  "IE5"=Internet Explorer 5,
 *         ""=Unknown
 */
function j_detect_browser() {

  if ((typeof(document.all) != 'undefined') &&
      (typeof(document.getElementById) == 'undefined')) {
    return "IE4";
  } else if ((typeof(document.all) != 'undefined') &&
             (typeof(document.getElementById) != 'undefined')) {
    return "IE5";
  } else if (typeof(document.layers) != 'undefined') {
    return "NS4";
  } else if ((typeof(document.all) == 'undefined') &&
             (typeof(document.getElementById) != 'undefined')) {
    return "NS6";
  } else {
    return "";
  }
}

/**
 * get image object in layer in HTML page
 *
 * @param ps_img_id   - image id
 * @param ps_layer_id - layer_id
 */
function j_get_img(ps_img_id) {

  js_browser_type = j_detect_browser();
  if ((js_browser_type == "IE4") || (js_browser_type == "IE5")) {
    return document.getElementById(ps_img_id);
  }
  if (js_browser_type == "NS4") {
    return document.images[ps_img_id];
  }
  if (js_browser_type == "NS6") {
    return document.getElementById(ps_img_id);
  }
}


/**
 * change image source url
 *
 * @param ps_img_id  - image id
 * @param ps_img_url - image source url
 */
function j_chg_img_url(ps_img_id, ps_img_url) {
  j_get_img(ps_img_id).src = ps_img_url;
}


/**
 * change multiple images' source url in a form
 *
 * @param po_form    - Form object
 * @param ps_img_id  - Image id
 * @param ps_img_url - Image source url
 */
function j_chg_form_mimg_url(po_form, ps_img_id, ps_img_url) {

  js_browser_type = j_detect_browser();
  if ((js_browser_type == "IE4") || (js_browser_type == "IE5")) {

    // single image
    if (typeof(document.all(ps_img_id).length) == 'undefined') {

      j_chg_img_url(ps_img_id, ps_img_url);

    } else { // multiple image

      ji_length = document.all(ps_img_id).length;
      for (ji_m = 0; ji_m < ji_length; ji_m++) {
        document.all(ps_img_id, ji_m).src = ps_img_url;
      }
    }

  } else if (js_browser_type == "NS6") {
    jao_list = document.getElementsByTagName("INPUT");
    for (ji_m = 0; ji_m < jao_list.length; ji_m++) {
      jo_node = jao_list.item(ji_m);
      if (jo_node.id == ps_img_id) {
        jo_node.src = ps_img_url;
      }
    }
  }
}



/**
 * change multiple button enable/disable status 
 * according to images' source url in a form
 *
 * @param po_form    - Form object
 * @param ps_img_id  - Image id
 * @param ps_img_url - Image source url
 *
 *  MOD20060209-1 Rocco Chong 09.FEB.06 change image button to label button
 */
function j_chg_btn_mimg_url(po_form, ps_img_id, ps_img_url) {

    // single image
    if (typeof(document.all(ps_img_id).length) == 'undefined') {

      // j_chg_img_url(ps_img_id, ps_img_url);
      if( document.all(ps_img_id).type != undefined ) {
        if( document.getElementById(ps_img_id).type.toLowerCase()=='submit' ||
            document.getElementById(ps_img_id).type.toLowerCase()=='button' ) {
          if( ps_img_url.indexOf('_blur') >= 0 ) {
            document.getElementById(ps_img_id).disabled = true;
          } else {
            document.getElementById(ps_img_id).disabled = false;
          }
        }
      }

    } else { // multiple image

      ji_length = document.all(ps_img_id).length;
      for (ji_m = 0; ji_m < ji_length; ji_m++) {
        if( document.all(ps_img_id, ji_m).type.toLowerCase()=='submit' ||
            document.all(ps_img_id, ji_m).type.toLowerCase()=='button' ) {
          if( ps_img_url.indexOf('_blur') >= 0 ) {
            document.all(ps_img_id, ji_m).disabled = true;
          } else {
            document.all(ps_img_id, ji_m).disabled = false;
          }
        }
      }
    }

}






