void script_31(int arg0,int arg1,int arg2,int arg3,int arg4,int arg5,int arg6,int arg7) {
	int ivar8;
	int ivar9;
	int ivar10;
	int ivar11;
	int ivar12;
	int ivar13;
	int ivar14;
	ivar8 = getWidgetScrollMaxV(new WidgetPointer(arg1));
	ivar9 = getWidgetActualHeight(new WidgetPointer(arg0));
	ivar10 = subtract(ivar9, 32);
	ivar11 = 0;
	if (ivar8 > 0) {
		ivar11 = multiplyDivide(ivar9, ivar8, ivar10);
	} else {
		ivar11 = ivar10;
	}
	ivar11 = max(ivar11, 10);
	ivar12 = cs2method2601(new WidgetPointer(arg1));
	ivar13 = 0;
	ivar14 = 0;
	if (ivar12 > 0) {
		ivar13 = subtract(ivar8, getWidgetActualHeight(new WidgetPointer(arg1)));
		if (((boolean)ivar13)) {
			ivar13 = 1;
		}
		if (ivar12 > ivar13) {
			cs2method2100(0, ivar13, new WidgetPointer(arg1));
			ivar12 = ivar13;
		}
		ivar14 = multiplyDivide(ivar12, ivar13, subtract(ivar10, ivar11));
		ivar14 = min(max(ivar14, 0), subtract(ivar10, ivar11));
	}
	createExtraChild(new WidgetPointer(arg0), 5, 0);
	setWidgetPosition(0, 16, 0, 0);
	setWidgetSize(16, 32, 0, 1);
	setWidgetSprite(arg2);
	cs2method1107(1);
	setScriptCallOnMousePressed(34, new WidgetPointer(arg0), new WidgetPointer(arg1), -2147483646, "IIi");
	createExtraChild(new WidgetPointer(arg0), 5, 1);
	setWidgetPosition(0, add(16, ivar14), 0, 0);
	setWidgetSprite(arg4);
	cs2method1107(1);
	cs2method1301(arg0, 0);
	cs2method1302(1);
	setWidgetSize(16, ivar11, 0, 0);
	setScriptCallOnMouseDragged(35, new WidgetPointer(arg0), new WidgetPointer(arg1), -2147483646, 0, "IIi1");
	setScriptCallOnMouseDragReleased(35, new WidgetPointer(arg0), new WidgetPointer(arg1), -2147483646, 1, "IIi1");
	createExtraChild(new WidgetPointer(arg0), 5, 2);
	setWidgetPosition(0, add(16, ivar14), 0, 0);
	setWidgetSize(16, 5, 0, 0);
	setWidgetSprite(arg3);
	cs2method1107(0);
	createExtraChild(new WidgetPointer(arg0), 5, 3);
	setWidgetPosition(0, subtract(add(add(16, ivar14), ivar11), 5), 0, 0);
	setWidgetSize(16, 5, 0, 0);
	setWidgetSprite(arg5);
	cs2method1107(0);
	createExtraChild(new WidgetPointer(arg0), 5, 4);
	setWidgetPosition(0, 0, 0, 0);
	setWidgetSize(16, 16, 0, 0);
	setWidgetSprite(arg6);
	cs2method1107(0);
	setScriptCallOnMouseDraggedOver(32, new WidgetPointer(arg0), new WidgetPointer(arg1), "II");
	createExtraChild(new WidgetPointer(arg0), 5, 5);
	setWidgetPosition(0, 0, 0, 2);
	setWidgetSize(16, 16, 0, 0);
	setWidgetSprite(arg7);
	cs2method1107(0);
	setScriptCallOnMouseDraggedOver(33, new WidgetPointer(arg0), new WidgetPointer(arg1), "II");
	setScriptCallOnMouseScroll(36, new WidgetPointer(arg0), new WidgetPointer(arg1), -2147483646, "IIi", new WidgetPointer(arg0));
	setScriptCallOnMouseScroll(36, new WidgetPointer(arg0), new WidgetPointer(arg1), -2147483646, "IIi", new WidgetPointer(arg1));
	return;
}
