﻿// JScript 檔
var xmlhttp = GetXmlHttpRequest();
//驗證會員登錄情況的結果顯示
function handleResponseHomeTravel(data,textStatus)
{  
    if(textStatus == "success")
    {
        if(data=="MEMBER_ID")
        {
            document.getElementById('divLogin').style.display='';
            document.getElementById("ctl00_lblShowError").innerText=" 該用戶不存在";
            document.getElementById("ctl00_lblShowError").textContent=" 該用戶不存在";
        }
        else if(data=="PASSWORD")
        {
            document.getElementById('divLogin').style.display='';
            document.getElementById("ctl00_lblShowError").innerText=" 密碼錯誤";
            document.getElementById("ctl00_lblShowError").textContent=" 密碼錯誤";
        }
        else if(data=="LOGINERROR")
        {
            document.getElementById('divLogin').style.display='';
            document.getElementById("ctl00_lblShowError").innerText="帳號密碼有誤，無法登入";
            document.getElementById("ctl00_lblShowError").textContent="帳號密碼有誤，無法登入";
        }
        else if(data=="TY")
        {
            document.getElementById("ctl00_lblShowError").innerText=" 該帳號已經停用!";
            document.getElementById("ctl00_lblShowError").textContent=" 該帳號已經停用!";
        }
        else if(data=="01" || data=="02" || data=="00")
        {
            funShowCheckBox(data);
            document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
        }
        else if(data=="03" )
        {
            document.getElementById("CheckBox").style.display='none';
            document.getElementById('divLogin').style.display='none';
            document.getElementById('CheckBoxTravel').style.display='none';
            
            document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
            document.getElementById("ctl00_ContentPlaceHolder1_btnEnter").style.display='none';
            document.getElementById("ctl00_ContentPlaceHolder1_btnJoinIn").style.display='none';
            document.getElementById("ctl00_ContentPlaceHolder1_btnSaveTALK").style.display='block';
            
            var objMEMBER_ID=document.getElementById("ctl00_txtMEMBER_ID");
            var objMEMBER_ID_V=document.getElementById("ctl00_ContentPlaceHolder1_hd_ID_V");
            
            if(objMEMBER_ID_V.value==objMEMBER_ID.value)
            {
                var tblTALK=document.getElementById("ctl00_ContentPlaceHolder1_tblTALK");
                tblTALK.style.display='none';    //登陸自己留言板，隱藏留言框   --by Chris 20080508    
            }
            location.reload();  //重新載入頁面一次
        }
        else if(data=="addBLACK_LIST")
        {
            ShowError("000147","");//您已經被對方加入黑名單!
            document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
        }
        else if(data=="ToMe")
        {
            ShowError("000146","");//您不可以對自己進行操作!
            document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
        }
        else if(data=="justloginisok")
        { 
            document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
            location.reload();  //重新載入頁面一次
        }      
        else if(data!="")
        {
            window.location=data;
            document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
        }
        else
        {
            ShowError("000086","");//操作未響應!
        }
    }
    else
    {
        ShowError("000086","");//操作未響應!
    } 
}   

//登錄驗證    
function funLogin(strIsLogin)
{
    var objLink=document.getElementById("ctl00_link");
    var objMEMBER_ID=document.getElementById("ctl00_txtMEMBER_ID");//會員id
    var objMEMBER_PWD=document.getElementById("ctl00_txtMEMBER_PWD");
    var strMEMBER_ID_V=document.getElementById("ctl00_MEMBER_ID_V").value;//被推薦人id
    var weburl = "Checkbox_Login_AJAX.aspx";
    var strType=document.getElementById("ctl00_goType").value;//類型
    
    jQuery('#ctl00_lblShowError').html("登入中,請等待....<br /><img src=\"http://www.ihaoke.com/web/img/ajax-loader.gif\" alt=\"loading img\">");       
    
    //必需輸入帳號及密碼
    if (objMEMBER_ID.value=="")
    {
        document.getElementById("ctl00_lblShowError").innerText="必需輸入帳號及密碼!";
        document.getElementById("ctl00_lblShowError").textContent="必需輸入帳號及密碼!";
        jQuery.blockUI({ message: "<div onclick='jQuery.unblockUI();'><span style='color:red;font-weight:bold;'>必需輸入帳號及密碼!</span><br />[x]確認</div>" }); 
        return false;
    }
    
    //自己不能對自己進行操作!
    if (objMEMBER_ID.value==strMEMBER_ID_V && strType!="Advise_App_Show")//如果登陸者和被推薦者相同不進行操作
    {
        document.getElementById("ctl00_lblShowError").innerText="不能對自己進行操作!";
        document.getElementById("ctl00_lblShowError").textContent="不能對自己進行操作!";
        jQuery.blockUI({ message: "<div onclick='jQuery.unblockUI();'><span style='color:red;font-weight:bold;'>不能對自己進行操作!</span><br />[x]確認</div>" }); 
        return false;
    }
    
    if(objLink.value!="C00" && objLink.value!="C01" && objLink.value!="B01" && objLink.value!="C02" && objLink.value!="B02" && objLink.value!="SV")
    {  
        jQuery.post(
            weburl
            ,{sMember_ID: escape(objMEMBER_ID.value), sMEMBER_PWD: escape(objMEMBER_PWD.value), sLink: escape(objLink.value), sType: escape(strType),sStaySignedIn:"false" }
            ,handleResponseHomeTravel
       );        
    }
    else//登錄驗證并直接添加收藏和黑名單
    {  
       jQuery.post(
            weburl
            ,{sMember_ID: escape(objMEMBER_ID.value), sMEMBER_PWD: escape(objMEMBER_PWD.value), sLink: escape(objLink.value), sMember_ID_V: escape(strMEMBER_ID_V), sIsLogin: escape(strIsLogin) }
            ,addCOFFINEnd2
       );
    }
    return false;
}

//添加會員推薦
function funCheckBoxHost(strType)
{

    //alert("顯示推一下DIV類型："+strType);
    var objMEMBER_ID=document.getElementById("ctl00_txtMEMBER_ID");
    var objadoA=document.getElementById("ctl00_rdoHostCOMMEND1");
    var objdrpCOMMEND=document.getElementById("ctl00_drpHostCOMMEND");
    var objadoB=document.getElementById("ctl00_rdoHostCOMMEND2");
    var objtxtCOMMEND=document.getElementById("ctl00_txtHostCOMMEND");
    var strType=strType;//類型
    var strMEMBER_ID_V=document.getElementById("ctl00_MEMBER_ID_V").value;//被推薦人id
    var strCOMMEND_REASON;//推薦語錄
    if (objMEMBER_ID.value==strMEMBER_ID_V)//如果登陸者和被推薦者相同不進行操作
    {
        document.getElementById('CheckBoxHost').style.display='none';
        return false;
    }
    if(objadoA.checked)//選擇下拉框的
        strCOMMEND_REASON= objdrpCOMMEND.options[objdrpCOMMEND.selectedIndex].text
    else if(objadoB.checked)//選擇自定義的
        strCOMMEND_REASON= objtxtCOMMEND.value
    //var weburl = "Checkbox_Commend.aspx";  //地址
    var weburl ="Checkbox_Commend_AJAX.aspx";
    xmlhttp = GetXmlHttpRequest();
    xmlhttp.onreadystatechange=funEndCheckBoxHost;
    xmlhttp.open("Post",weburl,true);
    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
    xmlhttp.send("sMember_ID_V="+escape(strMEMBER_ID_V)+"&sCOMMEND_REASON="+escape(strCOMMEND_REASON)+"&sType="+escape(strType));
    document.getElementById('CheckBoxHost').style.display='none';
    return false;
}


//添加住我家推薦
function funCheckBoxHome(strType)
{

    //alert("顯示推一下DIV類型："+strType);
    var objMEMBER_ID=document.getElementById("ctl00_txtMEMBER_ID");
    var objadoA=document.getElementById("ctl00_rdoHomeCOMMEND1");
    var objdrpCOMMEND=document.getElementById("ctl00_drpHomeCOMMEND");
    var objadoB=document.getElementById("ctl00_rdoHomeCOMMEND2");
    var objtxtCOMMEND=document.getElementById("ctl00_txtHomeCOMMEND");
    var strType=strType;//類型
    var strMEMBER_ID_V=document.getElementById("ctl00_MEMBER_ID_V").value;//被推薦人id
    var strCOMMEND_REASON;//推薦語錄
    if (objMEMBER_ID.value==strMEMBER_ID_V)//如果登陸者和被推薦者相同不進行操作
    {
        document.getElementById('CheckBox').style.display='none';
        return false;
    }
    if(objadoA.checked)//選擇下拉框的
        strCOMMEND_REASON= objdrpCOMMEND.options[objdrpCOMMEND.selectedIndex].text
    else if(objadoB.checked)//選擇自定義的
        strCOMMEND_REASON= objtxtCOMMEND.value
    var weburl = "Checkbox_Commend.aspx";  //地址
    xmlhttp = GetXmlHttpRequest();
    xmlhttp.onreadystatechange=funEndCheckBoxHome;
    xmlhttp.open("Post",weburl,true);
    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
    xmlhttp.send("sMember_ID_V="+escape(strMEMBER_ID_V)+"&sCOMMEND_REASON="+escape(strCOMMEND_REASON)+"&sType="+escape(strType));
    document.getElementById('CheckBox').style.display='none';
    return false;
}
//添加玩樂推薦
function CheckBoxTravel(strType)
{

    //alert("顯示推一下DIV類型："+strType);
    var objMEMBER_ID=document.getElementById("ctl00_txtMEMBER_ID");
    var objadoA=document.getElementById("ctl00_rdoTravelCOMMEND1");
    var objdrpCOMMEND=document.getElementById("ctl00_drpTravelCOMMEND");
    var objadoB=document.getElementById("ctl00_rdoTravelCOMMEND2");
    var objtxtCOMMEND=document.getElementById("ctl00_txtTravelCOMMEND");
    var strType=strType;//類型
    var strMEMBER_ID_V=document.getElementById("ctl00_MEMBER_ID_V").value;//被推薦人id
    var strCOMMEND_REASON;//推薦語錄
    if (objMEMBER_ID.value==strMEMBER_ID_V)//如果登陸者和被推薦者相同不進行操作
    {
        document.getElementById('CheckBoxTravel').style.display='none';
        return false;
    }
    if(objadoA.checked)//選擇下拉框的
        strCOMMEND_REASON= objdrpCOMMEND.options[objdrpCOMMEND.selectedIndex].text
    else if(objadoB.checked)//選擇自定義的
        strCOMMEND_REASON= objtxtCOMMEND.value
    var weburl = "Checkbox_Commend.aspx";  //地址
    xmlhttp = GetXmlHttpRequest();
    xmlhttp.onreadystatechange=funEndCheckBoxTravel;
    xmlhttp.open("Post",weburl,true);
    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
    xmlhttp.send("sMember_ID_V="+escape(strMEMBER_ID_V)+"&sCOMMEND_REASON="+escape(strCOMMEND_REASON)+"&sType="+escape(strType));
    document.getElementById('CheckBoxTravel').style.display='none';
    return false;
} 
//取得當前瀏覽器支持的XMLHTTP對象   
function GetXmlHttpRequest() 
{  
    var request=null;   
  if(window.XMLHttpRequest)
    {
        request = new XMLHttpRequest(  );
    } 
    else if (window.ActiveXObject)
    {
        request=new ActiveXObject("Msxml2.XMLHTTP");
        if (! request)
        {
            request=new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return request;
}

//---------------------------------------------------------------------[去前後空格] (附加為基類方法)
//Author        ：sky
//Last Modifiy  ：2006/02/05
//eg:var str=document.all.txtName.value.trim();
String.prototype.trim=function()
{
	return this.replace(/(^\s*)|(\s*$)/g,'');	
}
//---------------------------------------------------------------------[去前後空格] (函數)
//eg:var str=trimSpace(document.all.txtName.value);

//顯示推一下DIV
function funShowCheckBox(strType)
{
    var DviWait;
    if(strType=="01")
        DviWait=document.getElementById('CheckBox');//我想住，推一下
    else if(strType=="02")
        DviWait=document.getElementById('CheckBoxTravel');//我想玩，推一下
    else if(strType=="00")
        DviWait=document.getElementById('CheckBoxHost');//好客主人，推一下

    document.getElementById('divLogin').style.display='none';        
    openDivWindow(DviWait);        
    return false;
}


//添加好客主人的狀態
function funEndCheckBoxHost() 
{
    if (xmlhttp.readyState == 4) 
     {
        document.getElementById("CheckBoxHost").style.display='none';
        document.getElementById('divLogin').style.display='none';
        
       if (xmlhttp.status == 200) 
       {            
            var tmpResponseText = xmlhttp.responseText.replace(/^\s+|\s+$/g,"");
            if(tmpResponseText=="Y")
            {
                location.reload();
                ShowOk("000084","");//成功推了一下!
            }
            else if(tmpResponseText=="N")
            {
                ShowError("000085","");//您已經推過了!
            }
            else if(tmpResponseText=="R")
            {
                ShowError("000146","");//不可以自己推自己哦！
            }
            else if(tmpResponseText=="LEVEL")
            {
                ShowError("000164","");//您已經達到了最大的推薦次數，本次推薦失敗！!
            }
            else//邊界處理
            {
                ShowError("000086","");//操作未響應!
            }　
       }
       else
        {
            ShowError("000086","");//操作未響應!
        }
       
     }
   }



//添加住我家后的狀態
function funEndCheckBoxHome() 
{

//alert("CCCCxmlhttp.readyState="+xmlhttp.readyState+"***xmlhttp.status="+xmlhttp.status+"***xmlhttp.responseText="+xmlhttp.responseText);

    document.getElementById('CheckBox').style.display='none';
    document.getElementById('divLogin').style.display='none';
    
     if (xmlhttp.readyState == 4) 
     {
       if (xmlhttp.status == 200) 
       {
            var tmpResponseText = xmlhttp.responseText.replace(/^\s+|\s+$/g,"");
            if(tmpResponseText=="Y")
            {
                location.reload();
                ShowOk("000084","");//成功推了一下!
            }
            else if(tmpResponseText=="N")
            {
                ShowError("000085","");//您已經推過了!
            }
            else if(tmpResponseText=="R")
            {
                ShowError("000146","");//不可以自己推自己哦！
            }
            else if(tmpResponseText=="LEVEL")
            {
                ShowError("000164","");//您已經達到了最大的推薦次數，本次推薦失敗！!
            }
            else//邊界處理
            {
                ShowError("000086","");//操作未響應!
            }　
       }
       else
        {
            ShowError("000086","");//操作未響應!
        }
       
     }
   }
   
//添加帶你玩后的狀態
function funEndCheckBoxTravel() 
{
    if (xmlhttp.readyState == 4) 
     {
        document.getElementById('CheckBoxTravel').style.display='none';
        document.getElementById('divLogin').style.display='none';
        
       if (xmlhttp.status == 200) 
       {
            var tmpResponseText = xmlhttp.responseText.replace(/^\s+|\s+$/g,"");
            if(tmpResponseText=="Y")
            {
                location.reload();
                ShowOk("000084","");//成功推了一下!
            }
            else if(tmpResponseText=="N")
            {
                ShowError("000085","");//您已經推過了!
            }
            else if(tmpResponseText=="R")
            {
                ShowError("000146","");//不可以自己推自己哦！!
            }
            else if(tmpResponseText=="LEVEL")
            {
                ShowError("000164","");//您已經達到了最大的推薦次數，本次推薦失敗！!
            }
            else//邊界處理 其他的一些不可預期的錯誤的處理
            {
                ShowError("000086","");//操作未響應!
            }
       }
       else
       {
            ShowError("000086","");//操作未響應!
       }
     }
   }
//添加推薦過濾
function add(strType)
{
    var objadoA=document.getElementById("ctl00_rdoCOMMEND1");
    var objdrpCOMMEND=document.getElementById("ctl00_drpCOMMEND");
    var objadoB=document.getElementById("ctl00_rdoCOMMEND2");
    var objtxtCOMMEND=document.getElementById("ctl00_txtCOMMEND");
    var strType=strType;//類型
    var strMEMBER_ID_V=document.getElementById("ctl00_MEMBER_ID_V").value;//被推薦人id
    var strCOMMEND_REASON;//推薦語錄
    if(objadoA.checked)
        strCOMMEND_REASON= objdrpCOMMEND.value
    else if(objadoB.checked)
        strCOMMEND_REASON= objtxtCOMMEND.value
}

//添加黑名單和收藏的動作
function addCOFFINEnd()
{
    if (xmlhttp.readyState == 4) 
     {
       if (xmlhttp.status == 200) 
       {       
            if(xmlhttp.responseText=="CY" || xmlhttp.responseText=="BY")//  CY：推薦資料檔添加成功，BY：黑名單資料檔添加成功
            {
                document.getElementById('CheckBox').style.display='none';
                document.getElementById('divLogin').style.display='none';
                document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
                ShowOk("000087","");//添加成功!
            }
            else if(xmlhttp.responseText=="CN" || xmlhttp.responseText=="BN")//  CN：推薦資料檔添加失敗，BN：黑名單資料檔添加失敗
            {
                document.getElementById("CheckBox").style.display='none';
                document.getElementById('divLogin').style.display='none';
                document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
                ShowError("000088","");//添加失敗!
            }
            else if(xmlhttp.responseText=="CE" || xmlhttp.responseText=="BE")//  CE：推薦資料檔已經存在，BE：黑名單資料檔已經存在
            {
                document.getElementById("CheckBox").style.display='none';
                document.getElementById('divLogin').style.display='none';
                document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
                ShowError("000089","");//已經存在!
            }
            else if(xmlhttp.responseText=="CR")// CR：當自己加自己進入推薦資料檔時，BR：當自己加自己進入黑名單資料檔時
            {
                document.getElementById("CheckBox").style.display='none';
                document.getElementById('divLogin').style.display='none';
                document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
                ShowError("000153","");//你難道要把自己加入收藏夾嗎？是不可以的
            }
            else if(xmlhttp.responseText=="BR")// CR：當自己加自己進入推薦資料檔時，BR：當自己加自己進入黑名單資料檔時
            {
                document.getElementById("CheckBox").style.display='none';
                document.getElementById('divLogin').style.display='none';
                document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
                ShowError("000145","");//你難道要把自己加入黑名單嗎？是不可以的
            }
            else if(xmlhttp.responseText=="MEMBER_ID")
            {
                document.getElementById('divLogin').style.display='';
                document.getElementById("ctl00_lblShowError").innerText=" 該用戶不存在";
                document.getElementById("ctl00_lblShowError").textContent=" 該用戶不存在";
            }
            else if(xmlhttp.responseText=="PASSWORD")
            {
                document.getElementById('divLogin').style.display='';
                document.getElementById("ctl00_lblShowError").innerText=" 密碼錯誤";
                document.getElementById("ctl00_lblShowError").textContent=" 密碼錯誤";
            }
            else if(xmlhttp.responseText=="TY")
            {
                document.getElementById("ctl00_lblShowError").innerText=" 該帳號已經停用!";
                document.getElementById("ctl00_lblShowError").textContent=" 該帳號已經停用!";
            }
            else if(xmlhttp.responseText=="LOGINERROR")
            {
                document.getElementById('divLogin').style.display='';
                document.getElementById("ctl00_lblShowError").innerText="帳號密碼有誤，無法登入";
                document.getElementById("ctl00_lblShowError").textContent="帳號密碼有誤，無法登入";
            }
            else if(xmlhttp.responseText.substring(0,2)=="SV")
            {               
                location.href=xmlhttp.responseText.substring(3); 
            }          
            else//邊界處理 其他的一些不可預期的錯誤的處理
            {
                document.getElementById('CheckBox').style.display='none';
                document.getElementById('divLogin').style.display='none';
                ShowError("000086","");//操作未響應!
            }
       }
       else
       {
                document.getElementById('CheckBox').style.display='none';
                document.getElementById('divLogin').style.display='none';
                ShowError("000086","");//操作未響應!
       }
     }
     location.reload();//重新載入頁面一次
}

 //鼠標離開后，如果文本框的值為空就還原以前的值
 function revertText(objText,rdo1,result)
 {
    var sayText = document.getElementById(objText).value;
    if(sayText == "")
    {
        document.getElementById(objText).value = result;
        rdo1.checked=true;
    }
 }
 
 //鼠標點擊文本后，就清空文本的值
 function ClearText(objText,objrdo2,result)
 { 
    var sayText = document.getElementById(objText).value;
    objrdo2.checked=true;
    if(sayText.trim() == result.trim())
    {
        document.getElementById(objText).value = "";
    }
 }
 
 function openDivWindow(divWindow)
 {
    if (divWindow)
    {
        divWindow.style.display = 'block';
        
        var divWindowTop= 0;
        if (document.documentElement.scrollTop)
            divWindowTop = document.documentElement.scrollTop;
        else
            divWindowTop = document.body.scrollTop;    
            
        divWindow.style.left = (Math.abs(window.screen.availWidth)/2-150)+'px';
        divWindow.style.top = divWindowTop + (Math.abs(window.screen.availHeight)/2-150) + 'px';
    }
 }
 
function closeLoginWindow()
{
    document.getElementById("divLogin").style.display="none";
    document.getElementById("ctl00_lblShowError").innerText="";
    document.getElementById("ctl00_txtMEMBER_ID").value="";
    document.getElementById("ctl00_txtMEMBER_PWD").value="";
    return false;
}


//添加黑名單和收藏的動作
function addCOFFINEnd2(data,textStatus)
{
    if (textStatus == "success") 
     {     
            if(data=="CY" || data=="BY")//  CY：推薦資料檔添加成功，BY：黑名單資料檔添加成功
            {
                document.getElementById('CheckBox').style.display='none';
                document.getElementById('divLogin').style.display='none';
                document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
                ShowOk("000087","");//添加成功!
            }
            else if(data=="CN" || data=="BN")//  CN：推薦資料檔添加失敗，BN：黑名單資料檔添加失敗
            {
                document.getElementById("CheckBox").style.display='none';
                document.getElementById('divLogin').style.display='none';
                document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
                ShowError("000088","");//添加失敗!
            }
            else if(data=="CE" || data=="BE")//  CE：推薦資料檔已經存在，BE：黑名單資料檔已經存在
            {
                document.getElementById("CheckBox").style.display='none';
                document.getElementById('divLogin').style.display='none';
                document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
                ShowError("000089","");//已經存在!
            }
            else if(data=="CR")// CR：當自己加自己進入推薦資料檔時，BR：當自己加自己進入黑名單資料檔時
            {
                document.getElementById("CheckBox").style.display='none';
                document.getElementById('divLogin').style.display='none';
                document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
                ShowError("000153","");//你難道要把自己加入收藏夾嗎？是不可以的
            }
            else if(data=="BR")// CR：當自己加自己進入推薦資料檔時，BR：當自己加自己進入黑名單資料檔時
            {
                document.getElementById("CheckBox").style.display='none';
                document.getElementById('divLogin').style.display='none';
                document.getElementById("ctl00_IsLogin").value="YES";//記錄登錄狀態
                ShowError("000145","");//你難道要把自己加入黑名單嗎？是不可以的
            }
            else if(data=="MEMBER_ID")
            {
                document.getElementById('divLogin').style.display='';
                document.getElementById("ctl00_lblShowError").innerText=" 該用戶不存在";
                document.getElementById("ctl00_lblShowError").textContent=" 該用戶不存在";
            }
            else if(data=="PASSWORD")
            {
                document.getElementById('divLogin').style.display='';
                document.getElementById("ctl00_lblShowError").innerText=" 密碼錯誤";
                document.getElementById("ctl00_lblShowError").textContent=" 密碼錯誤";
            }
            else if(data=="TY")
            {
                document.getElementById('divLogin').style.display='';
                document.getElementById("ctl00_lblShowError").innerText=" 該帳號已經停用!";
                document.getElementById("ctl00_lblShowError").textContent=" 該帳號已經停用!";
            }
            else if(data=="LOGINERROR")
            {
                document.getElementById('divLogin').style.display='';
                document.getElementById("ctl00_lblShowError").innerText="帳號密碼有誤，無法登入";
                document.getElementById("ctl00_lblShowError").textContent="帳號密碼有誤，無法登入";
            }
            else if(data.substring(0,2)=="SV")
            {                   
                window.location.href= data.substring(3);
                return;
            }          
            else//邊界處理 其他的一些不可預期的錯誤的處理
            {
                document.getElementById('CheckBox').style.display='none';
                document.getElementById('divLogin').style.display='none';
                ShowError("000086","");//操作未響應!
            }
     }
    else
    {
        document.getElementById('CheckBox').style.display='none';
        document.getElementById('divLogin').style.display='none';
        ShowError("000086","");//操作未響應!
    }
    
    location.reload();//重新載入頁面一次
}