﻿var infoTable_grid,infoTable_buffer,options={};
options['NEW_INFO'] = {
  sortCol : 1,
  sortDir : 'DESC',
  visibleRows :5,
  frozenColumns : 1,
  highlightElem : 'cursorRow',
  columnSpecs   : [
    { Hdg: "ID", width: 60 , visible:false},
    { Hdg: "登録日", width: 80 },
    { Hdg: "更新", width: 50 , ClassName:'redtext'},
    { Hdg: "新着情報", width: 350 },
    { Hdg: "リンク先", width: 150, visible:false },
  	{ Hdg: "リンク", width: 50, control:new Rico.TableColumn.link('{4}','_blank')},
	{ Hdg: "表示/非表示", width: 50, visible:false }
  ]
};
options['DISPATCH'] = {
  sortCol : 2,
  sortDir : 'DESC',
  visibleRows :5,
  frozenColumns : 1,
  highlightElem : 'cursorRow',
  columnSpecs   : [
    { Hdg: "案件番号", width: 60},
    { Hdg: "登録日", visible:false},
    { Hdg: "更新", width: 50 , ClassName:'redtext'},
    { Hdg: "業種", width: 50 },
    { Hdg: "派遣情報", width: 320 },
	{ Hdg: "リンク", width: 50, control:new Rico.TableColumn.link('http://www.fe-brain.com/work/haken/detail/MakeHakenInfo.php?id={0}','_blank') },
	{ Hdg: "表示/非表示", visible:false}
  ]
};
options['INTRODUCTION'] = {
  sortCol : 2,
  sortDir : 'DESC',
  visibleRows :5,
  frozenColumns : 1,
  highlightElem : 'cursorRow',
  columnSpecs   : [
    { Hdg: "案件番号", width: 60},
    { Hdg: "登録日", visible:false},
    { Hdg: "更新", width: 50 , ClassName:'redtext'},
    { Hdg: "業種", width: 50 },
    { Hdg: "紹介情報", width: 320 },
    { Hdg: "リンク", width: 50, control:new Rico.TableColumn.link('http://www.fe-brain.com/work/shokai/detail/MakeShokaiInfo.php?id={0}','_blank') },
    { Hdg: "表示の有無", visible:false}
  ]
};


function newGrid(TableName) {
  if (infoTable_grid) {
    //infoTable_grid.unplugSelect();
    //infoTable_grid.unplugScroll();
    //infoTable_grid.unplugWindowResize();
    //infoTable_grid.unplugHighlightEvents();
    if (Event.unloadCache) {
      Event.unloadCache();   // this does all of the "unplugs", and is critical to enable memory to be released
    } else if (Event.destroyCache) {
      Event.destroyCache();  // unloadCache was removed from Prototype 1.6
    }
    infoTable_buffer.clear();
  }
  var outerDiv=$('infoTable_outerDiv');
  outerDiv.innerHTML='';
  infoTable_buffer=null;
  infoTable_grid=null;
  infoTable_buffer=new Rico.Buffer.AjaxSQL('http://www.fe-brain.com/test/src/ricoXMLquery.php', { requestParameters: ['id=infoTable'+TableName],waitMsg: "<img src='http://www.fe-brain.com/img/waiting.gif'>" });
  infoTable_grid=new Rico.LiveGrid ('infoTable', infoTable_buffer, options[TableName]);
  infoTable_grid.menu = new Rico.GridMenu();
}