<script>
tb = parent.AfianHandler['allTabs']['<?echo $_GET['fromtabid'];?>'];
if (tb != undefined) {
<?
/* check user permission*/
if ($permissions['readonly']) {
	iframeAlert($lang->get("You are not allowed to perform this action."));
	echo "parent.cancelTimeOut(tb.id);</script>";
	exit();
}
	$temp['trashCount'] = $trash->qty;
	if ($trash->emptyTrash($auth->currentUserInfo['id'])) {
		$log->act("0", "empty trash", $temp['trashCount']." objects deleted");
		$quota->recalcUsedSpace();
		?>
tb.removeAll();
parent.AfianBubbleMessage('<?$lang->display("Trash emptied.");?>');
		<?
	} else {
		$log->act("1", "empty trash", "");
		$iframeAlertMsg[] = $lang->get("Failed to empty trash.<br>%1", array($trash->errorMsg));
	}

?>
}

if (tb != undefined) {
	tb.showHG = false;
	parent.cancelTimeOut(tb.id);
	if (tb.active) {
		parent.TrashStatusBar();
		tb.hideHourGlass();
	}
}

<?if (!$permissions['unlimitedSpace']) {?>
parent.setQuotaIndicators ('space', <?echo $quota->currentSpace;?>, <?echo $permissions['spaceQuota'];?>);
<?}?>


<?iframeAlert($iframeAlertMsg);?>
</script>