[jQuery] If I simulate a click images are not updated

[jQuery] If I simulate a click images are not updated


I'm quite new to jquery but this thing looks quite odd.
In my default.aspx I have two div tags with background images. I
attached a onclick to them.
<div id="btnsale" onclick="Javascript:ClickSale();">
<div id="btnrent" onclick="Javascript:ClickRent();">
and in css:
#btnsale {
    background-image:url(../images/btn_sale_o.png);
    }
#btnrent {
    background-image:url(../images/btn_rent.png);
    }
then I have an input tag:
<input type="button" id="hbtnsr" style="display:none" runat="server"
onserverclick="SRChanged"/>
The ClickSale/Rent functions simply swap images and then simulate a
click over an input tag to call a code behind method:
$("#btnrent").css("background-image", "url(images/
btn_rent_o.png)");
$("#btnsale").css("background-image", "url(images/
btn_sale.png)");
$("#hbtnsr").click();
Now if I remove the "$("#hbtnsr").click();" images swap fine but if I
simulate the click the images don't update/swap!
It looks like the call to a code behind method prevents the update/
refresh of the images.
Any idea of the reason and how to fix this?
Thanks!
Pietro