// SYHAN

var slideTime = 1000;
var floatAtBottom = false;

function pepsi_floating_init()
{
	xMoveTo('floating_banner_right',(screen.width - (800-778) + 763)/2+18+0.5, 500);
	xMoveTo('floating_banner_left', (screen.width - (800-778) - 763)/2-100-19+0.5 , 500);
	winOnResize(); // set initial position
	xAddEventListener(window, 'resize', winOnResize, false);
	xAddEventListener(window, 'scroll', winOnScroll, false);
}
function winOnResize() {
	checkScreenWidth();
	winOnScroll(); // initial slide
}
function winOnScroll() {
  var y = xScrollTop();
  if (floatAtBottom) {
    y += xClientHeight() - xHeight('floating_banner_left');
  }
  xSlideTo('floating_banner_right', (screen.width - (800-778) + 763)/2+18+0.5, y, slideTime);
  xSlideTo('floating_banner_left', (screen.width - (800-778) - 763)/2-100-19+0.5 , y, slideTime);
}
	
function checkScreenWidth()
{
	if( screen.width <= 800 )
	{
		document.getElementById('floating_banner_left').style.display = 'none';
		document.getElementById('floating_banner_right').style.display = 'none';
	}
}


