// Vertikal Slider Element
var vertical_Slider = Class.create();
vertical_Slider.prototype = {

	initialize : function (elems,entryName)
	{
		this.container = elems;
		this.containerName = entryName;
		this.actualOpen = 0;
		this.writeEvents();

	},
	
	writeEvents : function ()
	{		
		for( i=0; i<this.container.length; i++ )
		{
			this.container[i].head = this.container[i].getElementsByClassName('head')[0];
			this.container[i].head.observe('click', this.press);
			this.container[i].head.myClass = this;
			this.container[i].head.myID = i;
		
			this.container[i].content = this.container[i].getElementsByClassName('detail')[0];

			if(i != 0)
			{
				this.container[i].statusOpen = false;
				this.container[i].className = this.containerName;
				this.container[i].content.style.display = 'none';
			}
			else
			{
				this.container[i].statusOpen = true;
				this.container[i].className = this.containerName+' active';
				this.container[i].content.style.display = 'block';
			}
		}
	},
	

	press : function ()
	{
		if(this.myClass.container[this.myID].statusOpen == false)
		{
			this.myClass.slide(this.myID);	
		}
	},
	
	
	slide : function (id)
	{		
		this.newID = id;		
		
		this.container[this.newID].className = this.containerName+' active';
		this.container[this.actualOpen].className = this.containerName;
	
	
		  new Effect.Parallel(
            [ 
                new Effect.BlindUp(this.container[this.actualOpen].content,{sync: true}), 
        		new Effect.BlindDown(this.container[this.newID].content,{sync: true}) 
            ], 
            { 
                duration: 0.5,
				fps:40
			}
		);
						
		this.container[this.actualOpen].statusOpen = false;
		this.container[this.newID].statusOpen = true;
		this.actualOpen = this.newID;
	}
	

}






