var minmax = function(url, pid, ppg, mmBtnId, mmDivId, minBtnIcon, maxBtnIcon) { 
  var mmBtn = document.getElementById(mmBtnId);
  var mmDiv = document.getElementById(mmDivId);
  var host = "http://www-128.ibm.com"; 
  if (location.hostname.length > 0)
     host = "http://" + location.hostname;
  var sUrl = host + url + "?pid="+pid+"&ppg="+ppg+"&m="+mmBtn.title;

  var sendReq = YAHOO.util.Connect.asyncRequest('GET', sUrl, {

     success: function(o) {
         if(o.responseText !== undefined){
            if (o.responseText.indexOf('min') > -1) { 
		 mmBtn.src = (maxBtnIcon != undefined)?maxBtnIcon:"//www.ibm.com/i/v14/icons/portlets/restore_3.gif";
		 mmBtn.alt = "Restore";
		 mmBtn.title = "Restore";
               mmDiv.style.display = "none";
            } else if (o.responseText.indexOf('max') > -1) { 
               mmBtn.src = (minBtnIcon != undefined)?minBtnIcon:"//www.ibm.com/i/v14/icons/portlets/minimize_3.gif";
		 mmBtn.alt = "Minimize";
               mmBtn.title = "Minimize";
               mmDiv.style.display = "inline";
            }
         }
      },
      failure: function(o) {}
    });

  return false;
};

