<!-- 
var Class = {
  create: function() {
    return function() {
      this.initialize.apply(this, arguments);
    }
  }
}

var $A = Array.from = function(iterable) {
  if (!iterable) return [];
  if (iterable.toArray) {
    return iterable.toArray();
  } else {
    var results = [];
    for (var i = 0, length = iterable.length; i < length; i++)
      results.push(iterable[i]);
    return results;
  }
}

Function.prototype.bind = function() {
  var __method = this, args = $A(arguments), object = args.shift();
  return function() {
    return __method.apply(object, args.concat($A(arguments)));
  }
}
/*
	分页垂直滚动
	使用方法：
	var mymarquee = new marquee(height,id);
	mymarquee.init_srolltext();
*/
var marquee = Class.create();
marquee.prototype = {
	initialize: function(marqueesHeight, icefable) {
    this.marqueesHeight = marqueesHeight;
    this.icefable = icefable;
    this.stopscroll = false;
	this.icefable.style.width=0;
	this.icefable.style.height=this.marqueesHeight;
	this.icefable.style.overflowX="visible";
	this.icefable.style.overflowY="hidden";
	this.icefable.noWrap=true;
	this.icefable.onmouseover=this.stopscroll_t.bind(this);
	this.icefable.onmouseout=this.stopscroll_f.bind(this);
	this.preTop=0;
	this.currentTop=this.marqueesHeight;
	this.stoptime=0;
	this.icefable.innerHTML+=this.icefable.innerHTML;
    //this.init_srolltext();
	},
	
	init_srolltext: function(){
	  this.icefable.scrollTop=0;
	  setInterval(this.scrollUp.bind(this),1);
	},

	scrollUp: function(){
	  if(this.stopscroll==true) return;
	  this.currentTop+=1;
	  if(this.currentTop==this.marqueesHeight+1)
	  {
		this.stoptime+=1;
		this.currentTop-=1;
		if(this.stoptime==300) 
		{
			this.currentTop=0;
			this.stoptime=0;  		
		}
	  }
	  else {  	
		  this.preTop=this.icefable.scrollTop;
		  this.icefable.scrollTop+=1;
		  if(this.preTop==this.icefable.scrollTop){
			this.icefable.scrollTop=this.marqueesHeight;
			this.icefable.scrollTop+=1;
			
		  }
	  }

	},

	stopscroll_f: function(){
		this.stopscroll=false;
	},

	stopscroll_t: function(){
		this.stopscroll=true;
	}


}
/*
	分页滚动结束
*/
/*
	水平滚动
	垂直滚动
	使用方法：typeid:0/1
	var mymarquee2 = new marquee2(id,speed,typeid);
	mymarquee2.Start();
*/
var marquee2 = Class.create();
marquee2.prototype = {
	initialize: function(id, speed, typeid) {
		this.speed = speed;
		this.id = document.getElementById(id);
		this.typeid = typeid;
		this.id1 = document.getElementById(id+"1");
		this.id2 = document.getElementById(id+"2");
		this.id.onmouseover=this.mose_over.bind(this);
		this.id.onmouseout=this.mose_out.bind(this);
		this.id2.innerHTML = this.id1.innerHTML;
		this.myMar = "";
	},

	Start: function(){
		if (this.typeid== 0)
		{
			this.myMar = setInterval(this.marquee_w.bind(this),this.speed);
		}else{
			this.myMar = setInterval(this.marquee_h.bind(this),this.speed);
		}
		
	},
	
	//水平
	marquee_w: function(){
		if (this.id2.offsetWidth - this.id.scrollLeft<=0)
		{
			this.id.scrollLeft-=this.id1.offsetWidth;
		}else{
			this.id.scrollLeft++;
		}
	},

	//垂直
	marquee_h: function(){
		if (this.id2.offsetTop-this.id.scrollTop<=0)
		{
			this.id.scrollTop-=this.id1.offsetHeight;
		}else{
			this.id.scrollTop++;
		}
	},
	
	

	mose_over: function(){
		clearInterval(this.myMar);
	},

	mose_out: function(){
		if (this.typeid== 0)
		{
			this.myMar = setInterval(this.marquee_w.bind(this),this.speed);
		}else{
			this.myMar = setInterval(this.marquee_h.bind(this),this.speed);
		}
	}
}
/*结束*/




