/** 
* Stack 
* @date: February 8, 2006
* @author: Brian Willy (a348146), Fidelity Investments
* Orignal source unknown, modified from: http://99.9thpercentile.com/about-atreus.html
*/

function Stack() {
	this.stack = new Array();
	this.top = 0;
	this.push=function(a) {
		debugStackPush(a);
		this.stack[this.top++]=a;
		//this.draw();
		return;
	}
	this.pop=function() {
		a=(this.top>0)?this.stack[--this.top]:-1;
		//this.draw();
		debugStackPop(a);
		return a;
	}
	this.getTop=function() {
		return this.stack[this.top-1];
	}

	/*
	this.draw=function() {
		st=document.getElementById("stack");
		st.innerHTML="";
		for(i=this.top-1;i>=0;i--) 
			st.innerHTML+=this.stack[i]+"<br/>";
	}
	*/
}
