/*******************************************************************
*
*	Creative + Communications Portfolio
*	
*	The individual portfolio slides	
*	
*	Andrew Karpenko
*	206-221-4564
*	akarpy@u.washington.edu	
*
********************************************************************/

function Slide(id) {
	/* 
	 *	Setup the main variables
	 */
	this.ident 			= "slide";
	//our own index, and total pieces created
	if ( typeof Slide.total == 'undefined' ) {
        this.index = Slide.total = 0;
    }else{
    	this.index = ++Slide.total;
    }
    //the id of the HTML element representing this object
	this.htmlID 		= (id != "" ? id : "portfolio_slide_"+this.index);
	this.imgWidth		= 0;
	//pointer to the html img object relevant to this slide
	this.img			= "";
	//pointer to the jQuery object for this slide
	this.self			= "";
	
	this.currentState  	= {
		active		: false		//whether it is displayed
	}
	
	
	/*
	 *	Sets the active state of the slide, as well as changes the display of 
	 *		the slide
	 */
	this.setActive = function(to) {
		var s = this;
		
		if(to != s.currentState.active){
			if(to){
				s.self.fadeIn("slow");
			}else{
				s.self.fadeOut("slow");
			}
		}
	}
	
}
