//弹出层索引
var index11, index12, index13, index14, index15;

//管理题目
function showResourListBox(treeid){
  layer.load(0, {shade: [0.2, '#393D49']});
  index11 = layer.open({
    id: 'onedialog',
    type: 2,
    title: '管理',
    area: ['900px', '570px'],
    fixed: false, //不固定
    content: '/glquesti/resourlist/'+ treeid
  });
  layer.closeAll('loading');
}

//编辑题目
function showResourEditBox(resourid, treeid){
  $("#stem_form").find("input[name='stemid']").val(resourid);
  $("#stem_form").find("input[name='treeid']").val(treeid);
  layer.load(0, {shade: [0.2, '#393D49']});
  index12 = layer.open({
    id: 'twodialog',
    type: 2,
    title: '编辑',
    area: ['900px', '570px'],
    fixed: false, //不固定
    content: '/glquesti/basic/index?stemid='+ resourid
  });
  layer.closeAll('loading');
}

//预览题目
function showResourViewBox(resourid){
  layer.load(0, {shade: [0.2, '#393D49']});
  index13 = layer.open({
    id: 'threedialog',
    type: 2,
    title: '预览',
    area: ['900px', '570px'],
    fixed: false, //不固定
    content: '/glquesti/preview/'+ resourid
  });
  layer.closeAll('loading');
}

//移动题目
function showResourMoveBox(){
  var resourceids = $("#moveto_form").find("input[name='resourceids']").val();
  if(resourceids==""){
    layer.msg("您还没有选择", {icon: 2});
    return false;
  }
  layer.load(0, {shade: [0.2, '#393D49']});
  index14 = layer.open({
    id: 'fourdialog',
    type: 2,
    title: '编辑',
    area: ['900px', '570px'],
    fixed: false, //不固定
    content: '/glquesti/moveto/index?courseid='+ courseid
  });
  layer.closeAll('loading');
}

//刷新题目列表
function reloadResourListBox(treeid){
  layer.iframeSrc(index11, '/glquesti/resourlist/'+ treeid);
}

//重新统计题目数量
function calcQuestinumAgain(specialid, courseid){
  $("#progressbox").show();
  $("#calcQuestinumbox").attr("src", "/glquesti/default/calcquestinum?specialid="+ specialid +"&courseid="+ courseid);
}

//批量导入
function showQuestImportBox(){
  index15 = layer.open({
    id: 'fivedialog',
    type: 2,
    title: '导入',
    area: ['600px', '400px'],
    fixed: false, //不固定
    content: '/glquesti/import/index',
    cancel: function(){window.location.reload();}
  });
}