Newbie question

Newbie question

Hi all,

i created 2 divs, and for each div set a different background pic, using CSS
now i want to fade those divs opacity to 0.4 and when mouse over to increase the opacity to 1, and when mouse leave to decease it to 0.4 back.

my jquery code is the follow:

<div id="dj1"></div>
<div id="dj2"></div>

$(document).ready(function () {
            $("#dj1").fadeTo(400, 0.4);
            $("#dj2").fadeTo(400, 0.4);

$("#dj1").mouseover(function () {
                $("#dj1").fadeTo(400, 1);
});

$("#dj1").mouseleave(function () {
                $("#dj1").fadeTo(400, 0.4);
});

$("#dj2").mouseover(function () {
                $("#dj2").fadeTo(400, 1);
});
$("#dj2").mouseleave(function () {
                $("#dj2").fadeTo(400, 0.4);
});

how can i write a function that will handle both divs instead of copying the same code for each instances of the div?

Thanks