Code optimization

Hi dear experts… I am sure that this code can be optimized so I don’t have to type 8 instances (only 2 shown) of the (almost) same code… Any hints?[INDENT][SIZE=1]kabinet.onRollOver = function() {[/SIZE]
[SIZE=1] this.fleka._alpha = 70;[/SIZE]
[SIZE=1] this.izlaz=false;[/SIZE]
[SIZE=1] }[/SIZE]
[SIZE=1]
kabinet.onRollOut = function() {[/SIZE]
[SIZE=1] this.izlaz=true;[/SIZE]
[SIZE=1] this.filters = “”;[/SIZE]
[SIZE=1] }[/SIZE]

[SIZE=1] kabinet.onPress = function() {[/SIZE]
[SIZE=1] this.filters = smudi;[/SIZE]
[SIZE=1] }[/SIZE]

[SIZE=1] kabinet.onRelease = function() {[/SIZE]
[SIZE=1] this.filters = “”;[/SIZE]
[SIZE=1] }[/SIZE]

[SIZE=1] //---------------------------[/SIZE]

[SIZE=1] operativni.onRollOver = function() {[/SIZE]
[SIZE=1] this.fleka._alpha = 70;[/SIZE]
[SIZE=1] this.izlaz=false;[/SIZE]
[SIZE=1] }[/SIZE]
[SIZE=1]
operativni.onRollOut = function() {[/SIZE]
[SIZE=1] this.izlaz=true;[/SIZE]
[SIZE=1] this.filters = “”;[/SIZE]
[SIZE=1] }[/SIZE]

[SIZE=1] operativni.onPress = function() {[/SIZE]
[SIZE=1] this.filters = smudi;[/SIZE]
[SIZE=1] }[/SIZE]

[SIZE=1] operativni.onRelease = function() {[/SIZE]
[SIZE=1] this.filters = “”;[/SIZE]
[SIZE=1] }[/SIZE]
[/INDENT]What I am aiming for is to have a way to pass “kabinet”, or “operativni” etc. to a function or smth… The code is used to control mc buttons on the stage. It works, but it’s ugly and not practical, obviously…

I tried with[SIZE=1]
[/SIZE][INDENT][SIZE=1][var]onRollOver = function() {…[/SIZE]
[/INDENT]inside a function, var being the parameter of said function (“kabinet”, “operativni” etc.), but to no avail. Also tried with the with(var), thingy, but with the same result.

Any hints?