var xmlHttp1;
function createXMLHttpRequest1() {
    if (window.ActiveXObject) {
        xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest) {
        xmlHttp1 = new XMLHttpRequest();
    }
}

function getdata() 
{
    createXMLHttpRequest1();    
    url="00gdat.aspx?dvdid=D0018"
    xmlHttp1.onreadystatechange = handleStateChange;
    xmlHttp1.open("GET", url, true);
    xmlHttp1.send(null);
}

function handleStateChange() 
{//s1
if(xmlHttp1.readyState == 4) 
{//s2
//alert ("4")
if(xmlHttp1.status == 200)
{//s3
//alert ("200")
//==================================
var xmldoc1 = xmlHttp1.responseXML;
var dept=""
var ii=0  

if (xmldoc1.documentElement.childNodes.length == 0){
window.document.getElementsByName("data_td")[0].innerHTML="<font size=2><br>//目前沒有任何文章//<br><br></font>"
}
else{
var getrecord_total = xmldoc1.getElementsByTagName('DefaultView')[0].getElementsByTagName('record_total')[0].childNodes[0].nodeValue
var dr="<table cellspacing='1' cellpadding='0' width='100%'>"
for (j=1;j<=(xmldoc1.documentElement.childNodes.length);j++) 
{
var getrecord_now = xmldoc1.getElementsByTagName('DefaultView')[j-1].getElementsByTagName('record_now')[0].childNodes[0].nodeValue
var dvdid = xmldoc1.getElementsByTagName('DefaultView')[j-1].getElementsByTagName('DVD代碼')[0].childNodes[0].nodeValue
if (j % 2 == 0)
{
dr=dr+"<tr id='tr"+j+"' bgcolor='WhiteSmoke' class=dd onmouseover='mouseover("+j+")' onmouseout='mouseout("+j+")'><font size=2 color=black>"
}
else
{
dr=dr+"<tr id='tr"+j+"' class=dd onmouseover='mouseover("+j+")' onmouseout='mouseout("+j+")'><font size=2 color=black>"
}
dr=dr+"<td width='10%' align='center' height='38'>"
dr=dr+xmldoc1.getElementsByTagName('DefaultView')[j-1].getElementsByTagName('識別碼')[0].childNodes[0].nodeValue
dr=dr+"</td>"      
dr=dr+"<td width='10%' align='left' height='38'><font size=2 color=>"
dr=dr+dvdid
dr=dr+"</span></font></td>"
dr=dr+"<td width='15%' align='left' height='38'><font size=2>"
dr=dr+xmldoc1.getElementsByTagName('DefaultView')[j-1].getElementsByTagName('作者姓名')[0].childNodes[0].nodeValue
dr=dr+"</font></td>"
dr=dr+"<td width='20%' align='left' height='38'><font size=2>"
dr=dr+xmldoc1.getElementsByTagName('DefaultView')[j-1].getElementsByTagName('發表時間')[0].childNodes[0].nodeValue
dr=dr+"</font></td>"
dr=dr+"<td width='45%' align='left' height='38'><font size=2 color=green>"
dr=dr+xmldoc1.getElementsByTagName('DefaultView')[j-1].getElementsByTagName('問題二')[0].childNodes[0].nodeValue
dr=dr+"</font></td>"
dr=dr+"</a></tr>"
} 
dr=dr+"</table>"
window.document.getElementsByName("data_td")[0].innerHTML=dr

}

//==================================
}//s3
}//s2
}//s1

function getrecord_now(k0) 
{
window.document.aspnetForm.all.record_now.value = k0
}

function mouseover(k0) 
{
document.all["tr"+k0].style.backgroundColor="FloralWhite"
document.all["tr"+k0].style.color="red";
}

function mouseout(k0) 
{
if (k0 % 2 == 0)
{
document.all["tr"+k0].style.backgroundColor="WhiteSmoke"
document.all["tr"+k0].style.color="";
}
else
{
document.all["tr"+k0].style.backgroundColor="White"
document.all["tr"+k0].style.color="";
}
}
