function setClipWidth(layer, width) {

  if (isMinNS4)
    (layer.clip.width) = width;

  if (isMinIE4) {
    var str = layer.style.clip;
    if (!str)
      (layer.style.pixelWidth) = width;

    else {  // this won't work
	var clip = getIEClipValues(layer.style.clip);
	return(clip[1] - clip[3]);
    }

  }
  return(-1);
}


function setClipHeight(layer, height) {

  if (isMinNS4)
    layer.clip.height = height;

  if (isMinIE4) {
    var str =  layer.style.clip;
    if (!str)
      layer.style.pixelHeight = height;

    else { // this won't work
	var clip = getIEClipValues(layer.style.clip);
	return(clip[2] - clip[0]);
    }
  }

  return(-1);

}


function setWidth(layer, width) {

  if (isMinNS4) {
    if (layer.document.width) {
      layer.document.width = width;
	  layer.right = layer.left + getWidth(layer);
	  
    }
    
    else
      layer.clip.right = getLeft(layer) + width;
	  layer.clip.width = width;
  }

  if (isMinIE4) {
    if (layer.style.pixelWidth)
      layer.style.pixelWidth = width;
    else {
	  // make one :-)
	  layer.style.pixelWidth = width;

	  //alert("No layer.style.pixelWidth");
	  //alert("layer.clientWidth is " + layer.clientWidth);
	  //alert("layer.style is " + layer.style);
	  
      //layer.clientWidth = width;
	  //alert("layer.clientWidth is " + layer.clientWidth);

	}
  }
  
  return(-1);
}



function setHeight(layer, height) {

  if (isMinNS4) {
    if (layer.document.height) {
      layer.document.height = height;
	  layer.bottom = layer.top + getHeight(layer);
    }
    
    else
      layer.clip.bottom = getTop(layer) + height;
	  layer.clip.height = height;
	  
	}

  if (isMinIE4) {
    if (layer.style.pixelHeight) {
	  //alert("layer.style.pixelHeight is " + layer.style.pixelHeight
	  //     + "-- changing to " + height);
      layer.style.pixelHeight = height;
	  //alert("layer.style.pixelHeight is " + layer.style.pixelHeight);
    }
    
    else {
	  // make one
	  layer.style.pixelHeight = height;
	  //alert("No layer.style.pixelHeight");
      //layer.clientHeight = height;
	  //alert("layer.clientHeight is " + layer.clientHeight);
    }
    
  }
  return(-1);
}


function setRectWithColor(layer, height, width, bgcolor, left, top) {

  setWidth(layer, width);
  setHeight(layer, height);
  setBgColor(layer, bgcolor);
  moveLayerTo(layer, left, top);

  return(-1);

}

function setRectWithImage(layer, height, width, src, left, top) {

  setWidth(layer, width);
  setHeight(layer, height);
  setBgImage(layer, src);
  moveLayerTo(layer, left, top);

  return(-1);

}

