function switch_display( id )
{
	if ( $('#'+id).css("display")=="none" || $('#'+id).css("display")=="" ) $('#'+id).css( "display" , "block"); else $('#'+id).css( "display" , "none");
}


function thread_new(form)
{	
	//form_data = document.getElementById(form_id);
	var inputs = [];
	$(':input', form).each(function(){ inputs.push(this.name + '=' + encodeURIComponent(this.value)); })
	jQuery.ajax({
		data: inputs.join('&'),
		url: form.action,
		type: "POST",
		timeout: 2000,
		error: function(){ console.log("25:Fehler1"); },
		success: function(ret){ 
			//$('#divAnfrage').html(ret); 
			if ( ret == 0 ) { alert ('Sicherheitscode Falsch!!!');}
			if ( ret == 1 ) { window.location.replace(site_url+'forum/page/1'); 
		
			}  
	
			}
			});	
		return false;
}
function kommentar_new( form , t_id )
{
	//form_data = document.getElementById(form_id);
	var inputs = [];
	$(':input', form).each(function(){ inputs.push(this.name + '=' + encodeURIComponent(this.value)); })
	jQuery.ajax({
		data: inputs.join('&'),
		url: form.action,
		type: "POST",
		timeout: 2000,
		error: function(){ console.log("25:Fehler2"); },
		success: function(ret){ 
			//$('#divAnfrage').html(ret); 
			if ( ret == 0 ) { alert ('Sicherheitscode Falsch!!!');}
			if ( ret == 1 ) { window.location.replace(site_url+'forum/thread/'+t_id );   }
			}			 				
	})	
	return false;
	

	
}
function antwort_auf( p_id )
{
	$('#p_id').attr('value', p_id );
	if ( $('#new_kommentar_div').css( 'display' )=="none" || $('#new_kommentar_div').css('display') == "" ) $('#new_kommentar_div').css('display' , "block");
	window.location.replace(this_script+'#new_kommentar_link' ); 
}

