//任务发布B
function fbtj(){
 if(document.f1.ttit.value==""){alert("请输入任务标题");document.f1.ttit.focus();return false;}
 if(ue.getContent()==""){alert("任务详情不得为空");return false;}
 wczq=document.f1.twczq.value;if(wczq=="" || isNaN(wczq)){alert("完成天数无效");document.f1.twczq.select();return false;}
 if(document.f1.tbmjzsj.value==""){alert("请设置报名截止时间");return false;}
 yusuan1=document.f1.tyusuan1.value;
 yusuan2=document.f1.tyusuan2.value;
 if(yusuan1=="" || isNaN(yusuan1)){alert("最低预算值无效");document.f1.tyusuan1.select();return false;}
 if(yusuan2=="" || isNaN(yusuan2)){alert("最高预算值无效");document.f1.tyusuan2.select();return false;}
 xyrs=document.f1.txyrs.value;if(xyrs=="" || isNaN(xyrs)){alert("请输入有效的人数");document.f1.txyrs.select();return false;}
 if(!confirm("确定提交吗？")){return false;}
 layer.msg('正在提交', {icon: 16  ,time: 0,shade :0.25});
 f1.action="fabu.php?control=add";
}

function xiala1over(x){
 a=document.getElementById("xialanum").innerHTML;
 for(i=1;i<a;i++){
  document.getElementById("xiala2_"+i).style.display="none";
  document.getElementById("xiala1a"+i).className="";
 }
 document.getElementById("xiala2_"+x).style.display="";
 document.getElementById("xiala1a"+x).className="a1";
}
function xiala1onc(a,b,c,d,e){
 str=b+" > ";
 if(d!=""){str=str+d;typehtmlout();}
 document.f1.rwtype.value=str;
 document.f1.ty1id.value=a;
 document.f1.ty2id.value=c;
 if(e!=0){xiala1over(e);}
}
function typehtmlout(){
 document.getElementById("typehtml").style.display="none";
}
function rwtypeonc(){
 document.getElementById("typehtml").style.display="";
}
function bmjzkj(x){
 document.f1.tbmjzsj.value=x;
}
//任务发布E

//列表下拉
function xialaover(x){
document.getElementById("xllist"+x).style.display="";
}
function xialaout(x){
document.getElementById("xllist"+x).style.display="none";
}
function listtj(){
 if(document.f1.t1.value==""){alert("请输入搜索关键词");document.f1.t1.focus();return false;}
 f1.action="../search/index.php?admin=11";
}

//报名倒计时
var responsesj;
var time_server_client,timerID,xs,time_end1,timerID1;

function show_time(djsid)
{
 var time_now,time_distance,str_time;
 var int_day,int_hour,int_minute,int_second;
 var time_now=new Date();
 time_now=time_now.getTime()+time_server_client;
 time_end=time_end1;timerID=timerID1;
 
 time_distance=time_end-time_now;
 if(time_distance>0)
 {
  int_day=parseInt(Math.floor(time_distance/86400000))
  time_distance-=int_day*86400000;
  int_hour=parseInt(Math.floor(time_distance/3600000))
  time_distance-=int_hour*3600000;
  int_minute=parseInt(Math.floor(time_distance/60000))
  time_distance-=int_minute*60000;
  int_second=parseInt(Math.floor(time_distance/1000))
  mm = Math.floor((time_distance % 1000)/100);
   tv=int_day+"<span class='s1'>天</span>";
   tv=tv+int_hour+"<span class='s1'>时</span>";
   tv=tv+int_minute+"<span class='s1'>分</span>";
   tv=tv+int_second+"." + mm+"<span class='s1'>秒</span>";
   document.getElementById("djs").innerHTML=tv;
   setTimeout("show_time("+djsid+")",100);
  }
  else
 {
  tv="<span class='feng'>已结束</span>";
  document.getElementById("djs").innerHTML=tv;
  clearTimeout(timerID)
 }
}


function bmChecksj() {
   responsesj = document.getElementById("nowsj").innerHTML;
   if(document.getElementById("dqsj")){dsj1=document.getElementById("dqsj").innerHTML;time_end1=new Date(dsj1);time_end1=time_end1.getTime();}//结束的时间
   time_now_server=new Date(responsesj);time_now_server=time_now_server.getTime();
   time_now_client=new Date();time_now_client=time_now_client.getTime();
   time_server_client=time_now_server-time_now_client;
   if(document.getElementById("dqsj")){timerID1=setTimeout("show_time(1)",100);}
}
//报名倒计时

//接手
function jieshoutj(x){
 a=document.f1.t1.value
 if(a=="" || isNaN(a)){alert("请输入您的有效报价");document.f1.t1.focus();return false;}
 if(ue.getContent()==""){alert("投标说明不得为空");return false;}
 if(!confirm("确定提交吗？")){return false;}
 layer.msg('正在提交', {icon: 16  ,time: 0,shade :0.25});
 f1.action="jieshou.php?control=bm&id="+x;
}

//选标
function xuanbiaotj(x){
 if(!confirm("确定提交吗？")){return false;}
 layer.msg('正在提交', {icon: 16  ,time: 0,shade :0.25});
 f1.action="xuanbiao.php?control=xuan&id="+x;
}

//任务选标弹
function renwuxuantang(x){
$.get(document.getElementById("webhttp").innerHTML+"tem/sesCheck.php",{},function(result){
 if(result=="0"){tclogin();return false;}
 else{
	 
  layer.open({
   type: 2,
   area: ['400px', '285px'],
   title:["任务选标","text-align:left"],
   skin: 'layui-layer-rim', //加上边框
   shadeClose: true,
   content:[document.getElementById("webhttp").innerHTML+'renwu/xuanbiao.php?id='+x, 'no'] 
  });
  
 }
});
}
