var varlist = new Array();
var old_element="";
var old_tit="";

document.observe("dom:loaded", function() {

}); 


function show(ts)
{
	
new Effect.Appear(ts, 
		{duration:1, from:0, to:1.0});	
	
}




function ch_foto(pid,num)
{
	num_el=pid+"_"+num;
	el="ft_"+pid;	
	new Effect.Fade(el, 
       {duration:1, from:0, to:1.0});
	
	url="ajax_gate.php?link="+pid+"&op=detalhe";
	new Ajax.Request(url,   {     method:'get',
    onSuccess: function(transport)
	{  
		var response = transport.responseText || "no response text";      
		response="<div id='"+el+"' style='display:none;'>"+response+"</div>";
		$(el).replace(response); 	
		new Effect.Appear(el, 
		{duration:1, from:0, to:1.0});
		
		
	 },     
	onFailure: function()
	{ 
  		alert('Something went wrong...') }   
	}); 
}

function fx(fx,el,pid)
{
	//ch_foto(pid,1);	
	
	if (fx=="open")
	{
		if (old_element==el)
		{
			new Effect.Morph(old_element, {
			style: 'height:40px;background-color:red;', 
			duration: 0.3 });	
			old_element="";
			if (old_tit)
			{			  
				$(old_tit).toggleClassName('link_down_port_act'); 
				old_tit="";
			}
		}
		else
		{
			if (old_element)
			{		
				new Effect.Morph(old_element, {
				style: 'height:40px;background-color:red;', 
				duration: 0.3 });					
			}			
			old_element=el;							
			if (old_tit)
			{			  
				$(old_tit).toggleClassName('link_down_port_act'); 
			}
			
			
			
			
			
			
 
	el_ajax="ft_"+pid;	
	
	
	url="ajax_gate.php?link="+pid+"&op=detalhe";
	new Ajax.Request(url,   {     method:'get',
    onSuccess: function(transport)
	{  
		var response = transport.responseText || "no response text";      
		response="<div id='"+el_ajax+"' style='display:none;'>"+response+"</div>";
		$(el_ajax).replace(response); 	
		new Effect.Appear(el_ajax, 
		{duration:1, from:0, to:1.0});
		
		
		
			el_tit="lk_"+pid;	
			old_tit=el_tit;
			ht=$(el_ajax).getHeight(); 
			$(el_tit).toggleClassName('link_down_port_act'); 
			new Effect.Morph(el, {
			style: 'height:'+(ht+80)+'px;', 
			duration: 0.3 });
		
		
		
		
	 },     
	onFailure: function()
	{ 
  		alert('Something went wrong...') }   
	}); 
			
			
			
			
			
			
			
			
		
		}
	}
}

