<head>
...
<script type="text/javascript" src="http://obj.altapress.ru/js/jquery.js?144"></script>
...
</head>
<body>
...
<div class="ContentBox" id="RelatedBox">
<a href="#" class="close_link">Закрыть</a>
<b>Также рекомендуем:</b>
...
</div>
<script type="text/javascript">
//sleptor was here
var related = {
scroll_flag:0,
width: 300,
checkPos:function () {
if ($(window).width() < 1200) return;
var tmp = Math.round($(window).scrollTop() + $(window).height() - $("#RelatedSpy").position().top - 100);
if ((tmp > 0) && (!this.scroll_flag)) {
this.scroll_flag = 1;
$('#RelatedBox').stop(true).animate({left:'0px', opacity:'1'}, { queue:false, duration:500});
}
if ((tmp < 0) && (this.scroll_flag)) {
this.scroll_flag = 0;
$('#RelatedBox').stop(true).animate({left:-this.width+'px', opacity:'0'}, {queue:false, duration:500});
}
},
close: function() {
$('#RelatedBox').stop(true).animate({left:-this.width+'px',opacity:'0'},{queue: false, duration: 500});
}
};
$(function(){
$('#RelatedBox a.close_link').bind('click', function () {
related.close();
return false;
});
related.checkPos();
$(window).scroll(function(e) {
related.checkPos()
});
});
</script>
...
</body>