function del_arch(me){
		showwait(dia_wait_sup,true); 
		var id = $comp(me).parent().parent().attr("id");
		$comp.post("goto.php",
		{ charg: "archive",action: "del",ref_id:id},
		function(data){
		   if(test_error(data)){
				   $comp('#'+id).remove();
					showresult_txt(data);	
			}
		});
}


function save_arch(me){
		showwait(dia_wait,true);
		var id = $comp(me).parent().parent().attr("id");
		var txt = $comp('#'+id).find('textarea').val();
		txt = txt.replace( /\&/g, '§!§' );
		txt = txt.replace( /\+/g, '§plus§' );
		$comp.post("goto.php",
				{ charg: "archive",action: "save",ref_id:id,contenu:txt},
				
		function(data){
		   if(test_error(data)){
					showresult_txt(data);
			}
		});
}

function save_editor(){
		showwait(dia_wait,true);
		var login = $comp('#editor_login').val();
		var passw = $comp('#editor_passw').val();
		$comp.post("goto.php",
				{ charg: "archive",action: "saveeditor",login_chap:login,pass_chap:passw},
		function(data){
		   if(test_error(data)){
				   txt = $comp.trim(data);
				   if(txt=='exist'){
						   cachewait();
						   x = window.confirm(alert_editor)
						   if(x =="1"){
								   showwait(dia_wait,true);
								   $comp.post("goto.php",
										{ charg: "archive",action: "saveeditordef",login_chap:login,pass_chap:passw},
										function(data){
										   if(test_error(data)){
													showresult_txt(data);
											}
									});
						   }
				   } else {
						   showresult_txt(data);
				   }
			}
		});
}
