AdminAdminIpsGridJsParams = "width=360,height=200,scrollbars=yes";

function AdminAdminIpsGridModify( uid ) {
	window.open( 'edit.php?mode=modify&uid='+uid , '_blank' , AdminAdminIpsGridJsParams );
}

function AdminAdminIpsGridAction( n , action , params ) {
	if ($("#"+FNTHSuperGrid_ToolbarId( n , action )).hasClass( "dsb" )) return;
	switch (action) {
	case "new":
		window.open( 'edit.php?mode=new' , '_blank' , AdminAdminIpsGridJsParams );break;
	case "modify":
		AdminAdminIpsGridModify( $("#"+n).data( "selecteds" )[0] , AdminAdminIpsGridJsParams );
		break;
	case "delete":
		if (!window.confirm( aJSLangDefs.adminips_confirm_Delete_admin_ips )) return;
		BGAction( n , action );
		break;
	case "filter":
		$("#frm_AdminAdminIpsGrid").append( "<input type=\"hidden\" name=\"task\" value=\"filter\" />" );
		document.frm_AdminAdminIpsGrid.submit();
		break;
	case "dlg_add_ip":
		AdminAdminIpsAddIpDialog( );
	}
}

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

function AdminAdminIpsSelect( article_url , funcnum ) {
	window.opener.CKEDITOR.tools.callFunction( funcnum , article_url );
	window.close();
}

function AdminAdminIpsAddIp() {
	document.frm_add_ip.submit();
}

function AdminAdminIpsCancelDialog() {
	$("#dlg_add_ip").dialog( "close" );
	$("#dlg_add_ip").dialog( "destroy" );
}

function AdminAdminIpsAddIpDialog() {
	var btns = {};
	btns[aJSLangDefs.Add] = function() { AdminAdminIpsAddIp( ); }
	btns[aJSLangDefs.Cancel] = function() { AdminAdminIpsCancelDialog( ); }
	$("#dlg_add_ip").dialog(
		{
			modal : true,
			title : aJSLangDefs.adminips_Add_ip,
			buttons : btns,
			width : 320,
			height: 200
		}
	);
}
