/*

Beauty Entry Slider by elements.at
Author: Elements

*/

var oldDownId = "entry_0";
var detailOpen = false;
		
	function flipper(id,element)
	{
		
		element.onclick = function () {}
		downId = "entry_" + id;
				
		if(detailOpen == false)
		{
			
			Effect.BlindDown(downId,{afterFinish:function(){ element.onclick = function () { flipper(id,element); }}});
			
			container = "full"+ downId;
			document.getElementById(container).className = "entry open"
			
			oldDownId = downId;
			detailOpen = true;
					
		
		}
		else
		{
		
			if(downId != oldDownId)
			{	
				//Close old, open new
				Effect.BlindUp(oldDownId,{afterFinish:function(){Effect.BlindDown(downId,{afterFinish:function(){ element.onclick = function () { flipper(id,element); }}});}});
						
				containerNew = "full"+ downId;
				document.getElementById(containerNew).className = "entry open"
				containerOld = "full"+ oldDownId;
				document.getElementById(containerOld).className = "entry"
				
				detailOpen = true;
				oldDownId = downId;
			}
			else
			{
				//Close old
				Effect.BlindUp(downId,{afterFinish:function(){ element.onclick = function () { flipper(id,element); }}});
				
				container = "full"+ downId;
				document.getElementById(container).className = "entry"
				
				detailOpen = false;	
				oldDownId = "entry_0";
			}
		}
				
	}