<script type="text/javascript" src="http://yandex.st/jquery/1.4.4/jquery.min.js"></script>
<style type="text/css">
#chatBODY {
width: 350px;
height: 400px;
background-color: #eaeaea;
position: fixed;
z-index: 8;
right: -300px;
top: 175px;
margin: 0px 0px 0px 0px;
border: 1px solid #d5d5d5;
}
#showchatBtn {
width: 50px;
height: 100%;
background-color: #c8c8c8;
position: relative;
z-index: 9;
}
#chat {
position: absolute;
height: 400px;
width: 300px;
top: 0px;
right: 0px;
}
</style>
<div id="chatBODY"><div id="showchatBtn">1</div><div id="chat"></div></div>
<script type="text/javascript">
$('#showchatBtn').not('.Active').click( function() {
$("#chatBODY").stop(true,true)
$("#chatBODY").animate({"right":"0"},600,"linear", function(){$('#showchatBtn').addClass('Active')});
});
$('#showchatBtn.Active').live('click', function() {
$("#chatBODY").stop(true,true)
$("#chatBODY").animate({"right":"-300px"}, 600, "linear",function() {$('#showchatBtn').removeClass('Active')});
});
</script>