

/*var Slide = Class.create();
Slide.prototype = {
	//our 'constructor'
	initialize: function(start, end){
		
	},
	
	expand: function(dir,elementID){
		divID=elementID;
		vwidth = this.offsetWidth;
		
		expandAmount = 30 + vwidth;
		expandAmount = ((endAmount - vwidth)/6) + vwidth;
		if (expandAmount >= endAmount )
		{
			expandAmount=endAmount;
			clearInterval ( expandIntervalId );
		}
    	document.getElementById(divID).style.width = expandAmount;
	}
	

};	*/

/*var SlideT = function(){
		this.id=document.getElementById('btndesigner');
		vwidth = document.getElementById('btndesigner').offsetWidth;
		expandAmount = 30 + vwidth;
    	document.getElementById('btndesigner').style.width = expandAmount;
		
};*/

/*function Klass(name) {

this.name = name;

this.handle = null;

	this.startTimer = function() {

		this.handle = setInterval(function(obj) {

			return(function() {

			alert(obj.name);

			});

		}(this), 5000);

	}
}
*/
/*SlideT.testy = Class.create({
					  
	start: function() {
  	this.name="hi";
  	},
	
  	loop: function() {
		//alert(this.name);
  	},
	
  	
		
});*/
//SlideT.testy,
SlideT = Class.create({
		  
	initialize: function(id) {
		this.element=document.getElementById(id);
		this.org = 80;
		this.end = 110;
		this.totalSteps = (this.end - this.org) / 3;
		this.step = 0;
  	},
	
	
	start: function(state) {
		this.step = 0;
		this.state = state;
		
		if(this.interval)
		  clearInterval(this.interval);
	
		var me = this;
		this.interval = setInterval(function() {
		  me.update();
		}, 30);
	},
	
	update: function() {
		if (this.state == 'expand'){
			
			
			
			//expandAmount = this.element.offsetWidth + 5;
			endAmount = this.end;
			//expandAmount = (-Math.cos(this.element.offsetWidth*Math.PI)/2) + .5
			//expandAmount = (((this.end - this.element.offsetWidth)/5).round()+1) + this.element.offsetWidth;
			//Math.ceil()
			//target=(expandAmount < this.end);
			
			dif = this.end - this.org;
			expandAmount = this.org+(Math.pow(((1 / this.totalSteps) * this.step), 0.5) * dif)
			
		}
		else if (this.state == 'contract')
		{
			
			//expandAmount = this.element.offsetWidth - 5;
			
			endAmount = this.org;
			
			dif = this.end - this.org;
			expandAmount = this.end-(Math.pow(((1 / this.totalSteps) * this.step), 0.5) * dif)
			//pos = this.end - this.element.offsetWidth;
			//width = this.element.offsetWidth;
			//mod = Math.ceil((dif - pos)/4);
			//expandAmount = width - mod;
			
			
			//target=(expandAmount > this.org);
			
		}
			if (this.step < this.totalSteps){
				amount = expandAmount;
				this.step++;
				//alert(width + " " +mod);
			}
			
			else
			{
				amount = endAmount;
				clearInterval ( this.interval );
				//alert(expandAmount);
			}
			//alert(expandTest);
			//alert(width + " " +mod);
			this.element.style.width = amount +"px";
			
  	},
	
  	clear: function() {
		clearInterval ( this.interval );
  	}
	
});



//element.getOpacity()
 //effect.element.hide().setStyle({opacity: oldOpacity});