var xmlHttp;
function createXMLHttpRequest() 
{
 if (window.ActiveXObject) 
 {
 xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
 } 
 else if (window.XMLHttpRequest) 
 {
 xmlHttp = new XMLHttpRequest();
 }
}

//function pageload() 
{
createXMLHttpRequest();    
url="sonia_x.aspx"
xmlHttp.onreadystatechange = pageload_return;
xmlHttp.open("GET", url, true);
xmlHttp.send(null);
}

function pageload_return() 
{//s1
if(xmlHttp.readyState == 4) 
{//s2
if(xmlHttp.status == 200)
{//s3
//==================================
var xmldoc = xmlHttp.responsexml;
var dept=""
var ii=0     

var dr="<table cellspacing='1' cellpadding='0' width='100%'>"
//for (j=1;j<=(xmldoc.documentElement.childNodes.length);j++) 
for (j=1;j<=6;j++) 
{
var 標題=xmldoc.getElementsByTagName('DefaultView')[j-1].getElementsByTagName('標題')[0].childNodes[0].nodeValue
標題=標題.substr(0,36)
dr=dr+"<tr id='tr"+j+"' bgcolor='WhiteSmoke' class='cc'>"
dr=dr+"<td><img src='images/arrow005.gif' width='9' height='9'></td>"      
dr=dr+"<td width='100%' align='left' height='30'><a href='news/a90_show.aspx'><span style='font-size: 9pt; color: green;'>"+標題+"</span></a></td>"      
dr=dr+"</tr>"
} 
dr=dr+"</table>"
document.form1.all.td_news.innerHTML = dr

//==================================
}//s3
}//s2
}//s1


function saveemail_clk() 
{//function000
//alert ("gosave")
url="epaper/a01_save.aspx"
createXMLHttpRequest();
xmlHttp.open("POST", url, false);
xmlHttp.onreadystatechange = saveemailback;
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");    
var r0=window.document.form1.emails.value
//var r0="jamest@travelonline.com.tw"
xmlHttp.send("r0="+r0); 
//xmlHttp.send()
}//function000
    
function saveemailback() 
{//s1
if(xmlHttp.readyState == 4) 
{//s2
//alert ("4")
if(xmlHttp.status == 200)
{//s3
//alert ("200")
//==================================
var xmldoc = xmlHttp.responsexml;
var email=xmldoc.getElementsByTagName('DefaultView')[0].getElementsByTagName('email')[0].childNodes[0].nodeValue
alert (email+"\n已成功訂閱電子報")
//window.location.href ="a02_disp.aspx?dvdid="+window.document.form1.DVD代碼.value

//==================================
}//s3
}//s2
}//s1

function canlemail_clk() 
{//function000
//alert ("gosave")
url="epaper/a02_canl.aspx"
createXMLHttpRequest();
xmlHttp.open("POST", url, false);
xmlHttp.onreadystatechange = canlemailback;
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");    
//var r0=window.document.form1.email.value
var r0="jamest@travelonline.com.tw"
xmlHttp.send("r0="+r0); 
//xmlHttp.send()
}//function000
    
function canlemailback() 
{//s1
if(xmlHttp.readyState == 4) 
{//s2
//alert ("4")
if(xmlHttp.status == 200)
{//s3
//alert ("200")
//==================================
var xmldoc = xmlHttp.responsexml;
var email=xmldoc.getElementsByTagName('DefaultView')[0].getElementsByTagName('email')[0].childNodes[0].nodeValue
alert (email+"\n已取消訂閱電子報")
//window.location.href ="a02_disp.aspx?dvdid="+window.document.form1.DVD代碼.value

//==================================
}//s3
}//s2
}//s1


function mouseover(k0) 
{
document.all["tr"+k0].style.backgroundColor="PapayaWhip"
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="";
}
}