// JavaScript Document
var slideTime = 500;
var floatAtBottom = false;



function winOnScroll() {
  var y = xScrollTop();
  if (floatAtBottom) {
    y += xClientHeight() - xHeight('floating_banner_left');
  }

  //tmp1 = parseInt((document.body.clientWidth - 1000)/2);
  //xSlideTo('floating_banner_left', document.body.clientWidth - (1000 + tmp1 + 120) , y, slideTime);
  xSlideTo('floating_banner_left', (document.body.clientWidth/2) - 500 , y, slideTime);
  //xSlideTo('floating_banner_right', document.body.clientWidth - (tmp1 - 5) , y, slideTime); 
  xSlideTo('floating_banner_right', (document.body.clientWidth/2) + 428, y, slideTime); 
  
}
	

function winOnResize() {
	//checkScreenWidth();
	winOnScroll(); // initial slide
}

function checkScreenWidth()
{
	if( document.body.offsetWidth < 1220 )
	{
		document.getElementById('floating_banner_left').style.display = 'none';
		document.getElementById('floating_banner_right').style.display = 'none';
	}else{
		document.getElementById('floating_banner_left').style.display = 'block';
 		 document.getElementById('floating_banner_right').style.display = 'block';	
	}
}


xMoveTo('floating_banner_right',document.body.offsetWidth, 0);

winOnResize(); // set initial position
xAddEventListener(window, 'resize', winOnResize, false);
xAddEventListener(window, 'scroll', winOnScroll, false);
	
	