function clipLayer(layerName,x1,y1,width,height) {
// point (x,y) = location of the origin of the new clipping rectangle
// width and height of the clipping rectangle
	x2 = x1+width;
	y2 = y1+height;
	eval(startLayerRef + layerName + endLayerRef + styleSwitch +".clip = 'rect("+y1+" "+x2+" "+y2+" "+x1+")';");
}
