void script_5207(int arg0,int arg1,int arg2) {
	int ivar3;
	int ivar4;
	int ivar5;
	ivar3 = 0;
	ivar4 = 5526;
	ivar5 = 5523;
	while (ivar3 < getExtraChildGap(new WidgetPointer(arg0))) {
		if (setWidgetRegister(new WidgetPointer(arg0), ivar3) && (getWidgetSpriteId() == ivar4)) {
			removeAllEventListeners();
			setWidgetSprite(ivar5);
		}
		ivar3 = add(ivar3, 1);
	}
	if (setWidgetRegister(new WidgetPointer(arg0), arg1)) {
		removeAllEventListeners();
		setWidgetSprite(ivar4);
	}
	globalint_1601 = ivar3;
	script_5202(0);
	script_5204();
	return;
}
