﻿function showNews()
{
    changeNews();
}

function showleftMenu() {
    document.write('   <table width="100%" border="0" cellspacing="0" cellpadding="0">                                                                                                                                                                                                                                  ');
    document.write('     <tr>                                                                                                                                                                                                                                                                                           ');
    document.write('       <td width="12%"><a href="index.aspx" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image40\',\'\',\'images/b_home_over.jpg\',1)"><img src="images/b_home.jpg" alt="回首頁" name="Image40" width="49" height="22" border="0"></a></td>                                         ');
    document.write('                                                                                                                                                                                                                                                                                                    ');
    document.write('       <td width="85%"><a href="index.aspx" target="_self" onMouseOver="MM_swapImage(\'Image42\',\'\',\'images/b13_main_19_over.jpg\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/b13_main_19.jpg" title="經銷商登入,建置中" name="Image42" width="73" height="22" border="0"></a></td>  ');
    document.write('       <td width="85%" align="right"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image42\',\'\',\'images/b13_main_19_over.jpg\',1)"></a></td>                                                                                                                          ');
    document.write('     </tr>                                                                                                                                                                                                                                                                                          ');
    document.write('   </table>                                                                                                                                                                                                                                                                                         ');
}
function showMainMenu()
{
   document.write('<table width="852" border="0" align="center" cellpadding="0" cellspacing="0">                                                                                                                                                                                                                                                                               ');
   document.write('  <tr>                                                                                                                                                                                                                                                                                                                                                      ');
   document.write('    <td width="302"><a href="https://www.tww.com.tw/washing/" class="link1" ><img src="images/7-11.gif" width="258" height="31" border="0"></a></td>                                                                                                                                                                                                                                                                                ');
   document.write('    <td width="92"><a href="intro.aspx" onClick="return clickreturnvalue()" onMouseOut="MM_swapImgRestore();delayhidemenu()" onMouseOver="MM_swapImage(\'Image43\',\'\',\'images/b_about_over.jpg\',1);dropdownmenu(this, event, menu1, \'92px\')"><img src="images/b_about.jpg" alt="公司簡介" name="Image43" width="92" height="31" border="0"></a></td>  ');
   document.write('    <td width="92"><a href="service.html" onMouseOut="MM_swapImgRestore();delayhidemenu()" onMouseOver="MM_swapImage(\'Image44\',\'\',\'images/b_service_over.jpg\',1);dropdownmenu(this, event, menu3, \'92px\')"><img src="images/b_service.jpg" alt="服務項目" name="Image44" width="92" height="31" border="0"></a></td>                                ');
   document.write('    <td width="92"><a href="news.aspx" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image45\',\'\',\'images/b_news_over.jpg\',1)"><img src="images/b_news.jpg" alt="最新消息" name="Image45" width="92" height="31" border="0"></a></td>                                                                                                    ');
   document.write('    <td width="92"><a href="sales.aspx" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image46\',\'\',\'images/b_sales_over.jpg\',1)"><img src="images/b_sales.jpg" alt="門市總覽" name="Image46" width="92" height="31" border="0"></a></td>                                                                                                 ');
   document.write('    <td width="90"><a href="join.html"   onMouseOut="MM_swapImgRestore();delayhidemenu()" onMouseOver="MM_swapImage(\'Image47\',\'\',\'images/sub5_over.jpg\',1);dropdownmenu(this, event, menu2, \'100px\')"><img src="images/sub5.jpg" alt="加入我們" name="Image47" width="96" height="31" border="0"></a></td>                                            ');
   document.write('    <td width="92"><a href="cooper.aspx" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image49\',\'\',\'images/b_cooper_over.jpg\',1)"><img src="images/b_cooper.jpg" alt="合作連結" name="Image49" width="90" height="31" border="0"></a></td>                                                                                              ');
   document.write('    <td width="92"><a href="membercheck.aspx" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image48\',\'\',\'images/icon_addmember_over.jpg\',1);dropdownmenu(this, event, menu5, \'92px\')"><img src="images/icon_addmember.jpg" alt="加入會員" name="Image48" width="90" height="31" border="0"></a></td>                                                                                                    ');
   document.write('  </tr>                                                                                                                                                                                                                                                                                                                                                     ');
   document.write('</table>                                                                                                                                                                                                                                                                                                                                                    ');
 }
function showcopy() {
    document.write("<table width='100%' border='0' cellpadding='0' cellspacing='0' class='copy'>                                                                                                                                                                                 ");
    document.write("        <tr>                                                                                                                                                                                                                                                 ");
    document.write("          <td>                                                                                                                                                                                                                                               ");
    document.write("          <table width='96%' border='0' cellpadding='0' cellspacing='0'>                                                                                                                                                                                     ");
    document.write("            <tr>                                                                                                                                                                                                                                             ");
    document.write("              <td width='63%' align='right'><a href='index.aspx' onMouseOut='MM_swapImgRestore()' onMouseOver=\"MM_swapImage('Image29','','images/sub_1_over.jpg',1)\"><img src='images/sub_1.jpg' name='Image29' width='54' height='18' border='0'></a></td>  ");
    document.write("              <td width='13%' align='right'><a href='intro.html' onMouseOut='MM_swapImgRestore()' onMouseOver=\"MM_swapImage('Image30','','images/sub_2_over.jpg',1)\"><img src='images/sub_2.jpg' name='Image30' width='70' height='18' border='0'></a></td>  ");
    document.write("              <td width='13%' align='right'><a href='sales.aspx' onMouseOut='MM_swapImgRestore()' onMouseOver=\"MM_swapImage('Image31','','images/sub_3_over.jpg',1)\"><img src='images/sub_3.jpg' name='Image31' width='68' height='18' border='0'></a></td>  ");
    document.write("              <td width='11%' align='right'><a href='join.html' onMouseOut='MM_swapImgRestore()'  onMouseOver=\"MM_swapImage('Image32','','images/sub_4_over.jpg',1)\"><img src='images/sub_4.jpg' name='Image32' width='63' height='18' border='0'></a></td>   ");
    document.write("            </tr>                                                                                                                                                                                                                                            ");
    document.write("            <tr>                                                                                                                                                                                                                                             ");
    document.write("              <td colspan='4' align='right'><img src='images/address.jpg' width='436' height='23'></td>                                                                                                                                                      ");
    document.write("              </tr>                                                                                                                                                                                                                                          ");
    document.write("            <tr>                                                                                                                                                                                                                                             ");
    document.write("              <td colspan='4' align='right'><img src='images/copy.jpg' width='373' height='23'><a href='#'><img src='images/design.jpg' width='63' height='23' border='0'></a></td>                                                                          ");
    document.write("              </tr>                                                                                                                                                                                                                                          ");
    document.write("          </table>                                                                                                                                                                                                                                           ");
    document.write("          </td>                                                                                                                                                                                                                                              ");
    document.write("        </tr>                                                                                                                                                                                                                                                ");
    document.write("    </table>                                                                                                                                                                                                                                                 ");
                                                                                                                                                                                                                                                                             
}


function changeNews() {
    var http_request = false;
    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
    } else if (window.ActiveXObject) { // IE
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) { }
        }
    }

    if (!http_request) {
        alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }

    // 定義事件處理函數為 alterContents()
    http_request.onreadystatechange = function() { alertNews(http_request); };
    // IE 6.x 和 Firefox 1.5.x 皆要 encodeURI()
    var accurl = "news_menu.aspx";
    http_request.open('POST', accurl, false);
    //  http_request.onreadystatechange = alertContents;
    http_request.send(null);
}
function alertNews(http_request) {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            var mesg = http_request.responseText;
            document.write(mesg);
        } else {
            alert('There was a problem with the request.');
        }
    }
    //"<select name='SUB_ORG_ID' ><option>1111</option></select>";
}
