/**
 * 购物车js 添加、删除、修改、分页构建、跳转页面数据构建

 * 
 */

/**
 * 滚动条跟随

 * 
 */
function scrollImg() {
	 var sh = window.screen.height * 0.5
	 var sw = window.screenLeft + window.screen.width * 0.75
	
	 var  posY;
	 if (window.innerHeight) {
	 posY = window.pageYOffset;
	 } else if (document.documentElement &&
	 document.documentElement.scrollTop) {
	 posY = document.documentElement.scrollTop;
	 } else if (document.body) {
	 posY = document.body.scrollTop;
	 }
	
	 var ad = document.getElementById("myCart");
	 ad.style.top = (posY + getPosY(posY)) + "px";
	 ad.style.left = 72+ "%";
	 setTimeout("scrollImg()", 100);
}
/**
 * 获取x坐标增加值

 * @param {} posX
 */
function getPosY(posY)
{
	if(posY==0)
	{
		return 450
	}
	if(posY>0&&posY<50)
	{
		return 450
	}
	if(posY>50&&posY<100)
	{
		return 440
	}
	if(posY>100&&posY<150)
	{
		return 400
	}
	if(posY>150&&posY<200)
	{
		return 370
	}
	if(posY>200&&posY<250)
	{
		return 350
	}
		if(posY>250&&posY<300)
	{
		return 330
	}
	if(posY>300&&posY<350)
	{
		return 310
	}
	if(posY>350&&posY<=400)
	{
		return 290
	}
	if(posY>=400)
	{
		return -20
	}
	
}
