﻿
function showAttention(showDiv,hideDiv) {

    //背景
    if(typeof(hideDiv)!="undefined" && hideDiv!= null){
        hideDiv.style.display="none"; 
        document.body.appendChild(hideDiv);
    }
    if (showDiv == null || typeof (hideDiv) == "undefined") {
        return;
    }
    attentionID=showDiv.id;    
    showDiv.style.display="block";   
    if($("div_Attention")) document.body.removeChild($("div_Attention"));   
    var width=document.body.clientWidth;
    var height=document.body.clientHeight;
    height=height-210;
    var div = document.createElement("div");

    div.style.cssText = "background:gray;height:" + height + "px;width:" + width + "px;FILTER: alpha(opacity=80);position:absolute;z-index:10;top:0px;left:0px;display:block;";
	//div.style.setAttribute("cssText","background:gray;height:"+height+"px;width:"+width+"px;FILTER: alpha(opacity=80);position:absolute;z-index:10;top:0px;left:0px;display:block;");
	div.id="div_Attention";
	div.style.display="block";
	div.onclick = function() {
	    //	    if(event.srcElement.id=='div_Attention' || event.srcElement.id=='div_content1'){
	    //	        var div_content1=$("div_content1");	    
	    //	        cancelAttention(attentionID);
	    //	    }
	    try {
	        cancelAttention(attentionID);
	    }
	    catch (ex) {
	        
	    }
	}
    document.body.appendChild(div); 
    
    var div_content1=document.createElement("div");
    div_content1.id="div_content1";
    var content1_top = document.documentElement.scrollTop + 100;
    var content_left = (width - 462) / 2;
    div_content1.style.cssText = "position:absolute;top:" + content1_top + "px;left:" + content_left + "px;z-index:11;  margin:0 auto;padding:3px;width:462px;";
    //div_content1.style.setAttribute("cssText", "position:absolute;top:" + content1_top + "px;left:" + content_left + "px;z-index:11;  margin:0 auto;padding:3px;width:462px;");    
     
    div_content1.appendChild(showDiv);    
    document.body.appendChild(div_content1);   
    new Effect.Appear('div_Attention', { duration: 1.0});    

        window.onscroll=function()
        {    
            var div_content=document.getElementById("div_content1");
            if(div_content)
            {                     
                 div_content.style.top = document.documentElement.scrollTop+100+"px";              
            }
        }  
}

function cancelAttention(id) {
    clearPageData();    
    submitButton = null;
    var div = document.getElementById(id);
    div.style.display = "none";
    if (div) document.body.appendChild(div);
    new Effect.Fade('div_Attention', { duration: 1.0 });
    var divAttention = $("div_Attention");
    if (divAttention) document.body.removeChild(divAttention);
    if ($("div_content1")) document.body.removeChild($("div_content1"));
}

function clearPageData() {
    if ($("txtNewPassword2")) $("txtNewPassword2").value = "";
    if ($("txtNewPassword1")) $("txtNewPassword1").value = "";
    if ($("txtOrigPassword")) $("txtOrigPassword").value = "";
    if ($("txtPasswordMobileNumber")) $("txtPasswordMobileNumber").value = "";
    if ($("password")) $("password").value = "";
    if ($("userName")) $("userName").value = "";
    if ($("txtLeaveMessage")) $("txtLeaveMessage").value = "";    

    if ($("loginInfoMessage")) $("loginInfoMessage").innerHTML = "&nbsp;&nbsp;";
    if ($("FindPWInfoMessage")) $("FindPWInfoMessage").innerHTML = "&nbsp;&nbsp;";
    if ($("ChangePWInfoMessage")) $("ChangePWInfoMessage").innerHTML = "&nbsp;&nbsp;";
    if ($("LeaveInfoMessage")) $("LeaveInfoMessage").innerHTML = "&nbsp;&nbsp;";

    if ($("btnLogin")) $("btnLogin").disabled = "";
}
