function latestnews(name,id,width,height,auto,delay,speed,cards) {
	/* Init */
	this.name = name;
	this.id = id;
	this.width = width;
	this.height = height;
	this.auto = auto;
	this.delay = delay;
	this.cards = cards;
	this.speed = speed;
	this.child = null;
	this.parent = null;
	this.current = null;
	this.total = cards.length;
	this.slideAmount = width;
	this.amountSlid = 0;
	this.currentElement = null;
	this.enteringElement = null;
	this.nextElement = null;
	this.previousElement = null;
	this.active = false;
	
	this.init = function(){
		this.childlength = this.slideAmount * 4;
		this.parent = document.getElementById(this.id);
		this.parent.innerHTML = '<div id="'+this.id+'_child" class="child" style="width:'+this.childlength+'px; height:'+this.height+'px;position:absolute;top:0px;left:0px;"></div>';
		
		var childDivName = this.id + '_child';
		this.child = document.getElementById(childDivName);
		this.child.innerHTML = this.cards[0];
		for(var i=1;i<this.total;i++) {
			this.child.innerHTML += this.cards[i];
		}
		this.current = 0;
		this.currentElement = document.getElementById('news_artical_'+this.current);
		this.currentElement.style.left = '0px';
		this.currentElement.style.display = '';
		this.active = false;
		
		if(this.auto == true){
			autoslide = setInterval(this.name+".next()",this.delay);
		}
	}
	this.next	= function(){
		if(!featuretteRunning) return;
		if(this.active == false) {
			this.active = true;
			clearInterval(autoslide);
			
			if(this.current < (this.total - 1)) {
				// more than one left
				var comingUp = this.current + 1;
			}
			else {
				// less than two left
				var comingUp = 0;
			}
			
			// Get cards
			this.currentElement = document.getElementById('news_artical_'+this.current);
			this.enteringElement = document.getElementById('news_artical_'+comingUp);
			
			// Preset locations
			this.currentElement.style.left = '0px';
			this.enteringElement.style.left = this.slideAmount+'px';
			this.currentElement.style.display = '';
			this.enteringElement.style.display = '';
			
			// Auto set next card already
			this.current = comingUp;
			this.amountSlid = 0;
			this.amountLeftToSlide = this.slideAmount;
			slider = setInterval(this.name+".slide(1)",50);
		}
	}
	this.previous	= function(){
		if(this.active == false) {
			this.active = true;
			clearInterval(autoslide);
			
			if(this.current > 0) {
				// more than one left
				var comingUp = this.current - 1;
			}
			else {
				// less than two left
				var comingUp = (this.total - 1);
			}
			
			// Get cards
			this.currentElement = document.getElementById('news_artical_'+this.current);
			this.enteringElement = document.getElementById('news_artical_'+comingUp);
			
			// Preset locations
			this.enteringElement.style.left = '-'+this.slideAmount+'px';
			this.currentElement.style.left = '0px';
			this.currentElement.style.display = '';
			this.enteringElement.style.display = '';
			
			// Auto set next card already
			this.current = comingUp;
			this.amountSlid = 0;
			this.amountLeftToSlide = this.slideAmount;
			slider = setInterval(this.name+".slide(-1)",50);
		}
	}
	this.slide = function(direction) {
		if(this.amountLeftToSlide > (this.speed - 1)) {
			if(direction == 1) {
				// Next slide
				this.amountSlid = this.amountSlid + this.speed;
				this.amountLeftToSlide = this.amountLeftToSlide - this.speed;
				
				var firstone = 0 - this.amountSlid;
				
				this.currentElement.style.left = firstone+'px';
				this.enteringElement.style.left = this.amountLeftToSlide+'px';
			}
			else {
				// Previous slide
				this.amountSlid = this.amountSlid + this.speed;
				this.amountLeftToSlide = this.amountLeftToSlide - this.speed;
				
				var newone = this.slideAmount - this.amountSlid;
				
				this.currentElement.style.left = this.amountSlid+'px';
				this.enteringElement.style.left = '-'+newone+'px';
			}
		}
		else {
			this.currentElement.style.left = this.slideAmount+'px';
			this.enteringElement.style.left = '0px';
			// stop slide
			clearInterval(slider);
			this.active = false;
			this.amountSlid = 0;
			this.amountLeftToSlide = this.slideAmount;
			this.currentElement.style.display = 'none';
			
			if(this.auto == true){
				autoslide = setInterval(this.name+".next()",this.delay);
			}
		}
	}
}
