<%-- 
    Document   : popup
    Created on : Nov 16, 2015, 8:27:06 AM
    Author     : khanhdn1
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib uri="http://ajaxtags.org/tags/ajax" prefix="ajax" %>
<%@ taglib tagdir="/WEB-INF/tags/common/" prefix="tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<!--Alert đang xử lý-->
<div id="progressing-div" class="popup-alert" style="display: none;">
    <div class="backdrop-div-background">    
    </div> 
    <div class="alert-div loading-div">
        <img class="loading-image" src="<html:rewrite page='/share/img/loading.gif'/>" alt="Loading.."/>
        <div class="alert-text loading-text"><%=utils.ResourceBundleUtils.getApplicationResource("processing.div.message.default")%></div>
    </div>
</div>


<!--Alert thông báo lỗi-->
<div id="message-div" class="popup-alert" style="display: none;">
    <div class="backdrop-div-background">    
    </div> 
    <div class="alert-div notice-error-div">        
        <div class="alert-text notice-error-text">           
            <div class="message-content-div">                
            </div>
            <button type="button" class="btn btn-primary btn-notice" data-dismiss="modal" onclick="hideMessage()" style="  font-size: 17px;">OK</button>
        </div>
    </div>
</div>


<script type="text/javascript">
    /*    
     Ẩn màn hình chọn CKS
     */
    function hideAllPopup() {
        jQuery(".popup-alert").hide();
    }

    /*    
     Hiện thị thông báo
     */
    function showProgressing(message) {
        hideAllPopup();      
        if (message != undefined) {
            jQuery("#progressing-div .loading-text").html(message);
        } else {
            jQuery("#progressing-div .loading-text").html("<%=utils.ResourceBundleUtils.getApplicationResource("processing.div.message.default")%>");
        }
        
        var marginTop =  window.pageYOffset - (jQuery("#progressing-div .loading-div").height()/2 ) + jQuery(window).height()/2 - 200;
        jQuery("#progressing-div .loading-div").css({"margin-top": marginTop + "px"})
        jQuery("#progressing-div").show();
    }

    /*    
     Ẩn thông báo
     */
    function hideProgressing() {
        jQuery("#progressing-div").hide();
    }

    /*    
     Hiện thị thông báo lỗi
     */
    function showMessage(message) {
        hideAllPopup();
        jQuery("#message-div .alert-text .message-content-div").html(message);
        var marginTop =  window.pageYOffset - (jQuery("#message-div .alert-div").height()/2 ) + jQuery(window).height()/2 - 100;
        jQuery("#message-div .alert-div").css({"margin-top": marginTop + "px"})        
        jQuery("#message-div").show();
    }

    /*    
     Ẩn thông báo lỗi
     */
    function hideMessage() {
        jQuery("#message-div").hide();
    }
</script>