function show_comment_fx(window)
{
	$$('#'+window).each(function(element) {
		var opacityEffect = new Fx.Tween(element, {
			property: 'opacity',
			duration: 1000,
			transition: Fx.Transitions.Quart.easeInOut
		});
		opacityEffect.start(0,1);
	});			

}


function hide_comment_form()
{
	$$('div.form_window_0').each(function(element) {
		var effect = new Fx.Slide(element).hide();
			element.style.display = 'block';
	});			
}
/*
function delete_comment_fx_slide()
{
	var window1 = $('static');
	var elm = new Fx.Slide(window1,{mode: 'horizontal',}).slideOut('vertical');
}


function delete_comment(SRV)
{
	var req = new Request({
		url: SRV+'test_reload.php',
		method: 'get',
		data: { 'do' : '1' }, 
		onRequest: function() 
		{ 
			window3.set('html','<img src="images/loading.gif" />') 
		},    
		onFailure: function() 
		{ 
			window3.set('text', 'The request failed.') 
		},	
		onSuccess: function(response) 
		{  
			window3.set('text', '');
			window3.set('html',response);
			hide_comment_form();
			show_comment_fx_border(window3);
		}
	}).send();	
}


function reply_comment_fx_slide()
{
	var eml = new Fx.Slide(window1,).slideOut();
}

function reply_comment_popup()
{
	var window1 = $(window1);
		window1.style.display = 'block';	
}

function reply_comment(SRV)
{			
	var req = new Request({
		url: srv,
		data: $(form_name),
		method: 'post',
		async: true,
		onRequest: function() { 
			$(div_id).innerHTML = "<img src='images/loading.gif' />"; 
		},    
		onFailure: function() { 
			$(div_id).set('text', 'The request failed.') 
		},	
		onSuccess: function(response) { 
			$(div_id).set('html', response);  
			reply_comment_fx_slide();
		}
	}).send();
}
*/

function get_comment(SRV,ACTION_ID,MODULE_NAME,BID,USER_ID,DO_ACTION,EX_BID,USER_NAME)
{
	var currentTime = new Date();
	var random_id = currentTime.getTime();
	var div = new  Element('div' , { 'id': random_id}).injectAfter($('comment_static_'+ACTION_ID));
	var opacityEffect = new Fx.Tween(div, {
		property: 'opacity',
		duration: 0, 
		transition: Fx.Transitions.Quart.easeInOut,
		onComplete: function(exampleFxt){
			var req = new Request({
				url: SRV+'modules/'+MODULE_NAME+'/'+MODULE_NAME+'_reload_'+ACTION_ID+'.php?bid='+BID+'&module_name='+MODULE_NAME+'&user_id='+USER_ID+'&do_action='+DO_ACTION+'&ex_bid='+EX_BID+'&user_name='+USER_NAME,
				method: 'get',
				data: { 'do' : '1' }, 
				onRequest: function() 
				{ 
					$$('#'+random_id).set('html','<img src="images/loading.gif" />');
				},    
				onFailure: function() 
				{ 
					$$('#'+random_id).set('text', 'The request failed.');
				},
				onSuccess: function(response){
					$$('#'+random_id).set('text', '');
					$$('#'+random_id).set('html',response);
					hide_comment_form();
					show_comment_fx(random_id);
				}
			}).send();
		}
	});
	var window1 = $("no_comment");
	if($("no_comment")){
		window1.style.display = 'none';	
	}	
	opacityEffect.start(0,0);
}	

function reload_comment(SRV,ACTION_ID,MODULE_NAME,BID,USER_ID,EX_BID)
{
	var mooeditable = $("bericht_"+MODULE_NAME+"_reply_"+ACTION_ID+"_"+BID).mooEditable();
	mooeditable.saveContent();	
	var DO_ACTION = document.forms[MODULE_NAME+"_reply_"+ACTION_ID+"_"+BID].do_action.value;	
	var window1 = $('reply_succes_window_'+ACTION_ID);
	var window4 = $('reply_succes_window_'+ACTION_ID+"_txt");
		window1.style.display = 'block';
	var elm = new Fx.Slide($(MODULE_NAME+"_reply_"+ACTION_ID+"_"+BID)).slideOut();	
	post_data(SRV+'modules/'+MODULE_NAME+'/'+MODULE_NAME+'_comment_reply_'+ACTION_ID+'.php?comment_id='+BID+'&module_name='+MODULE_NAME+'&action_id='+ACTION_ID+'',window4,MODULE_NAME+"_reply_"+ACTION_ID+"_"+BID);	
	
	var onderwerp = document.forms[MODULE_NAME+"_reply_"+ACTION_ID+"_"+BID].onderwerp.value = "" ;	
	mooeditable.setContent('');
	
	get_comment(SRV,ACTION_ID,MODULE_NAME,BID,USER_ID,DO_ACTION,EX_BID);
}

