var slideTime = 2000;
var floatAtBottom = false;

function pepsi_floating_init()
{
	xMoveTo('floating_banner_right', 880 - (800-screen.width), 0);

	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');
  }

	if( screen.width <= 800 )
	{
		xSlideTo('floating_banner_left', (screen.width - (800-780) - 772)/2, y+1, slideTime);
  		xSlideTo('floating_banner_right', (screen.width - (800-775) + 772)/2-114, y+1, slideTime);
	}
	else
	{
		xSlideTo('floating_banner_left', (screen.width - (800-780) - 772)/2-114 , y+1, slideTime);
  		xSlideTo('floating_banner_right', (screen.width - (800-775) + 772)/2, y+1, slideTime);
	}
}
function checkScreenWidth()
{
	if( screen.width <= 800 )
	{
		document.getElementById('floating_banner_left').style.display = 'none';
	}

	if(screen.width < 800)
	{
		
		document.getElementById('floating_banner_right').style.display = 'none';
	}
}
