// constructor for one flashcard object
function flashcard(reading, kanji) {
	this.kanji 		= kanji
	this.reading	= reading
}

function flashcard(reading, kanji, eigo, reibun) {
	this.kanji 		= kanji
	this.reading	= reading
	this.eigo		= eigo
	this.reibun		= reibun
}

function stack() {
	this.cards = new Array()
	this.removed = new Array()
	this.shuffle = shuffle
	this.addCard = addCard
	this.deleteCard = deleteCard
	this.removeCard = removeCard
	this.addBack = addBack
}

function addCard(flashcard) 	{ this.cards.push(flashcard); }
function deleteCard() 			{ if(this.cards.length>0) { 
									x=this.cards[curCard]; this.cards.splice(curCard, 1); this.removed.push(x); 
									showCard(curCard, side); } }
function removeCard(idx) 		{ x=this.cards[idx]; this.cards.splice(idx, 1); this.removed.push(x); showList(); }
function addBack(idx) 			{ x=this.removed[idx]; this.removed.splice(idx, 1); this.cards.push(x); showList(); }
function shuffle() {
	var k, temp, i
	for(i = 0; i < this.cards.length; i++) {
		temp = this.cards[i]
		k = Math.floor(Math.random() * this.cards.length)
		this.cards[i] = this.cards[k]
		this.cards[k] = temp
	}
}
