var RollRocommend = {
	timer : 0,
	clone1 : null,
	clone2 : null,
	clone3 : null,
	clonewrap1 : null,
	clonewrap2 : null,
	clonewrap3 : null,
	effect : false,

	load : function() {
		this.clone1 = document.createElement('div');
		this.clone2 = document.createElement('div');
		this.clone3 = document.createElement('div');
		this.clonewrap1 = document.createElement('div');
		this.clonewrap2 = document.createElement('div');
		this.clonewrap3 = document.createElement('div');
		var pos = [];

		this.clone1.className = 'recommend_clone';
		this.clone2.className = 'recommend_clone';
		this.clone3.className = 'recommend_clone';
		pos = Position.positionedOffset($('recommend_list1'));
		$(this.clone1).setStyle({
			position : 'absolute',
			display : 'none'
		});
		$(this.clonewrap1).setStyle({
			position : 'absolute',
			overflow : 'hidden',
			width : '340px',
			height : '55px',
			left : pos[0] + 'px',
			top : pos[1] + 'px'
		});
		pos = Position.positionedOffset($('recommend_list2'));
		$(this.clone2).setStyle({
			position : 'absolute',
			display : 'none'
		});
		$(this.clonewrap2).setStyle({
			position : 'absolute',
			overflow : 'hidden',
			width : '340px',
			height : '55px',
			left : pos[0] + 'px',
			top : pos[1] + 'px'
		});
		pos = Position.positionedOffset($('recommend_list3'));
		$(this.clone3).setStyle({
			position : 'absolute',
			display : 'none'
		});
		$(this.clonewrap3).setStyle({
			position : 'absolute',
			overflow : 'hidden',
			width : '340px',
			height : '55px',
			left : pos[0] + 'px',
			top : pos[1] + 'px'
		});

		this.clonewrap1.appendChild(this.clone1);
		this.clonewrap2.appendChild(this.clone2);
		this.clonewrap3.appendChild(this.clone3);
		document.body.appendChild(this.clonewrap1);
		document.body.appendChild(this.clonewrap2);
		document.body.appendChild(this.clonewrap3);
		this.effect = true;
	},
	start : function() {
		var recommendList1 = $('recommend_list1');
		var recommendList2 = $('recommend_list2');
		var recommendList3 = $('recommend_list3');

		if(!this.timer) {
			this.timer = setInterval(function() {
				if(recommendList1.childNodes.length) {
					if(this.effect && this.clone1) {
						this.clone1.innerHTML = recommendList1.childNodes[0].innerHTML;
						Animation.add({
							object : this.clone1, 
							effect : 'movey', 
							ease : 'easeInQuad', 
							spendTime : 300,
							delayTime : 900,
							initA : 0, 
							markA : 0 - 60,
							raise : function(item) {
								item.object.show();
								recommendList1.appendChild(recommendList1.removeChild(recommendList1.childNodes[0]));
							},
							callback : function(item) {
								item.object.hide();
							}
						}).start();
					}else {
						recommendList1.appendChild(recommendList1.removeChild(recommendList1.childNodes[0]));
					}
				}
				if(recommendList2.childNodes.length) {
					if(this.effect && this.clone2) {
						this.clone2.innerHTML = recommendList2.childNodes[0].innerHTML;
						Animation.add({
							object : this.clone2, 
							effect : 'movey', 
							ease : 'easeInQuad', 
							spendTime : 300,
							delayTime : 700,
							initA : 0, 
							markA : 0 - 60,
							raise : function(item) {
								item.object.show();
								recommendList2.appendChild(recommendList2.removeChild(recommendList2.childNodes[0]));
							},
							callback : function(item) {
								item.object.hide();
							}
						}).start();
					}else {
						recommendList2.appendChild(recommendList2.removeChild(recommendList2.childNodes[0]));
					}
				}
				if(recommendList3.childNodes.length) {
					if(this.effect && this.clone3) {
						this.clone3.innerHTML = recommendList3.childNodes[0].innerHTML;
						Animation.add({
							object : this.clone3, 
							effect : 'movey', 
							ease : 'easeInQuad', 
							spendTime : 300,
							delayTime : 500,
							initA : 0, 
							markA : 0 - 60,
							raise : function(item) {
								item.object.show();
								recommendList3.appendChild(recommendList3.removeChild(recommendList3.childNodes[0]));
							},
							callback : function(item) {
								item.object.hide();
							}
						}).start();
					}else {
						recommendList3.appendChild(recommendList3.removeChild(recommendList3.childNodes[0]));
					}
				}
			}.bind(this), 3000);
		}
	},
	stop : function() {
		if(this.timer) {
			clearInterval(this.timer);
			this.timer = 0;
		}
	}
}
