AdminMailtemplatesGridJsParams = "width=800,height=600,scrollbars=yes";

function AdminMailtemplatesGridModify( uid ) {
	window.open( '/admin/mail_templates/edit.php?mode=modify&uid='+uid , '_blank' , AdminMailtemplatesGridJsParams );
}

function AdminMailtemplatesGridAction( n , action ) {
	if ($("#"+FNTHSuperGrid_ToolbarId( n , action )).hasClass( "dsb" )) return;
	switch (action) {
	case "new":
		window.open( '/admin/mail_templates/edit.php?mode=new' , '_blank' , AdminMailtemplatesGridJsParams );break;
	case "modify":
		AdminMailtemplatesGridModify( $("#"+n).data( "selecteds" )[0] , AdminMailtemplatesGridJsParams );
		break;
	case "delete":
		if (!window.confirm( aJSLangDefs.confirm_Delete_mailtemplate )) return;
		BGAction( n , action );
		break;
	case "filter":
		$("#frm_AdminMailtemplatesGrid").append( "<input type=\"hidden\" name=\"task\" value=\"filter\" />" );
		document.frm_AdminMailtemplatesGrid.submit();
		break;
	}
}

function AdminMailtemplatesGridSelectionChanged( tblid , chk , id ) {
	BGSelectionChanged( tblid , chk , id );
	BGSelectionChangedDefaultAMD( tblid , chk , id );
}
