$(document).ready(function(){
	$('div.stabilizer .main-banner-column .bannerHomeImage div.stabilizer table.noPDA').click(function() {
    		openPopup('video', 'html', openPopupTitle);
	});

	$('.bannerHomeImage table.noPDA').css({backgroundRepeat: 'repeat-x'})

	$('.bannerHomeImage table.noPDA').mouseover(function(){
			var bp_left = Math.round($(this).css('backgroundPosition').substring(0, $(this).css('backgroundPosition').indexOf("px")));
			$(this).animate({backgroundPosition: ( bp_left -10000 + 'px 0px')}, 100000, 'linear');
		}).mouseout(function(){
			$(this).stop();
		})
});

function openPopup(eLink, html, title) {
	var newWin = window.open('about:blank', eLink.target, 'width=600,height=328,status=yes');
	var bFlag = true;

	if (newWin) {
		newWin.document.open();
		newWin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="ru" xml:lang="ru"><head><title>' + title + '</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript" src="/common/js/jquery-1.4.2.min.js"></script><script type="text/javascript" src="/common/js/swfobject.js"></script><style type="text/css">body{margin:0; padding:0;} img {border:0;}</style></head>'+
		'<body>'+
		'<div id="flashcontent"><p><a href="http://www.adobe.com/go/getflashplayer" target="_blank"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt=""/></a></p></div>'+
		'<script type="text/javascript" src="/common/js/10-year-addition.js"></script>'+
		'</body></html>');

		newWin.document.close();
		bFlag = false;
	}
	return bFlag;
}
