function CountJs(){
	this.start="";
	this.maxCount=1;
	this.currentCount=1;
	this.addtion=5;
	this.baseCurrent=1;
	this.baseView=10;
}
CountJs.prototype.setStart = function(startTime){
	this.start = startTime;
}

CountJs.prototype.setAddtion = function(addi){
	this.addtion = addi;
}

CountJs.prototype.setBaseCurrent =  function(current){
	this.baseCurrent = current;
}

CountJs.prototype.setBaseView = function(baseView){
	this.baseView = baseView;
}

CountJs.prototype.cal = function(cal){
	var dateObj = new Date(Date.parse(this.start.replace(/-/g,   "/")));
	var nowDate = new Date();
	var mins = (nowDate.getTime()-dateObj.getTime())/1000/60;
	var seed = (Math.random()*100000)%100;
	if(mins>0){
		this.currentCount = parseInt(this.baseCurrent+(mins*this.addtion)/10+seed);
		this.maxCount = parseInt(mins*this.addtion+this.currentCount+seed+this.baseView);
	}else{
		this.currentCount = parseInt(this.baseCurrent+seed);
		this.maxCount = parseInt(this.currentCount+seed+this.baseView);
	}	
}

CountJs.prototype.getMaxViews = function(){

	return this.maxCount;
}

CountJs.prototype.getCurrentViews = function(){
	return this.currentCount;	
}

