


function ftools(numer,idk) {
    
    
    var elem='tools_' +numer;
    var tab='pm_' +numer;
 
    
         if (document.getElementById(elem).style.display == 'none') {
        Effect.Appear(elem);
     } else {
          Effect.Fade(elem);
          
          if (document.getElementById(tab).style.display != 'none') {
    
   Effect.BlindUp(tab);
    
   
   }    
          
     }

    
    }



















function fpm(user,pid,tid,from,tab){
	
	
	
   if (document.getElementById(tab).style.display == 'none') {
   	
   Effect.BlindDown(tab);
          
          
   
      	var url = 'ajax.php?mod=forum&action=pm&user=' + user +'&pid='+ pid  ;
	new Ajax.Request(url, {
	  method: 'get',
	 

	  onSuccess: function(transport) {
	  	

	  	
	  Effect.Appear('pm_'+pid);
      
		new Ajax.Updater('pm_'+pid, 'ajax.php?mod=forum&action=pm&user=' + user +'&pid='+ pid+'&kto='+ from +'&tid='+ tid, {asynchronous:true, evalScripts:true, encoding:'iso-8852-2'});	
		   
		   
		}
	}); 
          
          
     } else {
       Effect.BlindUp(tab);
     }



	





}



/*
function send_pm(numer,pid){
    
    
    
    
    
advAJAX.post({
url: "ajax.php?mod=forum&action=sendpm",
parameters : {
"object" : "pmform_" + document.getElementById("pid").value, 
"tytul" : document.getElementById("tytul").value,
"tekst" : document.getElementById("tekst").value,
"search" : document.getElementById("search").value,
"tid" : document.getElementById("tid").value,
"pid" : document.getElementById("pid").value
},
			
			
		onLoading : function(obj) { document.getElementById(obj.tag).innerHTML = '<div align="center" style="height:40px; padding-top:80px;"><img src="ajax/img/load.gif" width="220" height="19" border="0"></div>' ; },
   		onSuccess : function(obj) { document.getElementById(obj.tag).innerHTML = obj.responseText ; },
   		onError : function(obj) { document.getElementById(obj.tag).innerHTML = "err..."; }
	});
	
advAJAX.get({ url : "ajax.php?mod=forum&action=wyslane" , tag: "pm_" + pid });
parameters: { tytul: $F('tytul'), tekst: $F('tekst'), search: $F('search'), tid: $F('tid'), pid: $F('pid') },
}
*/


function send_pm(numer,pid){


 
     var tab='pm_' +pid;
 
	var url = 'ajax.php?mod=forum&action=sendpm' ;
	new Ajax.Request(url, {
	  method: 'post',
	  
 parameters: { tytul: $F('tytul'), tekst: $F('tekst'), search: $F('searche'), tid: $F('tid'), pid: $F('pid') },


onLoading : function(obj) { document.getElementById(obj.tag).innerHTML = '<div align="center" style="height:40px; padding-top:80px;"><img src="ajax/img/load.gif" width="220" height="19" border="0"></div>' ; },

	  onSuccess: function(transport) {

		   $('pm_'+pid).innerHTML = transport.responseText;
           
          //Element.hide.delay(1.5, 'pm_'+pid);

          Effect.BlindUp.delay(1.5, 'pm_'+pid);;
           
           
         
           
           
		}
	});

}

