
function navigate(obj){
  if(obj.value!=""){
      window.open(obj.value,'','')
      obj.selectedIndex=0;
  }
}
/*******日历*********/
var CalendarXMLHttpReq=false;
function showCalendar(direction){
  var curMonth=document.getElementById("CurMonth").value;
  var curYear=document.getElementById("CurYear").value;

  CalendarXMLHttpReq=createXMLHttpRequest();
  sendRequest(CalendarXMLHttpReq,"index.calendar?CurMonth="+curMonth+"&Direction="+direction+"&CurYear="+curYear,showCalendarRes);
}

function showCalendarRes(){
  if (CalendarXMLHttpReq.readyState==4) {
    if (CalendarXMLHttpReq.status==200){
      readXML();
    }
  }
}

//读取日历并显示
function readXML(){
    //alert(CalendarXMLHttpReq.responseText);
    var today=CalendarXMLHttpReq.responseXML.getElementsByTagName("today")[0].firstChild.data;

    var year=CalendarXMLHttpReq.responseXML.getElementsByTagName("year")[0].firstChild.data;
    var month=CalendarXMLHttpReq.responseXML.getElementsByTagName("month")[0].firstChild.data;
    var week=CalendarXMLHttpReq.responseXML.getElementsByTagName("week")[0].firstChild.data;
    var days=CalendarXMLHttpReq.responseXML.getElementsByTagName("days")[0].firstChild.data;

    document.getElementById("cal_title").innerHTML="<P style=\"LETTER-SPACING: 4px\">"+year+"年"+month+"月</p>";
    document.getElementById("CurMonth").value=parseInt(month);
    document.getElementById("CurYear").value=year;

    var rowIndex=document.getElementById("Calendar").rows.length;
    while(rowIndex>1){
      rowIndex--;
      document.getElementById("Calendar").deleteRow(rowIndex);

    }
    parentRow=document.getElementById("Calendar").insertRow(document.getElementById("Calendar").rows.length);
    parentRow.height=23;
    parentRow.bgColor="white";
    if(week>1){
      for(i=0;i<week-1;i++){
        parentRow.insertCell(i);
        parentRow.cells(i).align="center";
        parentRow.cells(i).innerHTML=" ";
      }
    }
    week--;
    var foreColor="black";

    for(i=1;i<=days;i++){
        if(week==7){
          week=0;
          rowIndex=document.getElementById("Calendar").rows.length;
          parentRow=document.getElementById("Calendar").insertRow(rowIndex);
          parentRow.height=28;
          parentRow.bgColor="white";
        }

        parentRow.insertCell(week);
        parentRow.cells(week).align="center";
        if(week==6 || week==0){
            foreColor="red";
        }else{
            foreColor="black";
        }
        if(i==today){
          parentRow.cells(week).bgColor="red";
          parentRow.cells(week).innerHTML="<font color='white'>"+i+"</font>";
        }else{
          parentRow.cells(week).innerHTML=i;
        }
        week++;
    }
    n=1;
    for(t=week+1;t<=7;t++){
        parentRow.insertCell(t-1);
        parentRow.cells(t-1).bgColor="#DFDFDF";
        parentRow.cells(t-1).align="center";
        parentRow.cells(t-1).innerHTML="<font color='#CCCCCC'>"+n+"</font>";
        n++;
    }
}
//学会动态
var xhdtHttp=false;
function loadXhdt(){
  xhdtHttp=createXMLHttpRequest();
  sendRequest(xhdtHttp,"Information?infoType=1&pageSize=8&length=28",loadXhdtRes);
}
function loadXhdtRes(){
  if (xhdtHttp.readyState==4) {
    if (xhdtHttp.status==200){
      readXhdtXML();
    }
  }
}
function readXhdtXML(){
  //alert(xhdtHttp.responseText);
  var tdxhTB=document.getElementById("xhdt");
  tdxhTB.deleteRow(0);
  var informations=xhdtHttp.responseXML.getElementsByTagName("Information");
  var len=informations.length;
  var newRow;
  for(i=0;i<len;i++){
    var info=informations[i];
    var id=info.getElementsByTagName("ID")[0].firstChild.data;
    var infoTitle=info.getElementsByTagName("InfoTitle")[0].firstChild.data;
    var infoDate=info.getElementsByTagName("InfoDate")[0].firstChild.data;
    newRow=tdxhTB.insertRow(tdxhTB.rows.length);
    newRow.height=26;
    newRow.insertCell(0);
    newRow.insertCell(1);
    newRow.cells(0).innerHTML="<img alt='' src='images/g6.gif'/>";
    newRow.cells(1).innerHTML="<a href='informationContent.do?id="+id+"&infoType=1'>"+infoTitle+"</a> ("+infoDate+")";

    newRow=tdxhTB.insertRow(tdxhTB.rows.length);
    newRow.insertCell(0);
    newRow.insertCell(1);
    newRow.cells(0).height=1;
    newRow.cells(1).style.backgroundImage="url(images/white_line.gif)";
  }
}

//学会论文
var xslwHttp=false;
function loadXslw(){
  xslwHttp=createXMLHttpRequest();
  sendRequest(xslwHttp,"Information?infoType=3&pageSize=8&length=28",loadXslwRes);
}
function loadXslwRes(){
  if (xslwHttp.readyState==4) {
    if (xslwHttp.status==200){
      readXslwXML();
    }
  }
}
function readXslwXML(){
  //alert(xslwHttp.responseText);
  var xslwTB=document.getElementById("xslw");
  xslwTB.deleteRow(0);
  var informations=xslwHttp.responseXML.getElementsByTagName("Information");
  var len=informations.length;
  var newRow;
  for(i=0;i<len;i++){
    var info=informations[i];
    var id=info.getElementsByTagName("ID")[0].firstChild.data;
    var infoTitle=info.getElementsByTagName("InfoTitle")[0].firstChild.data;
    var infoDate=info.getElementsByTagName("InfoDate")[0].firstChild.data;
    newRow=xslwTB.insertRow(xslwTB.rows.length);
    newRow.height=26;
    newRow.insertCell(0);
    newRow.insertCell(1);
    newRow.cells(0).innerHTML="<img alt='' src='images/arrow_001.gif'/>";
    newRow.cells(1).innerHTML="<a href='informationContent.do?id="+id+"&infoType=3'>"+infoTitle+"</a> ("+infoDate+")";

    newRow=xslwTB.insertRow(xslwTB.rows.length);
    newRow.insertCell(0);
    newRow.insertCell(1);
    newRow.cells(0).height=1;
    newRow.cells(1).style.backgroundImage="url(images/bulletin_dot.gif)";
  }
}

//学会天地
var xhtdHttp=false;
function loadXhtd(){
  xhtdHttp=createXMLHttpRequest();
  sendRequest(xhtdHttp,"Information?infoType=2&pageSize=8&length=28",loadXhtdRes);
}
function loadXhtdRes(){
  if (xhtdHttp.readyState==4) {
    if (xhtdHttp.status==200){
      readXhtdXML();
    }
  }
}
function readXhtdXML(){
  //alert(xslwHttp.responseText);
  var xhtdTB=document.getElementById("xhtd");
  xhtdTB.deleteRow(0);
  var informations=xhtdHttp.responseXML.getElementsByTagName("Information");
  var len=informations.length;
  var newRow;
  for(i=0;i<len;i++){
    var info=informations[i];
    var id=info.getElementsByTagName("ID")[0].firstChild.data;
    var infoTitle=info.getElementsByTagName("InfoTitle")[0].firstChild.data;
    var infoDate=info.getElementsByTagName("InfoDate")[0].firstChild.data;
    newRow=xhtdTB.insertRow(xhtdTB.rows.length);
    newRow.height=26;
    newRow.insertCell(0);
    newRow.insertCell(1);
    newRow.cells(0).innerHTML="<img alt='' src='images/page1.gif' hspace='2'/>";
    newRow.cells(1).innerHTML="<a href='informationContent.do?id="+id+"&infoType=2'>"+infoTitle+"</a> ("+infoDate+")";

    newRow=xhtdTB.insertRow(xhtdTB.rows.length);
    newRow.insertCell(0);
    newRow.insertCell(1);
    newRow.cells(0).height=1;
    newRow.cells(1).style.backgroundImage="url(images/bulletin_dot.gif)";
  }
}

//学会公告
var xhggHttp=false;
function loadXhgg(){
  xhggHttp=createXMLHttpRequest();
  sendRequest(xhggHttp,"Information?infoType=4&pageSize=12&length=18",loadXhggRes);
}
function loadXhggRes(){
  if (xhggHttp.readyState==4) {
    if (xhggHttp.status==200){
      readXhggXML();
    }
  }
}
function readXhggXML(){
  //alert(xslwHttp.responseText);
  var xhggTB=document.getElementById("gonggao");
  var informations=xhggHttp.responseXML.getElementsByTagName("Information");
  var len=informations.length;
  var newRow;
  for(i=0;i<len;i++){
    var info=informations[i];
    var id=info.getElementsByTagName("ID")[0].firstChild.data;
    var infoTitle=info.getElementsByTagName("InfoTitle")[0].firstChild.data;
    var infoDate=info.getElementsByTagName("InfoDate")[0].firstChild.data;
    newRow=xhggTB.insertRow(xhggTB.rows.length);
    newRow.height=26;
    newRow.insertCell(0);
    newRow.insertCell(1);
    newRow.cells(0).innerHTML="<img alt='' src='images/icon1.gif' />";
    newRow.cells(1).innerHTML="<a href='informationContent.do?id="+id+"&infoType=4'>"+infoTitle+"</a>";

    newRow=xhggTB.insertRow(xhggTB.rows.length);
    newRow.insertCell(0);
    newRow.insertCell(1);
    newRow.cells(0).height=1;
    newRow.cells(1).style.backgroundImage="url(images/bulletin_dot.gif)";
  }
}

