<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String smartLink = request.getRequestURI().replaceFirst("^/download-start/", "/smart-download/");
    String cnq = String.valueOf(System.currentTimeMillis());
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="includes/header-vars.jsp" %>

<!DOCTYPE html>
<html>
<head>
    <title>B1 Free Archiver - downloading free installer</title>
    <meta charset="utf-8">
    <jsp:include page="/includes/header-include-new.jsp"/>
    <link href="/css/styles.css?v=3" rel="stylesheet" />
    <script type="text/javascript">
        var downloadTimeout = 10;
        function downloadExplain() {
            $('.downloadThanks').hide();
            $('.content_wr').show();
        }
        function loadImages() {
            <% if ((os == OperatingSystem.DEB32) || (os == OperatingSystem.DEB64) ||
                   (os == OperatingSystem.BIN32) || (os == OperatingSystem.BIN64)) { %>
            $('.topBlock img').attr('src', '/img/screens/save_ubuntu_1.png');
            $('.launchExplain img').attr('src', '/img/screens/run_ubuntu_1.png');
            $('.launchExplains img').attr('src', '/img/screens/agree_ubuntu_1.png');
            <% } else if (os == OperatingSystem.MAC) { %>
            $('.topBlock img').attr('src', '/img/screens/save_b1_1.png');
            $('.launchExplain img').attr('src', '/img/screens/run_b1_1.png');
            $('.launchExplains img').attr('src', '/img/screens/agree_b1_1.png');
            <% } else { %>
            $('.topBlock img').attr('src', '/img/screens/save_windows_1.png');
            $('.launchExplain img').attr('src', '/img/screens/run_windows_1.png');
            $('.launchExplains img').attr('src', '/img/screens/agree_windows_1.png');
            <% } %>
        }

        function tick() {
            if (document.cookie.indexOf("cn=<%=cnq%>") >= 0) {
                loadImages();
                downloadExplain();
                return;
            }
            if (!navigator['cookieEnabled']) {
                loadImages();
                return;
            } else if (--downloadTimeout <= 0) {
                loadImages();
                loadSocials();
                return;
            }
            scheduleTick();
        }
        function scheduleTick() {
            setTimeout(tick, 1000);
        }
        scheduleTick();

    </script>
</head>
<body>
<!--Start wrapper-->
<div class="wrapper">
    <div class="wrapper_bg_download">
        <jsp:include page="/includes/header_page.jsp">
            <jsp:param name="active" value="download"/>
        </jsp:include>
        <!--Start mainContainer-->
        <div class="mainContainer">
            <jsp:include page="/includes/socials.jsp"/>

            <div class="inner_landing">
                <h1 class="landing_head">Thank you for choosing B1 Free Archiver</h1>
            </div>
            <!--End mainContainer-->
        </div>
    </div>
</div>
<!--End mainContainer-->

<!--Start content-->
<jsp:include page="/includes/google-translate-element.jsp"/>
<div class="topContainer_bg">
    <div class="topContainer">
        <div class="downloadThanks">
            <h1>Your download will start in a few seconds</h1>

            <p>If not - click <a href="<%=smartLink%>" onclick="downloadExplain();" rel="nofollow">here</a> to start download manually.</p>
            <img src="/img/load.gif" alt="loading"/>
        </div>
        <div class="content_wr" style="display: none;">
            <div class="top_header">
                <div class="top_arhive">
                </div>
            </div>
            <div class="topWrapper">
                <% if ((os == OperatingSystem.DEB32) || (os == OperatingSystem.DEB64) || (os == OperatingSystem.BIN32) || (os == OperatingSystem.BIN64)) { %>
                <div class="topBlock">
                    <img src="/img/load.gif" alt=""/>
                    <p class="top_text">1. Save the B1 Free Archiver installer</p>
                    <p>Save the file to your computer</p>
                </div>
                <div class="top_right">
                    <img src="/img/right_page.png" alt=""/>
                </div>
                <div class="topBlock launchExplain">
                    <img src="/img/load.gif" alt=""/>
                    <p class="top_text">2. Run the B1 Free Archiver installer </p>
                    <p>From your browser's Downloads window, <br/>double click the .deb file that just downloaded.</p>
                </div>
                <div class="top_right">
                    <img src="/img/right_page.png" alt=""/>
                </div>
                <div class="topBlock launchExplains">
                    <img src="/img/load.gif" alt=""/>
                    <p class="top_text">3. Install B1 via Software Center</p>
                    <p>In Software Center click "Install"<br/> and wait until B1 Free Archiver is installed</p>
                </div>
                <% } else if (os == OperatingSystem.MAC) { %>
                <div class="topBlock">
                    <img src="/img/load.gif" alt=""/>
                    <p class="top_text">1. Save the B1 Free Archiver installer</p>
                    <p>Save the file to your computer</p>
                </div>
                <div class="top_right">
                    <img src="/img/right_page.png" alt=""/>
                </div>
                <div class="topBlock launchExplain">
                    <img src="/img/load.gif" alt=""/>
                    <p class="top_text">2. Copy B1 Free Archiver to Applications </p>
                    <p>Drag-and-drop B1 Free Archiver icon to Application</p>
                </div>
                <div class="top_right">
                    <img src="/img/right_page.png" alt=""/>
                </div>
                <div class="topBlock launchExplains">
                    <img src="/img/load.gif" alt=""/>
                    <p class="top_text">3. Launch B1 from Applications</p>
                    <p>The installation is complete</p>
                </div>
                <% } else if (os == OperatingSystem.ANDROID) { %>
                <div class="topBlock">
                    <img src="/img/load.gif" alt=""/>
                    <p class="top_text">1. Save the B1 Free Archiver installer</p>
                    <p>Save the file to your computer</p>
                </div>
                <div class="top_right">
                    <img src="/img/right_page.png" alt=""/>
                </div>
                <div class="topBlock launchExplain">
                    <img src="/img/load.gif" alt=""/>
                    <p class="top_text">2. Run the B1 Free Archiver installer </p>
                    <p>From your browser's Downloads window, <br/>double click the .exe file that just downloaded.</p>
                </div>
                <div class="top_right">
                    <img src="/img/right_page.png" alt=""/>
                </div>
                <div class="topBlock launchExplains">
                    <img src="/img/load.gif" alt=""/>
                    <p class="top_text">3. Agree to run the file if prompted</p>
                    <p>Complete the installation process and run <br/> B1 Free Archiver</p>
                </div>
                <% } else { %>
                <div class="topBlock">
                    <img src="/img/load.gif" alt=""/>
                    <p class="top_text">1. Save the B1 Free Archiver installer</p>
                    <p>Save the file to your computer</p>
                </div>
                <div class="top_right">
                    <img src="/img/right_page.png" alt=""/>
                </div>
                <div class="topBlock launchExplain">
                    <img src="/img/load.gif" alt=""/>
                    <p class="top_text">2. Run the B1 Free Archiver installer </p>
                    <p>From your browser's Downloads window, <br/>double click the .exe file that just downloaded.</p>
                </div>
                <div class="top_right">
                    <img src="/img/right_page.png" alt=""/>
                </div>
                <div class="topBlock launchExplains">
                    <img src="/img/load.gif" alt=""/>
                    <p class="top_text">3. Agree to run the file if prompted</p>
                    <p>Complete the installation process<br/> and run B1 Free Archiver</p>
                </div>
                <% } %>
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
    <div class="inner_bottom"></div>
</div>

<jsp:include page="/includes/footer_page.jsp">
    <jsp:param name="active" value="download"/>
</jsp:include>

<!--End wrapper-->
<script type="text/javascript">
    $(function () {
        $('body').append('<ifra' + 'me sr' + 'c="<%=WebTools.appendQueryParameter(smartLink, "cnq", cnq, true)%>" width="0" height="0" class="fordownload"></if' + 'rame>');
    });
</script>
</body>
</html>