CVE-2017-8832 (PHP, published 2017-05-08T06:29Z)
Description: value: Allen Disk 1.6 has XSS in the id parameter to downfile.php.
Severity: MEDIUM (CVSS v3 base score: 6.1)
Weakness: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Repository: https://github.com/s3131212/allendisk
Files changed:
LICENSE
README.md
admin/index.php
admin/login.php
admin/loginc.php
admin/manuser.php
admin/newb.php
admin/newuser.php
admin/setting.php
ajax/ajax_delete.php
ajax/ajax_delete_dir.php
ajax/ajax_dir_tree.php
ajax/ajax_filelist.php
ajax/ajax_list_dir.php
ajax/ajax_list_dir_back.php
ajax/ajax_list_usage.php
ajax/ajax_move.php
ajax/ajax_move_dir.php
ajax/ajax_polling.php
ajax/ajax_recycle.php
ajax/ajax_recycle_back.php
ajax/ajax_recycle_back_dir.php
ajax/ajax_recycle_dir.php
ajax/ajax_recyclelist.php
ajax/ajax_rename.php
ajax/ajax_rename_dir.php
ajax/ajax_set_color.php
ajax/ajax_share.php
captcha/readme.md
captcha/simple-php-captcha.php
class/password_compat.php
class/sql.class.php
config.php
css/bootstrap.min.css
css/sweet-alert.css
database.php
diruploadiframe.php
downfile.php
file/.htaccess
file/index.php
home.php
index.php
install/database-sample.php
install/env-check.php
install/index.php
install/install-method.php
install/install.sql
install/mysql-set.php
install/mysql-setting.php
install/newuser-set.php
install/newuser-setting.php
install/site-set.php
install/site-setting.php
js/audio.min.js
js/bootstrap.js
js/bootstrap.min.js
js/modernizr.js
js/script.js
js/sweet-alert.min.js
login.php
loginc.php
logout.php
mkdir.php
preview.php
rdownfile.php
readfile.php
reg.php
remotedownload.php
setpass.php
share_dir.php
tos.php
uploadfile.php
uploadfileiframe.php
uploadiframe.php
why.php
Commit message: Fix XSS


Vulnerable code:

Fixed code:
The MIT License (MIT)

Copyright (c) 2016 Allen Chou

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Allen Disk
========================
Allen Disk 是一個強大、免費、開源的雲端硬碟，有了Allen Disk，你將可以擁有自己的網路硬碟，甚至開放註冊帳號，給大家當作免空。 Allen Disk 配有檔案加密儲存、外連檔案、線上預覽、分享資料夾等等功能，讓你輕鬆管理你的檔案或是分享給大家一起使用。
[http://ad.allenchou.cc](http://ad.allenchou.cc)
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
require '../config.php';
if (!session_id()) {
    session_start();
}

if (!$_SESSION['alogin']) {
    header('location:login.php');
    exit();
}

function sizecount($size)
{
    if ($size < 0.001) {
        return round(($size * 1000 * 1000), 2).'B';
    } elseif ($size >= 0.001 && $size < 1) {
        return round(($size * 1000), 2).'KB';
    } elseif ($size >= 1 && $size < 1000) {
        return round($size, 2).'MB';
    } elseif ($size >= 1000) {
        return round(($size / 1000), 2).'GB';
    }
}
$used = $db->ExecuteSQL(sprintf('SELECT SUM(`size`) AS `sum` FROM `file`'));
$filecount = $db->ExecuteSQL(sprintf('SELECT COUNT(`id`) AS `count` FROM `file`'));
$sharecount = $db->ExecuteSQL(sprintf("SELECT COUNT(`id`) AS `count` FROM `file` WHERE `share` = '1'"));
$usercount = $db->ExecuteSQL(sprintf('SELECT COUNT(`name`) AS `count` FROM `user`'));

//Check Update
$current_version = '1.6.0';
$newest_version = @file_get_contents('http://ad.allenchou.cc/version.txt');
//$newest_version = '1.5.1'; //development only
if (version_compare($newest_version, $current_version, '>')) {
    $update = true;
} else {
    $update = false;
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>管理員介面 - <?php echo $config['sitename'];?></title>
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
    <style>
        body{
            background-color: #F8F8F8;
        }
        p {
            line-height: 30px;
        }
        .num{
            font-size: 20px;
            line-height: 30px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1 class="text-center"><?php echo $config['sitetitle']; ?> 管理介面</h1>
        <ul class="nav nav-tabs">
            <li class="active"><a href="#">管理介面首頁</a></li>
            <li><a href="setting.php">設定</a></li>
            <li><a href="newuser.php">新增使用者</a></li>
            <li><a href="manuser.php">管理使用者</a></li>
            <li><a href="../index.php">回到首頁</a></li>
            <li><a href="login.php">登出</a></li>
        </ul>
        <br />
        <?php
        if ($update) {
            echo '<div class="alert alert-warning">新版 Allen Disk 已經發表，請儘速至 <a href="http://ad.allenchou.cc" target="_blank">Allen Disk 官網</a> 下載新版，謝謝</div>';
        }
        ?>
        <div class='row'>
          <div class="panel panel-default col-md-4 col-md-offset-1">
              <div class="panel-heading">
                  <h3 class="panel-title">檔案</h3>
              </div>
              <div class="panel-body">
                  <p>檔案數：<span class='num'><?php echo $filecount[0]['count']; ?> 個</span></p>
                  <p>佔用空間：<span class='num'><?php echo sizecount(($used[0]['sum'] / 1000 / 1000)); ?></span></p>
                  <p>公開分享檔案數：<span class='num'><?php echo $sharecount[0]['count']; ?> 個</span></p>
              </div>
          </div>
          <div class="panel panel-default col-md-4 col-md-offset-2">
              <div class="panel-heading">
                  <h3 class="panel-title">用戶</h3>
              </div>
              <div class="panel-body">
                  <p>用戶數：<span class='num'><?php echo $usercount[0]['count']; ?> 位</span></p>
                  <p>總可用空間：<span class='num'><?php echo ($config['total'] != 0) ? sizecount($usercount[0]['count'] * $config['total']) : '無限制'; ?></span></p>
              </div>
          </div>
      </div>
  </div>
</br>
<p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</body>
</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
require_once '../config.php';
include '../captcha/simple-php-captcha.php';
if (!session_id()) {
    session_start();
}
$_SESSION['captcha'] = simple_php_captcha();

?>
<!DOCTYPE html>
<html>
<head>
<title>登入管理介面 - <?php echo $config['sitename'];?></title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<style>body{ background-color: #F8F8F8; }</style>
</head>
<body>
<div class="container">
    <h1 class="text-center"><?php echo $config['sitetitle']; ?> 管理介面</h1>
    <?php 
    if (isset($_GET['err']) && $_GET['err'] == '1') {
        echo '<div class="alert alert-danger"><p>密碼或驗證碼錯誤</p></div>';
    }
    ?>
    <div class="row" style="margin:0 auto;">
        <div class="col-md-4 col-md-offset-4">
            <div class="panel panel-default">
                <div class="panel-body">
                        <form class="form-horizontal" action="loginc.php" method="post" role="form" style="margin:20px">
                            <div class="form-group">
                                <label class="control-label" for="password">密碼</label>
                                <div class="controls">
                                    <input type="password" id="password" class="form-control" placeholder="Password" name="password">
                                </div>
                            </div>
                            <br/>
                            <div class="form-group">
                                <label class="control-label" for="captcha">驗證碼</label>
                                <div class='row'>
                                    <div class='col-md-5 col-md-offset-1'>
                                        <div class="controls">
                                            <input type="text" id="captcha" class="form-control" placeholder="Captcha" name="captcha">
                                        </div>
                                    </div>
                                    <div class="col-md-5">
                                        <img src="<?php echo $_SESSION['captcha']['image_src'] ?>" alt="captcha" style='width: 100%; height:auto;' />
                                    </div>
                                </div>
                            </div>
                            <br/>
                            <div class="form-group">
                                <div class="controls">
                                    <button type="submit" class="btn btn-success btn-block">登入</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <a href="../index.php">← 回首頁</a>
            </div>
        </div>
    <br />
    <p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</div>
</body>
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include '../config.php';
if (!session_id()) {
    session_start();
}
$res = $db->select('setting', array('name' => 'admin'));
if ($_POST['password'] == $res[0]['value'] && strtolower($_POST['captcha']) == strtolower($_SESSION['captcha']['code'])) {
    $_SESSION['alogin'] = true;
    header('Location: index.php');
} else {
    header('Location: login.php?err=1');
}
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
require '../config.php';
if (!session_id()) {
    session_start();
}
if (!$_SESSION['alogin']) {
    header('location:login.php');
    exit();
}
function sizecount($size)
{
    if ($size < 0.001) {
        return round(($size * 1000 * 1000), 2).'B';
    } elseif ($size >= 0.001 && $size < 1) {
        return round(($size * 1000), 2).'KB';
    } elseif ($size >= 1 && $size < 1000) {
        return round($size, 2).'MB';
    } elseif ($size >= 1000) {
        return round(($size / 1000), 2).'GB';
    }
}
$alert = '';
if (isset($_GET['delete'])) {
    $file_list = $db->select('file', array('owner' => $_GET['delete']));
    if (is_array($file_list)) {
        foreach ($file_list as $d) {
            @unlink(dirname(dirname(__FILE__)).'/file/'.$d['realname'].'.data');
            $db->delete('file', array('id' => $d['id']));
        }
    }
    $dir_list = $db->select('dir', array('owner' => $_GET['delete']));
    if (is_array($dir_list)) {
        foreach ($db->select('dir', array('owner' => $_GET['delete'])) as $d) {
            $db->delete('dir', array('id' => $d['id']));
        }
    }
    $db->delete('user', array('name' => $_GET['delete']));
    $alert = "<div class='alert alert-success'>刪除成功</div>";
}
?>
<!DOCTYPE html>
<html>
<head>
<title>管理員介面 - <?php echo $config['sitename'];?></title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<style>body{ background-color: #F8F8F8; }</style>
</head>
<body>
<div class="container">
  <h1 class="text-center"><?php echo $config['sitetitle']; ?> 管理介面</h1>
    <ul class="nav nav-tabs">
        <li><a href="index.php">管理介面首頁</a></li>
        <li><a href="setting.php">設定</a></li>
        <li><a href="newuser.php">新增使用者</a></li>
        <li class="active"><a href="#">管理使用者</a></li>
        <li><a href="../index.php">回到首頁</a></li>
        <li><a href="login.php">登出</a></li>
    </ul>
    <?php echo $alert; ?>
    <table class="table">
        <thead>
            <tr>
                <td>帳號</td>
                <td>Email</td>
                <td>加入時間</td>
                <td>使用空間</td>
                <td>管理</td>
            </tr>
        </thead>
        <tbody>
            <?php
                $user_list = $db->select('user');
                if (is_array($user_list)) {
                    foreach ($db->select('user') as $d) {
                        $used = $db->ExecuteSQL(sprintf("SELECT SUM(`size`) AS `sum` FROM `file` WHERE `owner` = '%s'", $db->SecureData($d['name'])));
                        ?>
                        <tr>
                            <td><?php echo $d['name'] ?></td>
                            <td><?php echo $d['email'] ?></td>
                            <td><?php echo $d['jointime'] ?></td>
                            <td><?php echo sizecount(($used[0]['sum'] / 1000 / 1000));
                        ?></td>
                            <td><a href="manuser.php?delete=<?php echo $d['name'];
                        ?>" class="btn btn-danger">刪除</td>
                        </tr> 
            <?php

                    }
                }
            ?>
        </tbody>
    </table>
</div>
<p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</body>
</html>
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
require '../config.php';
include '../class/password_compat.php';
if (!session_id()) {
    session_start();
}
if (!$_SESSION['alogin']) {
    header('location:login.php');
    exit();
}
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password'];
$namecheck = $db->ExecuteSQL(sprintf("SELECT count(*) AS `count`  FROM `user` WHERE `name` = '%s'", $db->SecureData($username)));
if ($namecheck[0]['count'] > 0) {
    header('Location: newuser.php?err=2');
    exit();
}
if ($username == '') {
    header('Location: newuser.php?err=0');
    exit();
}
if ($email == '') {
    header('Location: newuser.php?err=0');
    exit();
}
if ($password == '') {
    header('Location: newuser.php?err=0');
    exit();
}
$db->insert(array('name' => $username, 'pass' => password_hash($password, PASSWORD_DEFAULT), 'email' => $email), 'user');
header('Location: newuser.php?s=1');
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
require '../config.php';
if (!session_id()) {
    session_start();
}
if (!$_SESSION['alogin']) {
    header('location:login.php');
    exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<title>管理員介面 - <?php echo $config['sitename']; ?></title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<style>body{ background-color: #F8F8F8; }</style>
</head>
<body>
<div class="container">
    <h1 class="text-center"><?php echo $config['sitetitle']; ?> 管理介面</h1>
    <ul class="nav nav-tabs">
      <li><a href="index.php">管理介面首頁</a></li>
      <li><a href="setting.php">設定</a></li>
      <li class="active"><a href="newuser.php">新增使用者</a></li>
      <li><a href="manuser.php">管理使用者</a></li>
      <li><a href="../index.php">回到首頁</a></li>
      <li><a href="login.php">登出</a></li>
    </ul>
<?php 
if (isset($_GET['s']) && $_GET['s'] == '1') {
    echo '<div class="alert alert-success">新增完成</div>';
}
if (isset($_GET['err']) && $_GET['err'] == '0') {
    echo '<div class="alert alert-danger">不能有任何欄位是空白的</div>';
}
if (isset($_GET['err']) && $_GET['err'] == '2') {
    echo '<div class="alert alert-danger">已經有重複的帳號</div>';
}
?>
<p style="font-size:30px;">新增使用者</p>
<div class="row" style="margin:0 auto;"> <div class="col-md-6">
<form class="form-horizontal" action="newb.php" method="post">
    <div class="form-group">
    <label class="control-label" for="username">帳號</label>
        <div class="controls">
          <input type="text" id="username" class="form-control" placeholder="Username" name="username">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label" for="password">密碼</label>
        <div class="controls">
            <input type="text" id="password" class="form-control" placeholder="Password" name="password">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label" for="email">Email</label>
        <div class="controls">
          <input type="text" id="email" class="form-control" placeholder="Email" name="email">
        </div>
    </div>
    <div class="form-group">
        <div class="controls">
          <button type="submit" class="btn btn-default">新增使用者</button>
        </div>
    </div>
</form></div></div>
</br>
</div>
<p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</body>
</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
require_once dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}
if ($_SESSION['alogin']) {
    if (isset($_GET['set']) && $_GET['set'] == 'set') {
        $db->update('setting', array('value' => $_POST['sitename']), array('name' => 'sitename'));
        $db->ExecuteSQL(sprintf("UPDATE `setting` SET `value` = '%s' WHERE `setting`.`name` = 'sitetitle';", $db->databaseLink->real_escape_string($_POST['sitetitle'])));
        $db->update('setting', array('value' => $_POST['size']), array('name' => 'size'));
        $db->update('setting', array('value' => $_POST['url']), array('name' => 'url'));
        $db->update('setting', array('value' => $_POST['total']), array('name' => 'total'));
        $db->update('setting', array('value' => $_POST['admin']), array('name' => 'admin'));
        $db->update('setting', array('value' => $_POST['subtitle']), array('name' => 'subtitle'));

        if ($_POST['tos'] != 'true') {
            $tos = 'false';
        } else {
            $tos = 'true';
        }
        $db->update('setting', array('value' => $tos), array('name' => 'tos'));
        if ($_POST['why'] != 'true') {
            $why = 'false';
        } else {
            $why = 'true';
        }
        $db->update('setting', array('value' => $why), array('name' => 'why'));
        if ($_POST['reg'] != 'true') {
            $reg = 'false';
        } else {
            $reg = 'true';
        }
        $db->update('setting', array('value' => $reg), array('name' => 'reg'));
        header('location: setting.php?s=1');
    }
    ?>
<!DOCTYPE html>
<html>
<head>
<title>管理員介面 - <?php echo $config['sitename'];
    ?></title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<style>body{ background-color: #F8F8F8; }</style>
</head>
<body>
<div class="container">
    <h1 class="text-center"><?php echo $config['sitetitle'];
    ?> 管理介面</h1>
    <ul class="nav nav-tabs">
        <li><a href="index.php">管理介面首頁</a></li>
        <li class="active">
            <a href="#">設定</a>
        </li>
        <li><a href="newuser.php">新增使用者</a></li>
        <li><a href="manuser.php">管理使用者</a></li>
        <li><a href="../index.php">回到首頁</a></li>
        <li><a href="login.php">登出</a></li>
    </ul>
<?php if (isset($_GET['s']) && $_GET['s'] == '1') {
    echo '<div class="alert alert-success">設定修改完成</div>';
}
    ?>
<form method="post" action="?set=set">
<table class="table table-hover">
    <thead>
        <tr>
            <td>名稱</td>
            <td>值</td>
            <td>註解</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>網頁標題</td>
            <td><input type="text" value="<?php echo $config['sitename'];
    ?>" name="sitename" id="sitename" class="form-control" /></td>
            <td>顯示在&lt;title&gt;，所以別使用HTML Tag</td>
        </tr>
        <tr>
            <td>網頁名稱</td>
            <td><input type="text" value="<?php echo htmlspecialchars($config['sitetitle']);
    ?>" name="sitetitle" id="sitetitle" class="form-control" /></td>
            <td>可以利用&lt;img&gt;來顯示Logo</td>
        </tr>
        <tr>
            <td>上傳單檔大小限制</td>
            <td><input type="text" value="<?php echo $config['size'];
    ?>" name="size" id="size" class="form-control" /></td>
            <td>單一檔案上傳最大限制，單位為MB，1000MB = 1GB，必須 ≤ upload_max_filesize & post_max_size ， 0 代表無限</td>
        </tr>
        <tr>
            <td>使用者空間</td>
            <td><input type="text" value="<?php echo $config['total'];
    ?>" name="total" id="total" class="form-control" /></td>
            <td>單一使用者最大可用空間，單位為MB，1000MB = 1GB ， 0 代表無限</td>
        </tr>
        <tr>
            <td>網站網址</td>
            <td><input type="text" value="<?php echo $config['url'];
    ?>" name="url" id="url" class="form-control" /></td>
            <td>填入「首頁網址」而非管理員介面網址，記得加上" http(s):// "和網址最後的" / "</td>
        </tr>
        <tr>
            <td>標語</td>
            <td><input type="text" value="<?php echo $config['subtitle'];
    ?>" name="subtitle" id="subtitle" class="form-control" /></td>
            <td>顯示在首頁的標語</td>
        </tr>
        <tr>
            <td>啟用註冊功能</td>
            <td><input type="checkbox" <?php if ($config['reg']) {
    echo 'checked';
}
    ?> name="reg" id="reg" value="true" /></td>
            <td>允許使用者註冊帳號，個人用網路硬碟請勿勾選</td>
        </tr>
        <tr>
            <td>顯示「為何選用XXX」</td>
            <td><input type="checkbox" <?php if ($config['why']) {
    echo 'checked';
}
    ?> name="why" id="why" value="true" /></td>
            <td>內容請至why.php修改</td>
        </tr>
        <tr>
            <td>顯示「使用條款」</td>
            <td><input type="checkbox" <?php if ($config['tos']) {
    echo 'checked';
}
    ?> name="tos" id="tos" value="true" /></td>
            <td>單一使用者可以使用的空間</td>
        </tr>
        <tr>
            <td>管理員密碼</td>
            <td><input type="text" value="<?php $res = $db->select('setting', array('name' => 'admin'));
    echo $res[0]['value']?>" name="admin" id="admin" class="form-control" /></td>
            <td>到此介面的密碼</td>
        </tr>
    </tbody>
</table>
<input type="submit" value="送出" class="btn btn-primary">
</form>
</br>
</div>
<p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</body>
</html>
<?php

} else {
    header('location:login.php');
}
?>
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}

$res = $db->select('file', array('id' => $_GET['id']));

if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner']) {
    $db->delete('file', array('id' => $_GET['id']));

    $result = @unlink(dirname(dirname(__FILE__)).'/file/'.$res[0]['realname'].'.data');

    echo json_encode(array(
        'success' => $result,
        'message' => $result ? '成功刪除檔案。' : '刪除檔案失敗。',
    ));
    $token = @touch(dirname(dirname(__FILE__)).'/updatetoken/'.md5($_SESSION['username']).'.token');
} else {
    echo json_encode(array(
        'success' => false,
        'message' => '你不是檔案的擁有者。',
    ));
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}
function delete_dir($id)
{
    $result = true;
    foreach ($GLOBALS['db']->select('file', array('owner' => $_SESSION['username'], 'dir' => $id)) as $k) {
        $result = $GLOBALS['db']->delete('file', array('id' => $k['id']));
        $result = @unlink('file/'.$k['realname'].'.data');
    }
    $result = $GLOBALS['db']->delete('dir', array('id' => $id));

    return $result;
}
function scan_dir($id)
{
    $result = true;
    foreach ($GLOBALS['db']->select('dir', array('owner' => $_SESSION['username'], 'parent' => $id)) as $d) {
        $result = scan_dir($d['id']);
    }
    $result = delete_dir($id);

    return $result;
}
$res = $GLOBALS['db']->select('dir', array('id' => $_GET['id']));
if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner']) {
    $result = scan_dir($_GET['id']);
    echo json_encode(array(
        'success' => $result,
        'message' => $result ? '成功刪除。' : '刪除失敗。',
    ));
    $token = @touch(dirname(dirname(__FILE__)).'/updatetoken/'.md5($_SESSION['username']).'.token');
} else {
    echo json_encode(array(
        'success' => false,
        'message' => '你不是資料夾的擁有者。',
    ));
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}
function scan_dir($location, $current)
{
    $output = '';
    foreach ($GLOBALS['db']->select('dir', array('parent' => $location, 'owner' => $_SESSION['username'], 'recycle' => '0')) as $d) {
        $sdir = $GLOBALS['db']->select('dir', array('parent' => $d['id'], 'owner' => $_SESSION['username'], 'recycle' => '0'));
        if ($current == $d['id']) {
            $ct = ' class="current"';
        } else {
            $ct = '';
        }
        if ($sdir[0]['id'] != null) {
            $output .= '<li'.$ct.'><i class="fa fa-folder-open"></i> <a href="home.php?dir='.$d['id'].'" data-id="'.$d['id'].'">'.$d['name'].'</a>
                        <ul data-parent="'.$d['id'].'">'.scan_dir($d['id'], $_GET['current']).'</ul></li>';
        } else {
            $output .= '<li'.$ct.'><i class="fa fa-folder"></i> <a href="home.php?dir='.$d['id'].'" data-id="'.$d['id'].'" >'.$d['name'].'</a></li>';
        }
    }

    return $output;
}
if ($_SESSION['login']) {
    $output = scan_dir('0', $_GET['current']);
    echo json_encode(array(array(
        'content' => $output,
    )));
} else {
    echo json_encode(array(
        'content' => '您尚未登入',
    ));
}
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/

@set_time_limit(20);
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}

function sizecount($size)
{
    if ($size < 0.001) {
        return round(($size * 1000 * 1000), 2).'B';
    } elseif ($size >= 0.001 && $size < 1) {
        return round(($size * 1000), 2).'KB';
    } elseif ($size >= 1 && $size < 1000) {
        return round($size, 2).'MB';
    } elseif ($size >= 1000) {
        return round(($size / 1000), 2).'GB';
    }
}
function linkcheck($type, $id, $name, $secret)
{
    /* Decode Password */
    $passphrase['b'] = $_SESSION['password'];
    $passphrase['c'] = $secret;
    $iv = md5("\x1B\x3C\x58".$passphrase['b'], true).md5("\x1B\x3C\x58".$passphrase['b'], true);
    $key = substr(md5("\x2D\xFC\xD8".$passphrase['b'], true).md5("\x2D\xFC\xD9".$passphrase['b'], true), 0, 24);
    $passphrase['a'] = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($passphrase['c']), MCRYPT_MODE_CBC, $iv), "\0\3");
    if (preg_match("/image\/(.*)/i", $type) || preg_match("/audio\/(.*)/i", $type) || preg_match("/video\/(.*)/i", $type) || preg_match("/text\/(.*)/i", $type) || $type == 'application/pdf' || $type == 'application/x-shockwave-flash') {
        echo '<a href="readfile.php/'.$name.'?id='.$id.'&password='.$passphrase['a'].'" target="_blank" class="btn btn-info">外連檔案</a>';
    } else {
        echo '<a href="#" class="btn btn-info disabled">外連檔案</a>';
    }
}

function previewcheck($type, $id)
{
    if (preg_match("/image\/(.*)/i", $type) || preg_match("/audio\/(.*)/i", $type) || preg_match("/video\/(.*)/i", $type) || preg_match("/text\/(.*)/i", $type) || $type == 'application/msword' || $type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' || $type == 'application/vnd.ms-excel' || $type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || $type == 'application/vnd.ms-powerpoint' || $type == 'application/vnd.openxmlformats-officedocument.presentationml.presentation') {
        echo '<a href="#" data-preview-id="'.$id.'" class="btn btn-warning">預覽</a>';
    } else {
        echo '<a href="#" class="btn btn btn-warning disabled">預覽</a>';
    }
}
function sharedir($share, $id)
{
    if ($share == '1') {
        echo '<a href="share_dir.php?id='.$id.'"  target="_blank" class="btn btn-info">分享</a>';
        echo '<a href="#" class="btn btn-cos sharefile" data-share-id="'.$id.'" data-share-type="dir">取消公開資料夾</a>';
    } else {
        echo '<a href="#" class="btn btn-info disabled">分享</a>';
        echo '<a href="#" class="btn btn-cos sharefile" data-share-id="'.$id.'" data-share-type="dir" >公開資料夾</a>';
    }
}
function sharefile($share, $id, $secret)
{
    if ($share == '1') {
        /* Decode Password */
        $passphrase['b'] = $_SESSION['password'];
        $passphrase['c'] = $secret;
        $iv = md5("\x1B\x3C\x58".$passphrase['b'], true).md5("\x1B\x3C\x58".$passphrase['b'], true);
        $key = substr(md5("\x2D\xFC\xD8".$passphrase['b'], true).md5("\x2D\xFC\xD9".$passphrase['b'], true), 0, 24);
        $passphrase['a'] = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($passphrase['c']), MCRYPT_MODE_CBC, $iv), "\0\3");

        echo '<a href="downfile.php?id='.$id.'&password='.$passphrase['a'].'" target="_blank" class="btn btn-default">分享</a>';
        echo '<a href="#" class="btn btn-cos sharefile" data-share-id="'.$id.'" data-share-type="file">取消公開檔案</a>';
    } else {
        echo '<a href="#" class="btn btn-default disabled">分享</a>';
        echo '<a href="#" class="btn btn-cos sharefile" data-share-id="'.$id.'" data-share-type="file">公開檔案</a>';
    }
}
function fileformat($type, $name)
{
    if (preg_match("/image\/(.*)/i", $type)) {
        echo strtoupper(str_replace('image/', '', $type)).' 圖檔';
    } elseif (preg_match("/audio\/(.*)/i", $type)) {
        echo strtoupper(str_replace('audio/', '', $type)).' 音樂檔';
    } elseif (preg_match("/video\/(.*)/i", $type)) {
        echo strtoupper(str_replace('vedio/', '', $type)).' 影片檔';
    } elseif (preg_match("/text\/(.*)/i", $type)) {
        echo '純文字檔';
    } elseif ($type == 'application/msword' || $type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
        echo 'MS Office Word';
    } elseif ($type == 'application/vnd.ms-excel' || $type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
        echo 'MS Office Excel';
    } elseif ($type == 'application/vnd.ms-powerpoint' || $type == 'application/vnd.openxmlformats-officedocument.presentationml.presentation') {
        echo 'MS Office Powerpoint';
    } elseif ($type == 'application/x-bzip2' || $type == 'application/x-gzip' || $type == 'application/x-7z-compressed' || $type == 'application/x-rar-compressed' || $type == 'application/zip' || $type == 'application/x-apple-diskimage' || $type == 'application/x-tar') {
        echo '壓縮檔';
    } else {
        echo strtoupper(substr($name, -(strlen($name) - strrpos($name, '.') - 1))).'檔';
    }
}

function fileicon($type, $name)
{
    if (preg_match("/image\/(.*)/i", $type)) {
        echo '<i class="fa fa-file-image-o fa-4x"></i>';
    } elseif (preg_match("/audio\/(.*)/i", $type)) {
        echo '<i class="fa fa-file-sound-o fa-4x"></i>';
    } elseif (preg_match("/video\/(.*)/i", $type)) {
        echo '<i class="fa fa-file-movie-o fa-4x"></i>';
    } elseif (preg_match("/text\/(.*)/i", $type)) {
        echo '<i class="fa fa-file-text-o fa-4x"></i>';
    } elseif ($type == 'application/msword' || $type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
        echo '<i class="fa fa-file-word-o fa-4x"></i>';
    } elseif ($type == 'application/vnd.ms-excel' || $type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
        echo '<i class="fa fa-file-excel-o fa-4x"></i>';
    } elseif ($type == 'application/vnd.ms-powerpoint' || $type == 'application/vnd.openxmlformats-officedocument.presentationml.presentation') {
        echo '<i class="fa fa-file-powerpoint-o fa-4x"></i>';
    } elseif ($type == 'application/x-bzip2' || $type == 'application/x-gzip' || $type == 'application/x-7z-compressed' || $type == 'application/x-rar-compressed' || $type == 'application/zip' || $type == 'application/x-apple-diskimage' || $type == 'application/x-tar') {
        echo '<i class="fa fa-file-zip-o fa-4x"></i>';
    } else {
        echo '<i class="fa fa-file-o fa-4x">';
    }
}

function dirsize($id)
{
    $total = 0;
    foreach ($GLOBALS['db']->select('file', array('owner' => $_SESSION['username'], 'dir' => $id, 'recycle' => '0')) as $d) {
        $total += $d['size'];
    }
    foreach ($GLOBALS['db']->select('dir', array('owner' => $_SESSION['username'], 'parent' => $id, 'recycle' => '0')) as $d) {
        $total += dirsize($d['id']);
    }

    return $total;
}
$filecheck = $db->select('file', array('owner' => $_SESSION['username'], 'dir' => $_SESSION['dir'], 'recycle' => '0'));
$dircheck = $db->select('dir', array('owner' => $_SESSION['username'], 'parent' => $_SESSION['dir'], 'recycle' => '0'));
if ($filecheck[0]['id'] == null && $dircheck[0]['id'] == null) {
    echo '<div class="alert alert-info" style="margin-top: 80px;">您沒有任何檔案，去上傳一個吧！</div>';
} else {
    ?>
<?php echo '<div class="row">';
    if ($dircheck[0][ 'id'] != null) {
        foreach ($db->select('dir', array('owner' => $_SESSION['username'], 'parent' => $_SESSION['dir'], 'recycle' => '0')) as $d) {
            ?>
<div class="col-lg-3 col-md-4 col-sm-6">
	<div class="panel" data-id="<?php echo $d['id'];
            ?>" data-type="dir" data-download-url="home.php?dir=<?php echo $d['id'];
            ?>">
		<div>
            <div class="panel-body"><i class="fa fa-4x fa-fw fa-folder"></i>
            </div>
			<div class="panel-footer <?php if ($d['color'] != '') {
    echo 'tag-'.$d['color'];
}
            ?>">
				<span><?php echo $d[ 'name'];
            ?></span>
			</div>
            <div class="file-action" style="display: none;">
                <a href="home.php?dir=<?php echo $d['id'];
            ?>" class="btn btn-default">開啟</a>
                <a href="ajax_recycle_dir.php" data-dir-delete-id="<?php echo $d['id'];
            ?>" class="btn btn-danger">刪除</a>
                <a href="ajax_rename_dir.php" data-dir-rename-id="<?php echo $d['id'];
            ?>" class="btn btn-cos">重新命名</a>
                <a href="ajax_move_dir.php" data-dir-move-id="<?php echo $d['id'];
            ?>" class="btn btn-success">移動</a>
                <?php @sharedir($d['share'], $d['id']);
            ?>
                <a href="ajax_set_color" data-dir-color-id="<?php echo $d['id'];
            ?>" class="btn btn-primary">標記</a>
            </div>
		</div>
	</div>
</div>
<?php 
        }
    }
    echo '</div><div class="row">';
    if ($filecheck[0][ 'id'] != null) {
        foreach ($db->select('file', array('owner' => $_SESSION['username'], 'dir' => $_SESSION['dir'], 'recycle' => '0')) as $d) {
            ?>
<div class="col-lg-3 col-md-4 col-sm-6">
	<div class="panel" data-id="<?php echo $d['id'];
            ?>" data-type="file" data-download-url="downfile.php?id=<?php echo $d['id'];
            ?>&download=true">
		<div class="panel-body"><?php fileicon($d['type'], $d['name']);
            ?></i>
		</div>
		<div class="panel-footer<?php if ($d['color'] != '') {
    echo ' tag-'.$d['color'];
}
            ?>"><?php echo $d[ 'name'];
            ?></div>
        <div class="file-action" style="display: none;">
            <?php @sharefile($d['share'], $d['id'], $d['secret']);
            ?>
            <?php @linkcheck($d['type'], $d['id'], $d['name'], $d['secret']);
            ?>
            <a href="ajax_recycle.php" data-delete-id="<?php echo $d['id'];
            ?>" class="btn btn-danger">刪除</a>
            <a href="ajax_rename.php" data-rename-id="<?php echo $d['id'];
            ?>" class="btn btn-primary">重新命名</a>
            <a href="ajax_move.php" data-move-id="<?php echo $d['id'];
            ?>" class="btn btn-success">移動</a>
            <?php @previewcheck($d['type'], $d['id']);
            ?>
            <a href="ajax_set_color" data-color-id="<?php echo $d['id'];
            ?>" class="btn btn-cos">標記</a>
        </div>
	</div>
</div>
<?php 
        }
    }
    echo '</div>';
}
exit();
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}
function scan_dir($location)
{
    $output = '<nav class="dir_tree">';
    foreach ($GLOBALS['db']->select('dir', array('parent' => $location, 'owner' => $_SESSION['username'], 'recycle' => '0')) as $d) {
        $sdir = $GLOBALS['db']->select('dir', array('parent' => $d['id'], 'owner' => $_SESSION['username'], 'recycle' => '0'));
        if ($sdir[0]['id'] != null) {
            $output .= '<li><i class="fa fa-folder"></i> 
                        <a href="#" data-id="'.$d['id'].'" class="filetreeselector">'.$d['name'].'</a>
                        <ul data-parent="'.$d['id'].'">'.scan_dir($d['id']).'</ul></li>';
        } else {
            $output .= '<li><i class="fa fa-folder"></i> <a class="filetreeselector" href="#" data-id="'.$d['id'].'" >'.$d['name'].'</a></li>';
        }
    }
    $output .= '</nav>';

    return $output;
}
if ($_SESSION['login']) {
    $output = scan_dir('0');
    echo json_encode(array(array(
        'content' => $output,
    )));
} else {
    echo json_encode(array(
        'content' => '您尚未登入',
    ));
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}
function scan_dir($location)
{
    $output = '';
    foreach ($GLOBALS['db']->select('dir', array('parent' => $location, 'owner' => $_SESSION['username'], 'recycle' => '0')) as $d) {
        $sdir = $GLOBALS['db']->select('dir', array('parent' => $d['id'], 'owner' => $_SESSION['username'], 'recycle' => '0'));
        if ($sdir[0]['id'] != null) {
            $output .= '<li><span class="tree-indicator"><i class="ion-ios7-minus-empty"></i></span>
                        <a href="#" class="filetreeselector" data-id="'.$d['id'].'">'.$d['name'].'</a>
                        <ul class="dir-tree" data-parent="'.$d['id'].'">'.scan_dir($d['id']).'</ul></li>';
        } else {
            $output .= '<li><a href="#" class="filetreeselector" data-id="'.$d['id'].'" >'.$d['name'].'</a></li>';
        }
    }

    return $output;
}
if ($_SESSION['login']) {
    $output = scan_dir('0');
    echo json_encode(array(array(
        'content' => $output,
    )));
} else {
    echo json_encode(array(
        'content' => '您尚未登入',
    ));
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/

@set_time_limit(20);

include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}
function sizecount($size)
{
    if ($size < 0.001) {
        return round(($size * 1000 * 1000), 2).'B';
    } elseif ($size >= 0.001 && $size < 1) {
        return round(($size * 1000), 2).'KB';
    } elseif ($size >= 1 && $size < 1000) {
        return round($size, 2).'MB';
    } elseif ($size >= 1000) {
        return round(($size / 1000), 2).'GB';
    }
}
function create_used_bar()
{
    global $config;
    $audio = 0;
    $video = 0;
    $image = 0;
    $other = 0;
    $used = 0;
    $res = $GLOBALS['db']->select('file', array('owner' => $_SESSION['username']));
    if ($res[0]['id'] != null) {
        foreach ($res as $d) {
            $used += $d['size'];

            if (preg_match("/image\/(.*)/i", $d['type'])) {
                $image += $d['size'];
            } elseif (preg_match("/audio\/(.*)/i", $d['type'])) {
                $audio += $d['size'];
            } elseif (preg_match("/video\/(.*)/i", $d['type'])) {
                $video += $d['size'];
            } else {
                $other += $d['size'];
            }
        }
    }
    if ($config['total'] != 0) {
        $output = '<div class="progress">';
        $used_list = '<ul class="list-unstyled">';
        if ($audio != 0) {
            $output .= '<div class="progress-bar progress-bar-success"  role="progressbar" style="width:'.round(($audio / 1000 / 1000 / $config['total'] * 100), 1).'%;"></div>';
            $used_list .= '<li class="text-success">音樂： '.sizecount(($audio / 1000 / 1000)).' ( '.round(($audio / 1000 / 1000 / $config['total'] * 100), 1).'% )</li>';
        } else {
            $used_list .= '<li class="text-success">音樂： 0MB ( 0% )</li>';
        }
        if ($video != 0) {
            $output .= '<div class="progress-bar progress-bar-info"  role="progressbar" style="width:'.round(($video / 1000 / 1000 / $config['total'] * 100), 1).'%;"></div>';
            $used_list .= '<li class="text-info">影片： '.sizecount(($video / 1000 / 1000)).' ( '.round(($video / 1000 / 1000 / $config['total'] * 100), 1).'% )</li>';
        } else {
            $used_list .= '<li class="text-info">影片： 0MB ( 0% )</li>';
        }
        if ($image != 0) {
            $output .= '<div class="progress-bar progress-bar-warning"  role="progressbar" style="width:'.round(($image / 1000 / 1000 / $config['total'] * 100), 1).'%;"></div>';
            $used_list .= '<li class="text-warning">照片： '.sizecount(($image / 1000 / 1000)).' ( '.round(($image / 1000 / 1000 / $config['total'] * 100), 1).'% )</li>';
        } else {
            $used_list .= '<li class="text-warning">照片： 0MB ( 0% )</li>';
        }
        if ($other != 0) {
            $output .= '<div class="progress-bar"  role="progressbar" style="width:'.round(($other / 1000 / 1000 / $config['total'] * 100), 1).'%; background-color: #666666;"></div>';
            $used_list .= '<li>其他： '.sizecount(($other / 1000 / 1000)).' ( '.round(($other / 1000 / 1000 / $config['total'] * 100), 1).'% )</li>';
        } else {
            $used_list .= '<li>其他： 0MB ( 0% )</li>';
        }
        $output .= '</div>';
        $output .= '<p>已經使用'.sizecount($config['total']).'中的'.sizecount(($used / 1000 / 1000)).' ( '.round($used / 1000 / 1000 / $config['total'] * 100, 2).'% )</p>';
        $used_list .= '</ul>';
    } else {
        $output = '<p><br/>已經使用'.sizecount(($used / 1000 / 1000)).'</p>';
        $used_list = '<ul class="list-unstyled">';
        if ($audio != 0) {
            $used_list .= '<li class="text-success">音樂： '.sizecount(($audio / 1000 / 1000)).'</li>';
        } else {
            $used_list .= '<li class="text-success">音樂： 0MB</li>';
        }
        if ($video != 0) {
            $used_list .= '<li class="text-info">影片： '.sizecount(($video / 1000 / 1000)).'</li>';
        } else {
            $used_list .= '<li class="text-info">影片： 0MB</li>';
        }
        if ($image != 0) {
            $used_list .= '<li class="text-warning">照片： '.sizecount(($image / 1000 / 1000)).'</li>';
        } else {
            $used_list .= '<li class="text-warning">照片： 0MB</li>';
        }
        if ($other != 0) {
            $used_list .= '<li>其他： '.sizecount(($other / 1000 / 1000)).'</li>';
        } else {
            $used_list .= '<li>其他： 0MB</li>';
        }
        $output .= '</div>';
        $used_list .= '</ul>';
    }
    echo $output.$used_list;
}

create_used_bar();
exit();
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}

$res = $db->select('file', array('id' => $_GET['id']));

if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner']) {
    $result = $db->update('file', array('dir' => $_GET['dir']), array('id' => $_GET['id']));
    echo json_encode(array(
        'success' => $result,
        'message' => $result ? '成功移動檔案。' : '移動失敗。',
    ));
    $token = @touch(dirname(dirname(__FILE__)).'/updatetoken/'.md5($_SESSION['username']).'.token');
} else {
    echo json_encode(array(
        'success' => false,
        'message' => '你不是檔案的擁有者。',
    ));
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}
$res = $GLOBALS['db']->select('dir', array('id' => $_GET['id']));
if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner'] && isset($_GET['dir'])  && isset($_GET['id'])) {
    $result = $GLOBALS['db']->update('dir', array('parent' => $_GET['dir']), array('id' => $_GET['id']));
    echo json_encode(array(
        'success' => $result,
        'message' => $result ? '成功移動。' : '移動失敗。',
    ));
    $token = @touch(dirname(dirname(__FILE__)).'/updatetoken/'.md5($_SESSION['username']).'.token');
} else {
    echo json_encode(array(
        'success' => false,
        'message' => '你不是資料夾的擁有者。',
    ));
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
@set_time_limit(0);
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}
$data = $_SESSION['username'];
$time = time();
session_write_close();

while (true) {
    clearstatcache();

    if ((time() - $time) >= 20) {
        break;
    }

    if (file_exists(dirname(dirname(__FILE__)).'/updatetoken/'.md5($data).'.token')) {
        unlink(dirname(dirname(__FILE__)).'/updatetoken/'.md5($data).'.token');
        echo 'updatenow';
        @ob_flush();
        flush();
        break;
    } else {
        sleep(1);
    }
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}

$res = $db->select('file', array('id' => $_GET['id']));

if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner']) {
    $result = $db->update('file', array('recycle' => '1'), array('id' => $_GET['id']));

    echo json_encode(array(
        'success' => $result,
        'message' => $result ? '成功刪除檔案。' : '刪除檔案失敗。',
    ));
    $token = @touch(dirname(dirname(__FILE__)).'/updatetoken/'.md5($_SESSION['username']).'.token');
} else {
    echo json_encode(array(
        'success' => false,
        'message' => '你不是檔案的擁有者。',
    ));
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}

$res = $db->select('file', array('id' => $_GET['id']));

if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner']) {
    $result = $db->update('file', array('recycle' => '0'), array('id' => $_GET['id']));

    echo json_encode(array(
        'success' => $result,
        'message' => $result ? '成功還原檔案。' : '還原檔案失敗。',
    ));
    $token = @touch(dirname(dirname(__FILE__)).'/updatetoken/'.md5($_SESSION['username']).'.token');
} else {
    echo json_encode(array(
        'success' => false,
        'message' => '你不是檔案的擁有者。',
    ));
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}
function back_dir($id)
{
    $result = true;
    $file_list = $GLOBALS['db']->select('file', array('owner' => $_SESSION['username'], 'dir' => $id));
    if (is_array($file_list)) {
        foreach ($file_list as $k) {
            $result = $GLOBALS['db']->update('file', array('recycle' => '0'), array('id' => $k['id']));
        }
    }
    $result = $GLOBALS['db']->update('dir', array('recycle' => '0'), array('id' => $id));

    return $result;
}
function scan_dir($id)
{
    $result = true;
    $file_list = $GLOBALS['db']->select('dir', array('owner' => $_SESSION['username'], 'parent' => $id));
    if (is_array($file_list)) {
        foreach ($file_list as $d) {
            $result = scan_dir($d['id']);
        }
    }
    $result = back_dir($id);

    return $result;
}
$res = $GLOBALS['db']->select('dir', array('id' => $_GET['id']));
if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner']) {
    $result = scan_dir($_GET['id']);
    echo json_encode(array(
        'success' => $result,
        'message' => $result ? '成功還原' : '還原失敗。',
    ));
} else {
    echo json_encode(array(
        'success' => false,
        'message' => '你不是資料夾的擁有者。',
    ));
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}
function delete_dir($id)
{
    $result = true;
    $file_list = $GLOBALS['db']->select('file', array('owner' => $_SESSION['username'], 'dir' => $id));
    if (is_array($file_list)) {
        foreach ($file_list as $k) {
            $result = $GLOBALS['db']->update('file', array('recycle' => '1'), array('id' => $k['id']));
        }
    }
    $result = $GLOBALS['db']->update('dir', array('recycle' => '1'), array('id' => $id));

    return $result;
}
function scan_dir($id)
{
    $result = true;
    $file_list = $GLOBALS['db']->select('dir', array('owner' => $_SESSION['username'], 'parent' => $id));
    if (is_array($file_list)) {
        foreach ($file_list as $d) {
            $result = scan_dir($d['id']);
        }
    }

    $result = delete_dir($id);

    return $result;
}
$res = $GLOBALS['db']->select('dir', array('id' => $_GET['id']));
if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner']) {
    $result = scan_dir($_GET['id']);
    echo json_encode(array(
        'success' => $result,
        'message' => $result ? '成功刪除。' : '刪除失敗。',
    ));
    $token = @touch(dirname(dirname(__FILE__)).'/updatetoken/'.md5($_SESSION['username']).'.token');
} else {
    echo json_encode(array(
        'success' => false,
        'message' => '你不是資料夾的擁有者。',
    ));
}
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
@set_time_limit(20);
if (!session_id()) {
    session_start();
}
function fileformat($type, $name)
{
    if (preg_match("/image\/(.*)/i", $type)) {
        echo strtoupper(str_replace('image/', '', $type)).' 圖檔';
    } elseif (preg_match("/audio\/(.*)/i", $type)) {
        echo strtoupper(str_replace('audio/', '', $type)).' 音樂檔';
    } elseif (preg_match("/video\/(.*)/i", $type)) {
        echo strtoupper(str_replace('vedio/', '', $type)).' 影片檔';
    } elseif (preg_match("/text\/(.*)/i", $type)) {
        echo '純文字檔';
    } elseif ($type == 'application/msword' || $type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
        echo 'MS Office Word';
    } elseif ($type == 'application/vnd.ms-excel' || $type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
        echo 'MS Office Excel';
    } elseif ($type == 'application/vnd.ms-powerpoint' || $type == 'application/vnd.openxmlformats-officedocument.presentationml.presentation') {
        echo 'MS Office Powerpoint';
    } elseif ($type == 'application/x-bzip2' || $type == 'application/x-gzip' || $type == 'application/x-7z-compressed' || $type == 'application/x-rar-compressed' || $type == 'application/zip' || $type == 'application/x-apple-diskimage' || $type == 'application/x-tar') {
        echo '壓縮檔';
    } else {
        echo strtoupper(substr($name, -(strlen($name) - strrpos($name, '.') - 1))).'檔';
    }
}

$res = $db->select('file', array('owner' => $_SESSION['username'], 'recycle' => '1'));
if ($res[0]['id'] != null) {
    foreach ($res as $d) {
        if ($d['dir'] != 0) {
            $ordir = $db->select('dir', array('id' => $d['dir']));
            if ($ordir[0]['recycle'] == 1) {
                continue;
            }
            $ordir = $ordir[0]['name'];
        } else {
            $ordir = '主目錄';
        }
        ?>
        <tr>
            <td><?php echo $d['name'];
        ?></td>
            <td><?php echo fileformat($d['type'], $d['name']);
        ?></td>
            <td><?php echo $ordir;
        ?></td>
            <td>
                <div class="btn-group">
                    <a href="#"  data-id="<?php echo $d['id'] ?>" data-type="file" class="btn btn-default recycle_back">還原</a>
                    <a href="#"  data-id="<?php echo $d['id'] ?>" data-type="file" class="btn btn-danger real_delete">永久刪除</a>
                </div>
            </td>
        </tr>
<?php 
    }
}
$res = $db->select('dir', array('owner' => $_SESSION['username'], 'recycle' => '1'));
if ($res[0]['id'] != null) {
    foreach ($res as $d) {
        if ($d['parent'] != 0) {
            $ordir = $db->select('dir', array('id' => $d['parent']));
            if ($ordir[0]['recycle'] == 1) {
                continue;
            }
            $ordir = $ordir[0]['name'];
        } else {
            $ordir = '主目錄';
        }
        ?>
        <tr>
            <td><?php echo $d['name'];
        ?></td>
            <td>資料夾</td>
            <td><?php echo $ordir;
        ?></td>
            <td>
                <div class="btn-group">
                    <a href="#"  data-id="<?php echo $d['id'] ?>" data-type="dir" class="btn btn-default recycle_back">還原</a>
                    <a href="#"  data-id="<?php echo $d['id'] ?>" data-type="dir" class="btn btn-danger real_delete">永久刪除</a>
                </div>
            </td>
        </tr>
<?php 
    }
}
exit();
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}

$res = $db->select('file', array('id' => $_GET['id']));

if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner']) {
    $result = $db->update('file', array('name' => $_GET['name']), array('id' => $_GET['id']));

    echo json_encode(array(
        'success' => $result,
        'message' => $result ? '成功重新命名檔案。' : '重新命名檔案失敗。',
    ));
    $token = @touch(dirname(dirname(__FILE__)).'/updatetoken/'.md5($_SESSION['username']).'.token');
} else {
    echo json_encode(array(
        'success' => false,
        'message' => '你不是檔案的擁有者。',
    ));
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}
$res = $db->select('dir', array('id' => $_GET['id']));

if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner']) {
    $result = $db->update('dir', array('name' => $_GET['name']), array('id' => $_GET['id']));
    echo json_encode(array(
        'success' => $result,
        'message' => $result ? '成功重新命名資料夾。' : '重新命名失敗。',
    ));
    $token = @touch(dirname(dirname(__FILE__)).'/updatetoken/'.md5($_SESSION['username']).'.token');
} else {
    echo json_encode(array(
        'success' => false,
        'message' => '你不是資料夾的擁有者。',
    ));
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}

if ($_GET['type'] == 'dir') {
    $res = $db->select('dir', array('id' => $_GET['id']));
} elseif ($_GET['type'] == 'file') {
    $res = $db->select('file', array('id' => $_GET['id']));
}
if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner']) {
    if ($_GET['type'] == 'dir') {
        $result = $db->update('dir', array('color' => $_GET['color']), array('id' => $_GET['id']));
    } elseif ($_GET['type'] == 'file') {
        $result = $db->update('file', array('color' => $_GET['color']), array('id' => $_GET['id']));
    }
    echo json_encode(array(
        'success' => $result,
        'message' => $result ? '成功標記檔案。' : '標記檔案失敗。',
    ));
    $token = @touch(dirname(dirname(__FILE__)).'/updatetoken/'.md5($_SESSION['username']).'.token');
} else {
    echo json_encode(array(
        'success' => false,
        'message' => '你不是檔案的擁有者。',
    ));
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include dirname(dirname(__FILE__)).'/config.php';
if (!session_id()) {
    session_start();
}
function scan_dir($id, $per)
{
    $result = true;
    foreach ($GLOBALS['db']->select('dir', array('parent' => $id)) as $k) {
        $result = $GLOBALS['db']->update('dir', array('share' => $per), array('id' => $k['id']));
        $result = scan_dir($k['id'], $per);
    }
    foreach ($GLOBALS['db']->select('file', array('dir' => $id)) as $d) {
        $result = $GLOBALS['db']->update('file', array('share' => $per), array('id' => $d['id']));
    }

    return $result;
}
$res = $db->select($_GET['type'], array('id' => $_GET['id'], 'recycle' => '0'));
if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner']) {
    if ($res[0]['share'] == '0') {
        $per = '1';
    } else {
        $per = '0';
    }
    if ($_GET['type'] == 'dir') {
        $db->update('dir', array('share' => $per), array('id' => $_GET['id']));
        $result = scan_dir($_GET['id'], $per);
    } else {
        $result = $db->update('file', array('share' => $per), array('id' => $_GET['id']));
    }
    echo json_encode(array(
        'success' => $result,
        'message' => $result ? '成功修改檔案權限。' : '修改檔案權限失敗。',
    ));
    $token = @touch(dirname(dirname(__FILE__)).'/updatetoken/'.md5($_SESSION['username']).'.token');
} else {
    echo json_encode(array(
        'success' => false,
        'message' => '你不是檔案的擁有者。',
    ));
}
# A simple PHP CAPTCHA script

_Copyright 2011 Cory LaViska for A Beautiful Site, LLC. (http://abeautifulsite.net/)_

_Licensed under the MIT license: http://opensource.org/licenses/MIT_

## Demo and Usage

http://labs.abeautifulsite.net/simple-php-captcha/

## Attribution

 - Special thanks to Subtle Patterns for the patterns used for default backgrounds: http://subtlepatterns.com/
 - Special thanks to dafont.com for providing Times New Yorker: http://www.dafont.com/
<?php
require_once(dirname(dirname(__FILE__)).'/config.php');

//
//  A simple PHP CAPTCHA script
//
//  Copyright 2013 by Cory LaViska for A Beautiful Site, LLC
//
//  See readme.md for usage, demo, and licensing info
//
function simple_php_captcha($config = array())
{

    // Check for GD library
    if (!function_exists('gd_info')) {
        throw new Exception('Required GD library is missing');
    }

    $bg_path = dirname(__FILE__).'/backgrounds/';
    $font_path = dirname(__FILE__).'/fonts/';

    // Default values
    $captcha_config = array(
        'code' => '',
        'min_length' => 5,
        'max_length' => 5,
        'backgrounds' => array(
            $bg_path.'45-degree-fabric.png',
            $bg_path.'cloth-alike.png',
            $bg_path.'grey-sandbag.png',
            $bg_path.'kinda-jean.png',
            $bg_path.'polyester-lite.png',
            $bg_path.'stitched-wool.png',
            $bg_path.'white-carbon.png',
            $bg_path.'white-wave.png',
        ),
        'fonts' => array(
            $font_path.'times_new_yorker.ttf',
        ),
        'characters' => 'ABCDEFGHJKLMNPRSTUVWXYZabcdefghjkmnprstuvwxyz23456789',
        'min_font_size' => 28,
        'max_font_size' => 28,
        'color' => '#666',
        'angle_min' => 0,
        'angle_max' => 10,
        'shadow' => true,
        'shadow_color' => '#fff',
        'shadow_offset_x' => -1,
        'shadow_offset_y' => 1,
    );

    // Overwrite defaults with custom config values
    if (is_array($config)) {
        foreach ($config as $key => $value) {
            $captcha_config[$key] = $value;
        }
    }

    // Restrict certain values
    if ($captcha_config['min_length'] < 1) {
        $captcha_config['min_length'] = 1;
    }
    if ($captcha_config['angle_min'] < 0) {
        $captcha_config['angle_min'] = 0;
    }
    if ($captcha_config['angle_max'] > 10) {
        $captcha_config['angle_max'] = 10;
    }
    if ($captcha_config['angle_max'] < $captcha_config['angle_min']) {
        $captcha_config['angle_max'] = $captcha_config['angle_min'];
    }
    if ($captcha_config['min_font_size'] < 10) {
        $captcha_config['min_font_size'] = 10;
    }
    if ($captcha_config['max_font_size'] < $captcha_config['min_font_size']) {
        $captcha_config['max_font_size'] = $captcha_config['min_font_size'];
    }

    // Use milliseconds instead of seconds
    srand(microtime() * 100);

    // Generate CAPTCHA code if not set by user
    if (empty($captcha_config['code'])) {
        $captcha_config['code'] = '';
        $length = rand($captcha_config['min_length'], $captcha_config['max_length']);
        while (strlen($captcha_config['code']) < $length) {
            $captcha_config['code'] .= substr($captcha_config['characters'], rand() % (strlen($captcha_config['characters'])), 1);
        }
    }

    // Generate HTML for image src
    $image_src = substr(__FILE__, strlen(realpath($_SERVER['DOCUMENT_ROOT']))).'?_CAPTCHA&amp;t='.urlencode(microtime());
    $image_src = '/'.ltrim(preg_replace('/\\\\/', '/', $image_src), '/');

    $_SESSION['_CAPTCHA']['config'] = serialize($captcha_config);

    return array(
        'code' => $captcha_config['code'],
        'image_src' => $image_src,
    );
}

if (!function_exists('hex2rgb')) {
    function hex2rgb($hex_str, $return_string = false, $separator = ',')
    {
        $hex_str = preg_replace('/[^0-9A-Fa-f]/', '', $hex_str); // Gets a proper hex string
        $rgb_array = array();
        if (strlen($hex_str) == 6) {
            $color_val = hexdec($hex_str);
            $rgb_array['r'] = 0xFF & ($color_val >> 0x10);
            $rgb_array['g'] = 0xFF & ($color_val >> 0x8);
            $rgb_array['b'] = 0xFF & $color_val;
        } elseif (strlen($hex_str) == 3) {
            $rgb_array['r'] = hexdec(str_repeat(substr($hex_str, 0, 1), 2));
            $rgb_array['g'] = hexdec(str_repeat(substr($hex_str, 1, 1), 2));
            $rgb_array['b'] = hexdec(str_repeat(substr($hex_str, 2, 1), 2));
        } else {
            return false;
        }

        return $return_string ? implode($separator, $rgb_array) : $rgb_array;
    }
}

// Draw the image
if (isset($_GET['_CAPTCHA'])) {
    session_start();

    $captcha_config = unserialize($_SESSION['_CAPTCHA']['config']);
    if (!$captcha_config) {
        exit();
    }

    unset($_SESSION['_CAPTCHA']);

    // Use milliseconds instead of seconds
    srand(microtime() * 100);

    // Pick random background, get info, and start captcha
    $background = $captcha_config['backgrounds'][rand(0, count($captcha_config['backgrounds']) - 1)];
    list($bg_width, $bg_height, $bg_type, $bg_attr) = getimagesize($background);

    $captcha = imagecreatefrompng($background);

    $color = hex2rgb($captcha_config['color']);
    $color = imagecolorallocate($captcha, $color['r'], $color['g'], $color['b']);

    // Determine text angle
    $angle = rand($captcha_config['angle_min'], $captcha_config['angle_max']) * (rand(0, 1) == 1 ? -1 : 1);

    // Select font randomly
    $font = $captcha_config['fonts'][rand(0, count($captcha_config['fonts']) - 1)];

    // Verify font file exists
    if (!file_exists($font)) {
        throw new Exception('Font file not found: '.$font);
    }

    //Set the font size.
    $font_size = rand($captcha_config['min_font_size'], $captcha_config['max_font_size']);
    $text_box_size = imagettfbbox($font_size, $angle, $font, $captcha_config['code']);

    // Determine text position
    $box_width = abs($text_box_size[6] - $text_box_size[2]);
    $box_height = abs($text_box_size[5] - $text_box_size[1]);
    $text_pos_x_min = 0;
    $text_pos_x_max = ($bg_width) - ($box_width);
    $text_pos_x = rand($text_pos_x_min, $text_pos_x_max);
    $text_pos_y_min = $box_height;
    $text_pos_y_max = ($bg_height) - ($box_height / 2);
    $text_pos_y = rand($text_pos_y_min, $text_pos_y_max);

    // Draw shadow
    if ($captcha_config['shadow']) {
        $shadow_color = hex2rgb($captcha_config['shadow_color']);
        $shadow_color = imagecolorallocate($captcha, $shadow_color['r'], $shadow_color['g'], $shadow_color['b']);
        imagettftext($captcha, $font_size, $angle, $text_pos_x + $captcha_config['shadow_offset_x'], $text_pos_y + $captcha_config['shadow_offset_y'], $shadow_color, $font, $captcha_config['code']);
    }

    // Draw text
    imagettftext($captcha, $font_size, $angle, $text_pos_x, $text_pos_y, $color, $font, $captcha_config['code']);

    // Output image
    header('Content-type: image/png');
    imagepng($captcha);
}
<?php

/**
 * A Compatibility library with PHP 5.5's simplified password hashing API.
 *
 * @author Anthony Ferrara <ircmaxell@php.net>
 * @license http://www.opensource.org/licenses/mit-license.html MIT License
 * @copyright 2012 The Authors
 */
namespace {

    if (!defined('PASSWORD_BCRYPT')) {
        /*
         * PHPUnit Process isolation caches constants, but not function declarations.
         * So we need to check if the constants are defined separately from 
         * the functions to enable supporting process isolation in userland
         * code.
         */
        define('PASSWORD_BCRYPT', 1);
        define('PASSWORD_DEFAULT', PASSWORD_BCRYPT);
        define('PASSWORD_BCRYPT_DEFAULT_COST', 10);
    }

    if (!function_exists('password_hash')) {

        /**
         * Hash the password using the specified algorithm.
         *
         * @param string $password The password to hash
         * @param int    $algo     The algorithm to use (Defined by PASSWORD_* constants)
         * @param array  $options  The options for the algorithm to use
         *
         * @return string|false The hashed password, or false on error.
         */
        function password_hash($password, $algo, array $options = array())
        {
            if (!function_exists('crypt')) {
                trigger_error('Crypt must be loaded for password_hash to function', E_USER_WARNING);

                return;
            }
            if (is_null($password) || is_int($password)) {
                $password = (string) $password;
            }
            if (!is_string($password)) {
                trigger_error('password_hash(): Password must be a string', E_USER_WARNING);

                return;
            }
            if (!is_int($algo)) {
                trigger_error('password_hash() expects parameter 2 to be long, '.gettype($algo).' given', E_USER_WARNING);

                return;
            }
            $resultLength = 0;
            switch ($algo) {
                case PASSWORD_BCRYPT:
                    $cost = PASSWORD_BCRYPT_DEFAULT_COST;
                    if (isset($options['cost'])) {
                        $cost = (int) $options['cost'];
                        if ($cost < 4 || $cost > 31) {
                            trigger_error(sprintf('password_hash(): Invalid bcrypt cost parameter specified: %d', $cost), E_USER_WARNING);

                            return;
                        }
                    }
                    // The length of salt to generate
                    $raw_salt_len = 16;
                    // The length required in the final serialization
                    $required_salt_len = 22;
                    $hash_format = sprintf('$2y$%02d$', $cost);
                    // The expected length of the final crypt() output
                    $resultLength = 60;
                    break;
                default:
                    trigger_error(sprintf('password_hash(): Unknown password hashing algorithm: %s', $algo), E_USER_WARNING);

                    return;
            }
            $salt_req_encoding = false;
            if (isset($options['salt'])) {
                switch (gettype($options['salt'])) {
                    case 'NULL':
                    case 'boolean':
                    case 'integer':
                    case 'double':
                    case 'string':
                        $salt = (string) $options['salt'];
                        break;
                    case 'object':
                        if (method_exists($options['salt'], '__tostring')) {
                            $salt = (string) $options['salt'];
                            break;
                        }
                    case 'array':
                    case 'resource':
                    default:
                        trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);

                        return;
                }
                if (PasswordCompat\binary\_strlen($salt) < $required_salt_len) {
                    trigger_error(sprintf('password_hash(): Provided salt is too short: %d expecting %d', PasswordCompat\binary\_strlen($salt), $required_salt_len), E_USER_WARNING);

                    return;
                } elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) {
                    $salt_req_encoding = true;
                }
            } else {
                $buffer = '';
                $buffer_valid = false;
                if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) {
                    $buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM);
                    if ($buffer) {
                        $buffer_valid = true;
                    }
                }
                if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {
                    $buffer = openssl_random_pseudo_bytes($raw_salt_len);
                    if ($buffer) {
                        $buffer_valid = true;
                    }
                }
                if (!$buffer_valid && @is_readable('/dev/urandom')) {
                    $file = fopen('/dev/urandom', 'r');
                    $read = PasswordCompat\binary\_strlen($buffer);
                    while ($read < $raw_salt_len) {
                        $buffer .= fread($file, $raw_salt_len - $read);
                        $read = PasswordCompat\binary\_strlen($buffer);
                    }
                    fclose($file);
                    if ($read >= $raw_salt_len) {
                        $buffer_valid = true;
                    }
                }
                if (!$buffer_valid || PasswordCompat\binary\_strlen($buffer) < $raw_salt_len) {
                    $buffer_length = PasswordCompat\binary\_strlen($buffer);
                    for ($i = 0; $i < $raw_salt_len; ++$i) {
                        if ($i < $buffer_length) {
                            $buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));
                        } else {
                            $buffer .= chr(mt_rand(0, 255));
                        }
                    }
                }
                $salt = $buffer;
                $salt_req_encoding = true;
            }
            if ($salt_req_encoding) {
                // encode string with the Base64 variant used by crypt
                $base64_digits =
                    'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
                $bcrypt64_digits =
                    './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';

                $base64_string = base64_encode($salt);
                $salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits);
            }
            $salt = PasswordCompat\binary\_substr($salt, 0, $required_salt_len);

            $hash = $hash_format.$salt;

            $ret = crypt($password, $hash);

            if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != $resultLength) {
                return false;
            }

            return $ret;
        }

        /**
         * Get information about the password hash. Returns an array of the information
         * that was used to generate the password hash.
         *
         * array(
         *    'algo' => 1,
         *    'algoName' => 'bcrypt',
         *    'options' => array(
         *        'cost' => PASSWORD_BCRYPT_DEFAULT_COST,
         *    ),
         * )
         *
         * @param string $hash The password hash to extract info from
         *
         * @return array The array of information about the hash.
         */
        function password_get_info($hash)
        {
            $return = array(
                'algo' => 0,
                'algoName' => 'unknown',
                'options' => array(),
            );
            if (PasswordCompat\binary\_substr($hash, 0, 4) == '$2y$' && PasswordCompat\binary\_strlen($hash) == 60) {
                $return['algo'] = PASSWORD_BCRYPT;
                $return['algoName'] = 'bcrypt';
                list($cost) = sscanf($hash, '$2y$%d$');
                $return['options']['cost'] = $cost;
            }

            return $return;
        }

        /**
         * Determine if the password hash needs to be rehashed according to the options provided.
         *
         * If the answer is true, after validating the password using password_verify, rehash it.
         *
         * @param string $hash    The hash to test
         * @param int    $algo    The algorithm used for new password hashes
         * @param array  $options The options array passed to password_hash
         *
         * @return bool True if the password needs to be rehashed.
         */
        function password_needs_rehash($hash, $algo, array $options = array())
        {
            $info = password_get_info($hash);
            if ($info['algo'] !== (int) $algo) {
                return true;
            }
            switch ($algo) {
                case PASSWORD_BCRYPT:
                    $cost = isset($options['cost']) ? (int) $options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST;
                    if ($cost !== $info['options']['cost']) {
                        return true;
                    }
                    break;
            }

            return false;
        }

        /**
         * Verify a password against a hash using a timing attack resistant approach.
         *
         * @param string $password The password to verify
         * @param string $hash     The hash to verify against
         *
         * @return bool If the password matches the hash
         */
        function password_verify($password, $hash)
        {
            if (!function_exists('crypt')) {
                trigger_error('Crypt must be loaded for password_verify to function', E_USER_WARNING);

                return false;
            }
            $ret = crypt($password, $hash);
            if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != PasswordCompat\binary\_strlen($hash) || PasswordCompat\binary\_strlen($ret) <= 13) {
                return false;
            }

            $status = 0;
            for ($i = 0; $i < PasswordCompat\binary\_strlen($ret); ++$i) {
                $status |= (ord($ret[$i]) ^ ord($hash[$i]));
            }

            return $status === 0;
        }
    }

}

namespace PasswordCompat\binary {

    if (!function_exists('PasswordCompat\\binary\\_strlen')) {

        /**
         * Count the number of bytes in a string.
         *
         * We cannot simply use strlen() for this, because it might be overwritten by the mbstring extension.
         * In this case, strlen() will count the number of *characters* based on the internal encoding. A
         * sequence of bytes might be regarded as a single multibyte character.
         *
         * @param string $binary_string The input string
         *
         * @internal
         *
         * @return int The number of bytes
         */
        function _strlen($binary_string)
        {
            if (function_exists('mb_strlen')) {
                return mb_strlen($binary_string, '8bit');
            }

            return strlen($binary_string);
        }

        /**
         * Get a substring based on byte limits.
         *
         * @see _strlen()
         *
         * @param string $binary_string The input string
         * @param int    $start
         * @param int    $length
         *
         * @internal
         *
         * @return string The substring
         */
        function _substr($binary_string, $start, $length)
        {
            if (function_exists('mb_substr')) {
                return mb_substr($binary_string, $start, $length, '8bit');
            }

            return substr($binary_string, $start, $length);
        }

        /**
         * Check if current PHP version is compatible with the library.
         *
         * @return bool the check result
         */
        function check()
        {
            static $pass = null;

            if (is_null($pass)) {
                if (function_exists('crypt')) {
                    $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG';
                    $test = crypt('password', $hash);
                    $pass = $test == $hash;
                } else {
                    $pass = false;
                }
            }

            return $pass;
        }
    }
}
<?php

class MySQL
{
    public $lastError;
    public $lastQuery;
    public $result;
    public $records;
    public $affected;
    public $rawResults;
    public $arrayedResult;

    public $hostname;
    public $username;
    public $password;
    public $database;

    public $databaseLink;

    public function __construct($database, $username, $password, $hostname = 'localhost')
    {
        $this->database = $database;
        $this->username = $username;
        $this->password = $password;
        $this->hostname = $hostname;

        $this->connect();
    }

    private function connect($persistant = false)
    {
        if ($persistant) {
            $this->databaseLink = new mysqli('p:'.$this->hostname, $this->username, $this->password, $this->database);
        } else {
            $this->databaseLink = new mysqli($this->hostname, $this->username, $this->password, $this->database);
        }

        if ($this->databaseLink->connect_error !== null) {
            $this->lastError = 'Could not connect to server: '.mysqli_error($this->databaseLink);

            return false;
        }

        $this->databaseLink->set_charset('utf8');

        return true;
    }

    public function SecureData($data)
    {
        //Filter for SQL Injection & XSS
        if (is_array($data)) {
            foreach ($data as $key => $val) {
                if (!is_array($data[$key])) {
                    $data[$key] = htmlspecialchars($this->databaseLink->real_escape_string($data[$key]));
                }
            }
        } else {
            $data = htmlspecialchars($this->databaseLink->real_escape_string($data));
        }

        return $data;
    }

    public function ExecuteSQL($query)
    {
        $this->lastQuery = $query;
        if ($this->result = $this->databaseLink->query($query)) {
            if (is_object($this->result)) {
                $this->records = $this->result->num_rows;
                $this->affected = $this->databaseLink->affected_rows;

                if ($this->records > 0) {
                    $this->ArrayResults();

                    return $this->arrayedResult;
                } else {
                    return true;
                }
            } else {
                return $this->result;
            }
        } else {
            $this->lastError = $this->databaseLink->error;

            return false;
        }
    }

    public function Insert($vars, $table, $exclude = '')
    {
        if ($exclude == '') {
            $exclude = array();
        }

        $vars = $this->SecureData($vars);
        $query = "INSERT INTO `{$table}` SET ";

        foreach ($vars as $key => $value) {
            if (in_array($key, $exclude)) {
                continue;
            }

            $query .= "`{$key}` = '{$value}', ";
        }

        $query = substr($query, 0, -2);

        return $this->ExecuteSQL($query);
    }

    public function Delete($table, $where = '', $limit = '', $like = false)
    {
        $query = "DELETE FROM `{$table}` WHERE ";

        if (is_array($where) && $where != '') {
            $where = $this->SecureData($where);
            foreach ($where as $key => $value) {
                if ($like) {
                    $query .= "`{$key}` LIKE '%{$value}%' AND ";
                } else {
                    $query .= "`{$key}` = '{$value}' AND ";
                }
            }

            $query = substr($query, 0, -5);
        }

        if ($limit != '') {
            $query .= ' LIMIT '.$limit;
        }

        return $this->ExecuteSQL($query);
    }

    public function Select($from, $where = '', $orderBy = '', $limit = '', $like = false, $operand = 'AND')
    {
        if (trim($from) == '') {
            return false;
        }

        $query = "SELECT * FROM `{$from}` WHERE ";

        if (is_array($where) && $where != '') {
            $where = $this->SecureData($where);
            foreach ($where as $key => $value) {
                if ($like) {
                    $query .= "`{$key}` LIKE '%{$value}%' {$operand} ";
                } else {
                    $query .= "`{$key}` = '{$value}' {$operand} ";
                }
            }

            $query = substr($query, 0, -5);
        } else {
            $query = substr($query, 0, -7);
        }

        if ($orderBy != '') {
            $query .= ' ORDER BY '.$orderBy;
        }

        if ($limit != '') {
            $query .= ' LIMIT '.$limit;
        }

        return $this->ExecuteSQL($query);
    }

    public function Update($table, $set, $where, $exclude = '')
    {
        if (trim($table) == '' || !is_array($set) || !is_array($where)) {
            return false;
        }

        if ($exclude == '') {
            $exclude = array();
        }

        $set = $this->SecureData($set);
        $where = $this->SecureData($where);
        $query = "UPDATE `{$table}` SET ";

        foreach ($set as $key => $value) {
            if (in_array($key, $exclude)) {
                continue;
            }

            $query .= "`{$key}` = '{$value}', ";
        }

        $query = substr($query, 0, -2);
        $query .= ' WHERE ';

        foreach ($where as $key => $value) {
            $query .= "`{$key}` = '{$value}' AND ";
        }

        $query = substr($query, 0, -5);

        return $this->ExecuteSQL($query);
    }

    public function ArrayResults()
    {
        $this->arrayedResult = array();
        while ($data = $this->result->fetch_assoc()) {
            $this->arrayedResult[] = $data;
        }

        return $this->arrayedResult;
    }
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/

include 'database.php';
error_reporting(0);
//error_reporting(E_ALL);

$sitename = $db->select('setting', array('name' => 'sitename'));
$config['sitename'] = $sitename[0]['value'];

$sitetitle = $db->select('setting', array('name' => 'sitetitle'));
$config['sitetitle'] = $sitetitle[0]['value'];

$size = $db->select('setting', array('name' => 'size'));
$config['size'] = $size[0]['value'];

$url = $db->select('setting', array('name' => 'url'));
$config['url'] = $url[0]['value'];

$total = $db->select('setting', array('name' => 'total'));
$config['total'] = $total[0]['value'];

$subtitle = $db->select('setting', array('name' => 'subtitle'));
$config['subtitle'] = $subtitle[0]['value'];

$reg = $db->select('setting', array('name' => 'reg'));
if ($reg[0]['value'] == 'true') {
    $config['reg'] = true;
} else {
    $config['reg'] = false;
}

$why = $db->select('setting', array('name' => 'why'));
if ($why[0]['value'] == 'true') {
    $config['why'] = true;
} else {
    $config['why'] = false;
}

$tos = $db->select('setting', array('name' => 'tos'));
if ($tos[0]['value'] == 'true') {
    $config['tos'] = true;
} else {
    $config['tos'] = false;
}

/* Session Directory Praser */
//session_set_cookie_params(0, '/' . parse_url($config['url'])['path']);
//setcookie('PHPSESSID',session_id(),0, '/' . parse_url($config['url'])['path']);
//session_name(preg_replace("/[^a-zA-Z0-9]+/", "", $config['url']));
if (!isset($_COOKIE['session_name'])) {
    $session_name = uniqid('allendisk');
    $dir = explode('/', dirname($_SERVER['SCRIPT_NAME']));
    if (end($dir) == 'admin') {
        array_pop($dir);
    }
    setcookie('session_name', $session_name, time() + (60 * 60 * 24 * 5), implode($dir, '/'));
    //$_COOKIE['session_name'] = $session_name;
    session_name($session_name);
} else {
    session_name($_COOKIE['session_name']);
}
@import url("//fonts.googleapis.com/css?family=Roboto:300,400,500,700");/*!
 * bootswatch v3.3.4+1
 * Homepage: http://bootswatch.com
 * Copyright 2012-2015 Thomas Park
 * Licensed under MIT
 * Based on Bootstrap
*//*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,*:before,*:after{background:transparent !important;color:#000 !important;-webkit-box-shadow:none !important;box-shadow:none !important;text-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff !important}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table td,.table th{background-color:#fff !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before,.glyphicon-eur:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:1.846;color:#666666;background-color:#ffffff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#2196f3;text-decoration:none}a:hover,a:focus{color:#0a6ebd;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:3px}.img-thumbnail{padding:4px;line-height:1.846;background-color:#ffffff;border:1px solid #dddddd;border-radius:3px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:23px;margin-bottom:23px;border:0;border-top:1px solid #eeeeee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:400;line-height:1.1;color:#444444}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#bbbbbb}h1,.h1,h2,.h2,h3,.h3{margin-top:23px;margin-bottom:11.5px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:11.5px;margin-bottom:11.5px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:56px}h2,.h2{font-size:45px}h3,.h3{font-size:34px}h4,.h4{font-size:24px}h5,.h5{font-size:20px}h6,.h6{font-size:14px}p{margin:0 0 11.5px}.lead{margin-bottom:23px;font-size:14px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:19.5px}}small,.small{font-size:92%}mark,.mark{background-color:#ffe0b2;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#bbbbbb}.text-primary{color:#2196f3}a.text-primary:hover{color:#0c7cd5}.text-success{color:#4caf50}a.text-success:hover{color:#3d8b40}.text-info{color:#9c27b0}a.text-info:hover{color:#771e86}.text-warning{color:#ff9800}a.text-warning:hover{color:#cc7a00}.text-danger{color:#e51c23}a.text-danger:hover{color:#b9151b}.bg-primary{color:#fff;background-color:#2196f3}a.bg-primary:hover{background-color:#0c7cd5}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#e1bee7}a.bg-info:hover{background-color:#d099d9}.bg-warning{background-color:#ffe0b2}a.bg-warning:hover{background-color:#ffcb7f}.bg-danger{background-color:#f9bdbb}a.bg-danger:hover{background-color:#f5908c}.page-header{padding-bottom:10.5px;margin:46px 0 23px;border-bottom:1px solid #eeeeee}ul,ol{margin-top:0;margin-bottom:11.5px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:23px}dt,dd{line-height:1.846}dt{font-weight:bold}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #bbbbbb}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:11.5px 23px;margin:0 0 23px;font-size:16.25px;border-left:5px solid #eeeeee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.846;color:#bbbbbb}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eeeeee;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:23px;font-style:normal;line-height:1.846}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:3px}kbd{padding:2px 4px;font-size:90%;color:#ffffff;background-color:#333333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}kbd kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:11px;margin:0 0 11.5px;font-size:12px;line-height:1.846;word-break:break-all;word-wrap:break-word;color:#212121;background-color:#f5f5f5;border:1px solid #cccccc;border-radius:3px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0%}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0%}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0%}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0%}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#bbbbbb;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:23px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.846;vertical-align:top;border-top:1px solid #dddddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #dddddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #dddddd}.table .table{background-color:#ffffff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #dddddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #dddddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#e1bee7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#d8abe0}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#ffe0b2}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#ffd699}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f9bdbb}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#f7a6a4}.table-responsive{overflow-x:auto;min-height:0.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:17.25px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #dddddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:23px;font-size:19.5px;line-height:inherit;color:#212121;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:13px;line-height:1.846;color:#666666}.form-control{display:block;width:100%;height:37px;padding:6px 16px;font-size:13px;line-height:1.846;color:#666666;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.form-control::-moz-placeholder{color:#bbbbbb;opacity:1}.form-control:-ms-input-placeholder{color:#bbbbbb}.form-control::-webkit-input-placeholder{color:#bbbbbb}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:transparent;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type="date"],input[type="time"],input[type="datetime-local"],input[type="month"]{line-height:37px}input[type="date"].input-sm,input[type="time"].input-sm,input[type="datetime-local"].input-sm,input[type="month"].input-sm,.input-group-sm input[type="date"],.input-group-sm input[type="time"],.input-group-sm input[type="datetime-local"],.input-group-sm input[type="month"]{line-height:30px}input[type="date"].input-lg,input[type="time"].input-lg,input[type="datetime-local"].input-lg,input[type="month"].input-lg,.input-group-lg input[type="date"],.input-group-lg input[type="time"],.input-group-lg input[type="datetime-local"],.input-group-lg input[type="month"]{line-height:45px}}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:23px;padding-left:20px;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{position:absolute;margin-left:-20px;margin-top:4px \9}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"].disabled,input[type="checkbox"].disabled,fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0;min-height:36px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.form-group-sm .form-control{height:30px;line-height:30px}textarea.form-group-sm .form-control,select[multiple].form-group-sm .form-control{height:auto}.form-group-sm .form-control-static{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;min-height:35px}.input-lg{height:45px;padding:10px 16px;font-size:17px;line-height:1.3333333;border-radius:3px}select.input-lg{height:45px;line-height:45px}textarea.input-lg,select[multiple].input-lg{height:auto}.form-group-lg .form-control{height:45px;padding:10px 16px;font-size:17px;line-height:1.3333333;border-radius:3px}select.form-group-lg .form-control{height:45px;line-height:45px}textarea.form-group-lg .form-control,select[multiple].form-group-lg .form-control{height:auto}.form-group-lg .form-control-static{height:45px;padding:10px 16px;font-size:17px;line-height:1.3333333;min-height:40px}.has-feedback{position:relative}.has-feedback .form-control{padding-right:46.25px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:37px;height:37px;line-height:37px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback{width:45px;height:45px;line-height:45px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#4caf50}.has-success .form-control{border-color:#4caf50;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#3d8b40;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #92cf94;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #92cf94}.has-success .input-group-addon{color:#4caf50;border-color:#4caf50;background-color:#dff0d8}.has-success .form-control-feedback{color:#4caf50}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#ff9800}.has-warning .form-control{border-color:#ff9800;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#cc7a00;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ffc166;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ffc166}.has-warning .input-group-addon{color:#ff9800;border-color:#ff9800;background-color:#ffe0b2}.has-warning .form-control-feedback{color:#ff9800}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#e51c23}.has-error .form-control{border-color:#e51c23;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#b9151b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ef787c;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ef787c}.has-error .input-group-addon{color:#e51c23;border-color:#e51c23;background-color:#f9bdbb}.has-error .form-control-feedback{color:#e51c23}.has-feedback label~.form-control-feedback{top:28px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#a6a6a6}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:30px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:7px}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.333333px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 16px;font-size:13px;line-height:1.846;border-radius:3px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#666666;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;pointer-events:none;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#666666;background-color:#ffffff;border-color:#eeeeee}.btn-default:hover,.btn-default:focus,.btn-default.focus,.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#666666;background-color:#e6e6e6;border-color:#cfcfcf}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#ffffff;border-color:#eeeeee}.btn-default .badge{color:#ffffff;background-color:#666666}.btn-primary{color:#ffffff;background-color:#2196f3;border-color:transparent}.btn-primary:hover,.btn-primary:focus,.btn-primary.focus,.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#ffffff;background-color:#0c7cd5;border-color:rgba(0,0,0,0)}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#2196f3;border-color:transparent}.btn-primary .badge{color:#2196f3;background-color:#ffffff}.btn-success{color:#ffffff;background-color:#4caf50;border-color:transparent}.btn-success:hover,.btn-success:focus,.btn-success.focus,.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#ffffff;background-color:#3d8b40;border-color:rgba(0,0,0,0)}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#4caf50;border-color:transparent}.btn-success .badge{color:#4caf50;background-color:#ffffff}.btn-info{color:#ffffff;background-color:#9c27b0;border-color:transparent}.btn-info:hover,.btn-info:focus,.btn-info.focus,.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#ffffff;background-color:#771e86;border-color:rgba(0,0,0,0)}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#9c27b0;border-color:transparent}.btn-info .badge{color:#9c27b0;background-color:#ffffff}.btn-warning{color:#ffffff;background-color:#ff9800;border-color:transparent}.btn-warning:hover,.btn-warning:focus,.btn-warning.focus,.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#ffffff;background-color:#cc7a00;border-color:rgba(0,0,0,0)}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#ff9800;border-color:transparent}.btn-warning .badge{color:#ff9800;background-color:#ffffff}.btn-danger{color:#ffffff;background-color:#e51c23;border-color:transparent}.btn-danger:hover,.btn-danger:focus,.btn-danger.focus,.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#ffffff;background-color:#b9151b;border-color:rgba(0,0,0,0)}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#e51c23;border-color:transparent}.btn-danger .badge{color:#e51c23;background-color:#ffffff}.btn-link{color:#2196f3;font-weight:normal;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#0a6ebd;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#bbbbbb;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:17px;line-height:1.3333333;border-radius:3px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height, visibility;-o-transition-property:height, visibility;transition-property:height, visibility;-webkit-transition-duration:0.35s;-o-transition-duration:0.35s;transition-duration:0.35s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-right:4px solid transparent;border-left:4px solid transparent}.dropup,.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:13px;text-align:left;background-color:#ffffff;border:1px solid #cccccc;border:1px solid rgba(0,0,0,0.15);border-radius:3px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);-webkit-background-clip:padding-box;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:10.5px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.846;color:#666666;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#141414;background-color:#eeeeee}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#ffffff;text-decoration:none;outline:0;background-color:#2196f3}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#bbbbbb}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.846;color:#bbbbbb;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-bottom-left-radius:3px;border-top-right-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle="buttons"]>.btn input[type="radio"],[data-toggle="buttons"]>.btn-group>.btn input[type="radio"],[data-toggle="buttons"]>.btn input[type="checkbox"],[data-toggle="buttons"]>.btn-group>.btn input[type="checkbox"]{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:45px;padding:10px 16px;font-size:17px;line-height:1.3333333;border-radius:3px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:45px;line-height:45px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 16px;font-size:13px;font-weight:normal;line-height:1;color:#666666;text-align:center;background-color:transparent;border:1px solid transparent;border-radius:3px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:17px;border-radius:3px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eeeeee}.nav>li.disabled>a{color:#bbbbbb}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#bbbbbb;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eeeeee;border-color:#2196f3}.nav .nav-divider{height:1px;margin:10.5px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid transparent}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.846;border:1px solid transparent;border-radius:3px 3px 0 0}.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee transparent}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#666666;background-color:transparent;border:1px solid transparent;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:3px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid transparent}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid transparent;border-radius:3px 3px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#ffffff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:3px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#ffffff;background-color:#2196f3}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:3px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid transparent}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid transparent;border-radius:3px 3px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#ffffff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:64px;margin-bottom:23px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:3px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:20.5px 15px;font-size:17px;line-height:23px;height:64px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:15px;margin-bottom:15px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:3px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:10.25px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:23px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:23px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:20.5px;padding-bottom:20.5px}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:13.5px;margin-bottom:13.5px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-right-radius:3px;border-top-left-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:13.5px;margin-bottom:13.5px}.navbar-btn.btn-sm{margin-top:17px;margin-bottom:17px}.navbar-btn.btn-xs{margin-top:21px;margin-bottom:21px}.navbar-text{margin-top:20.5px;margin-bottom:20.5px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}}@media (min-width:768px){.navbar-left{float:left !important}.navbar-right{float:right !important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#ffffff;border-color:transparent}.navbar-default .navbar-brand{color:#666666}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#212121;background-color:transparent}.navbar-default .navbar-text{color:#bbbbbb}.navbar-default .navbar-nav>li>a{color:#666666}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#212121;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#212121;background-color:#eeeeee}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#cccccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:transparent}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:transparent}.navbar-default .navbar-toggle .icon-bar{background-color:rgba(0,0,0,0.5)}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:transparent}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#eeeeee;color:#212121}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#666666}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#212121;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#212121;background-color:#eeeeee}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#cccccc;background-color:transparent}}.navbar-default .navbar-link{color:#666666}.navbar-default .navbar-link:hover{color:#212121}.navbar-default .btn-link{color:#666666}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#212121}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#cccccc}.navbar-inverse{background-color:#2196f3;border-color:transparent}.navbar-inverse .navbar-brand{color:#b2dbfb}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#ffffff;background-color:transparent}.navbar-inverse .navbar-text{color:#bbbbbb}.navbar-inverse .navbar-nav>li>a{color:#b2dbfb}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#ffffff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#ffffff;background-color:#0c7cd5}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:transparent}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:transparent}.navbar-inverse .navbar-toggle .icon-bar{background-color:rgba(0,0,0,0.5)}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#0c84e4}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#0c7cd5;color:#ffffff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#b2dbfb}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#ffffff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#ffffff;background-color:#0c7cd5}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444444;background-color:transparent}}.navbar-inverse .navbar-link{color:#b2dbfb}.navbar-inverse .navbar-link:hover{color:#ffffff}.navbar-inverse .btn-link{color:#b2dbfb}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#ffffff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444444}.breadcrumb{padding:8px 15px;margin-bottom:23px;list-style:none;background-color:#f5f5f5;border-radius:3px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#cccccc}.breadcrumb>.active{color:#bbbbbb}.pagination{display:inline-block;padding-left:0;margin:23px 0;border-radius:3px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 16px;line-height:1.846;text-decoration:none;color:#2196f3;background-color:#ffffff;border:1px solid #dddddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#0a6ebd;background-color:#eeeeee;border-color:#dddddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#ffffff;background-color:#2196f3;border-color:#2196f3;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#bbbbbb;background-color:#ffffff;border-color:#dddddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:17px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:23px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#ffffff;border:1px solid #dddddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eeeeee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#bbbbbb;background-color:#ffffff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#ffffff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#ffffff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#bbbbbb}.label-default[href]:hover,.label-default[href]:focus{background-color:#a2a2a2}.label-primary{background-color:#2196f3}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#0c7cd5}.label-success{background-color:#4caf50}.label-success[href]:hover,.label-success[href]:focus{background-color:#3d8b40}.label-info{background-color:#9c27b0}.label-info[href]:hover,.label-info[href]:focus{background-color:#771e86}.label-warning{background-color:#ff9800}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#cc7a00}.label-danger{background-color:#e51c23}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#b9151b}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:normal;color:#ffffff;line-height:1;vertical-align:baseline;white-space:nowrap;text-align:center;background-color:#bbbbbb;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge,.btn-group-xs>.btn .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#ffffff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#2196f3;background-color:#ffffff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px 15px;margin-bottom:30px;color:inherit;background-color:#f9f9f9}.jumbotron h1,.jumbotron .h1{color:#444444}.jumbotron p{margin-bottom:15px;font-size:20px;font-weight:200}.jumbotron>hr{border-top-color:#e0e0e0}.container .jumbotron,.container-fluid .jumbotron{border-radius:3px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding:48px 0}.container .jumbotron,.container-fluid .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1,.jumbotron .h1{font-size:58.5px}}.thumbnail{display:block;padding:4px;margin-bottom:23px;line-height:1.846;background-color:#ffffff;border:1px solid #dddddd;border-radius:3px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-left:auto;margin-right:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#2196f3}.thumbnail .caption{padding:9px;color:#666666}.alert{padding:15px;margin-bottom:23px;border:1px solid transparent;border-radius:3px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#4caf50}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#3d8b40}.alert-info{background-color:#e1bee7;border-color:#cba4dd;color:#9c27b0}.alert-info hr{border-top-color:#c191d6}.alert-info .alert-link{color:#771e86}.alert-warning{background-color:#ffe0b2;border-color:#ffc599;color:#ff9800}.alert-warning hr{border-top-color:#ffb67f}.alert-warning .alert-link{color:#cc7a00}.alert-danger{background-color:#f9bdbb;border-color:#f7a4af;color:#e51c23}.alert-danger hr{border-top-color:#f58c9a}.alert-danger .alert-link{color:#b9151b}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:23px;margin-bottom:23px;background-color:#f5f5f5;border-radius:3px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0%;height:100%;font-size:12px;line-height:23px;color:#ffffff;text-align:center;background-color:#2196f3;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#4caf50}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-info{background-color:#9c27b0}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-warning{background-color:#ff9800}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-danger{background-color:#e51c23}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#ffffff;border:1px solid #dddddd}.list-group-item:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}a.list-group-item{color:#555555}a.list-group-item .list-group-item-heading{color:#333333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;color:#555555;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{background-color:#eeeeee;color:#bbbbbb;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#bbbbbb}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#ffffff;background-color:#2196f3;border-color:#2196f3}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e3f2fd}.list-group-item-success{color:#4caf50;background-color:#dff0d8}a.list-group-item-success{color:#4caf50}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#4caf50;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#4caf50;border-color:#4caf50}.list-group-item-info{color:#9c27b0;background-color:#e1bee7}a.list-group-item-info{color:#9c27b0}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#9c27b0;background-color:#d8abe0}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#9c27b0;border-color:#9c27b0}.list-group-item-warning{color:#ff9800;background-color:#ffe0b2}a.list-group-item-warning{color:#ff9800}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#ff9800;background-color:#ffd699}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#ff9800;border-color:#ff9800}.list-group-item-danger{color:#e51c23;background-color:#f9bdbb}a.list-group-item-danger{color:#e51c23}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#e51c23;background-color:#f7a6a4}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#e51c23;border-color:#e51c23}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:23px;background-color:#ffffff;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:2px;border-top-left-radius:2px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:15px;color:inherit}.panel-title>a,.panel-title>small,.panel-title>.small,.panel-title>small>a,.panel-title>.small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #dddddd;border-bottom-right-radius:2px;border-bottom-left-radius:2px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:2px;border-top-left-radius:2px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:2px;border-bottom-left-radius:2px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table caption,.panel>.table-responsive>.table caption,.panel>.panel-collapse>.table caption{padding-left:15px;padding-right:15px}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:2px;border-top-left-radius:2px}.panel>.table:first-child>thead:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:2px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:2px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:2px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:2px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #dddddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:23px}.panel-group .panel{margin-bottom:0;border-radius:3px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body,.panel-group .panel-heading+.panel-collapse>.list-group{border-top:1px solid #dddddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #dddddd}.panel-default{border-color:#dddddd}.panel-default>.panel-heading{color:#212121;background-color:#f5f5f5;border-color:#dddddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#dddddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#212121}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#dddddd}.panel-primary{border-color:#2196f3}.panel-primary>.panel-heading{color:#ffffff;background-color:#2196f3;border-color:#2196f3}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#2196f3}.panel-primary>.panel-heading .badge{color:#2196f3;background-color:#ffffff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#2196f3}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#4caf50;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#4caf50}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#cba4dd}.panel-info>.panel-heading{color:#9c27b0;background-color:#e1bee7;border-color:#cba4dd}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#cba4dd}.panel-info>.panel-heading .badge{color:#e1bee7;background-color:#9c27b0}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#cba4dd}.panel-warning{border-color:#ffc599}.panel-warning>.panel-heading{color:#ff9800;background-color:#ffe0b2;border-color:#ffc599}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ffc599}.panel-warning>.panel-heading .badge{color:#ffe0b2;background-color:#ff9800}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ffc599}.panel-danger{border-color:#f7a4af}.panel-danger>.panel-heading{color:#e51c23;background-color:#f9bdbb;border-color:#f7a4af}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#f7a4af}.panel-danger>.panel-heading .badge{color:#f9bdbb;background-color:#e51c23}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#f7a4af}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f9f9f9;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:3px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:19.5px;font-weight:normal;line-height:1;color:#000000;text-shadow:none;opacity:0.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);-o-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#ffffff;border:1px solid #999999;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:0.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid transparent;min-height:16.846px}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.846}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid transparent}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-weight:normal;line-height:1.4;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:0.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;text-decoration:none;background-color:#727272;border-radius:3px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#727272}.tooltip.top-left .tooltip-arrow{bottom:0;right:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#727272}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#727272}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#727272}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#727272}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#727272}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#727272}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#727272}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1.846;text-align:left;background-color:#ffffff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);white-space:normal}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:13px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:2px 2px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:rgba(0,0,0,0);border-top-color:rgba(0,0,0,0.075);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#ffffff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:rgba(0,0,0,0);border-right-color:rgba(0,0,0,0.075)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#ffffff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:rgba(0,0,0,0);border-bottom-color:rgba(0,0,0,0.075);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#ffffff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:rgba(0,0,0,0);border-left-color:rgba(0,0,0,0.075)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#ffffff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000;perspective:1000}.carousel-inner>.item.next,.carousel-inner>.item.active.right{-webkit-transform:translate3d(100%, 0, 0);transform:translate3d(100%, 0, 0);left:0}.carousel-inner>.item.prev,.carousel-inner>.item.active.left{-webkit-transform:translate3d(-100%, 0, 0);transform:translate3d(-100%, 0, 0);left:0}.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right,.carousel-inner>.item.active{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:0.5;filter:alpha(opacity=50);font-size:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-control.left{background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-webkit-gradient(linear, left top, right top, from(rgba(0,0,0,0.5)), to(rgba(0,0,0,0.0001)));background-image:linear-gradient(to right, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-webkit-gradient(linear, left top, right top, from(rgba(0,0,0,0.0001)), to(rgba(0,0,0,0.5)));background-image:linear-gradient(to right, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:hover,.carousel-control:focus{outline:0;color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #ffffff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#ffffff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (max-width:767px){.visible-xs-block{display:block !important}}@media (max-width:767px){.visible-xs-inline{display:inline !important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (min-width:1200px){.visible-lg-block{display:block !important}}@media (min-width:1200px){.visible-lg-inline{display:inline !important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}.visible-print-block{display:none !important}@media print{.visible-print-block{display:block !important}}.visible-print-inline{display:none !important}@media print{.visible-print-inline{display:inline !important}}.visible-print-inline-block{display:none !important}@media print{.visible-print-inline-block{display:inline-block !important}}@media print{.hidden-print{display:none !important}}.navbar{border:none;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.3);box-shadow:0 1px 2px rgba(0,0,0,0.3)}.navbar-brand{font-size:24px}.navbar-inverse .form-control{color:#fff}.navbar-inverse .form-control::-moz-placeholder{color:#b2dbfb;opacity:1}.navbar-inverse .form-control:-ms-input-placeholder{color:#b2dbfb}.navbar-inverse .form-control::-webkit-input-placeholder{color:#b2dbfb}.navbar-inverse .form-control[type=text]{-webkit-box-shadow:inset 0 -1px 0 #b2dbfb;box-shadow:inset 0 -1px 0 #b2dbfb}.navbar-inverse .form-control[type=text]:focus{-webkit-box-shadow:inset 0 -2px 0 #fff;box-shadow:inset 0 -2px 0 #fff}.navbar-nav>li>.dropdown-menu{margin-top:2px}.btn-default{-webkit-background-size:200% 200%;background-size:200%;background-position:50%}.btn-default:hover,.btn-default:active:hover,.btn-default:focus{background-color:#f0f0f0}.btn-default:active{background-color:#f0f0f0;background-image:-webkit-radial-gradient(circle, #f0f0f0 10%, #fff 11%);background-image:-o-radial-gradient(circle, #f0f0f0 10%, #fff 11%);background-image:radial-gradient(circle, #f0f0f0 10%, #fff 11%);background-repeat:no-repeat;-webkit-background-size:1000% 1000%;background-size:1000%;-webkit-box-shadow:2px 2px 2px rgba(0,0,0,0.3);box-shadow:2px 2px 2px rgba(0,0,0,0.3)}.btn-primary{-webkit-background-size:200% 200%;background-size:200%;background-position:50%}.btn-primary:hover,.btn-primary:active:hover,.btn-primary:focus{background-color:#0d87e9}.btn-primary:active{background-color:#0d87e9;background-image:-webkit-radial-gradient(circle, #0d87e9 10%, #2196f3 11%);background-image:-o-radial-gradient(circle, #0d87e9 10%, #2196f3 11%);background-image:radial-gradient(circle, #0d87e9 10%, #2196f3 11%);background-repeat:no-repeat;-webkit-background-size:1000% 1000%;background-size:1000%;-webkit-box-shadow:2px 2px 2px rgba(0,0,0,0.3);box-shadow:2px 2px 2px rgba(0,0,0,0.3)}.btn-success{-webkit-background-size:200% 200%;background-size:200%;background-position:50%}.btn-success:hover,.btn-success:active:hover,.btn-success:focus{background-color:#439a46}.btn-success:active{background-color:#439a46;background-image:-webkit-radial-gradient(circle, #439a46 10%, #4caf50 11%);background-image:-o-radial-gradient(circle, #439a46 10%, #4caf50 11%);background-image:radial-gradient(circle, #439a46 10%, #4caf50 11%);background-repeat:no-repeat;-webkit-background-size:1000% 1000%;background-size:1000%;-webkit-box-shadow:2px 2px 2px rgba(0,0,0,0.3);box-shadow:2px 2px 2px rgba(0,0,0,0.3)}.btn-info{-webkit-background-size:200% 200%;background-size:200%;background-position:50%}.btn-info:hover,.btn-info:active:hover,.btn-info:focus{background-color:#862197}.btn-info:active{background-color:#862197;background-image:-webkit-radial-gradient(circle, #862197 10%, #9c27b0 11%);background-image:-o-radial-gradient(circle, #862197 10%, #9c27b0 11%);background-image:radial-gradient(circle, #862197 10%, #9c27b0 11%);background-repeat:no-repeat;-webkit-background-size:1000% 1000%;background-size:1000%;-webkit-box-shadow:2px 2px 2px rgba(0,0,0,0.3);box-shadow:2px 2px 2px rgba(0,0,0,0.3)}.btn-warning{-webkit-background-size:200% 200%;background-size:200%;background-position:50%}.btn-warning:hover,.btn-warning:active:hover,.btn-warning:focus{background-color:#e08600}.btn-warning:active{background-color:#e08600;background-image:-webkit-radial-gradient(circle, #e08600 10%, #ff9800 11%);background-image:-o-radial-gradient(circle, #e08600 10%, #ff9800 11%);background-image:radial-gradient(circle, #e08600 10%, #ff9800 11%);background-repeat:no-repeat;-webkit-background-size:1000% 1000%;background-size:1000%;-webkit-box-shadow:2px 2px 2px rgba(0,0,0,0.3);box-shadow:2px 2px 2px rgba(0,0,0,0.3)}.btn-danger{-webkit-background-size:200% 200%;background-size:200%;background-position:50%}.btn-danger:hover,.btn-danger:active:hover,.btn-danger:focus{background-color:#cb171e}.btn-danger:active{background-color:#cb171e;background-image:-webkit-radial-gradient(circle, #cb171e 10%, #e51c23 11%);background-image:-o-radial-gradient(circle, #cb171e 10%, #e51c23 11%);background-image:radial-gradient(circle, #cb171e 10%, #e51c23 11%);background-repeat:no-repeat;-webkit-background-size:1000% 1000%;background-size:1000%;-webkit-box-shadow:2px 2px 2px rgba(0,0,0,0.3);box-shadow:2px 2px 2px rgba(0,0,0,0.3)}.btn{text-transform:uppercase;border-right:none;border-bottom:none;-webkit-box-shadow:1px 1px 2px rgba(0,0,0,0.3);box-shadow:1px 1px 2px rgba(0,0,0,0.3);-webkit-transition:all 0.2s;-o-transition:all 0.2s;transition:all 0.2s}.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn-link:hover,.btn-link:focus{color:#2196f3;text-decoration:none}.btn-default.disabled{border:1px solid #eeeeee}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:0}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:0}body{-webkit-font-smoothing:antialiased;letter-spacing:.1px;text-rendering:optimizeLegibility}p{margin:0 0 1em}input,button{-webkit-font-smoothing:antialiased;letter-spacing:.1px;text-rendering:optimizeLegibility}a{-webkit-transition:all 0.2s;-o-transition:all 0.2s;transition:all 0.2s}label{font-weight:normal}textarea,textarea.form-control,input.form-control,input[type=text],input[type=password],input[type=email],input[type=number],[type=text].form-control,[type=password].form-control,[type=email].form-control,[type=tel].form-control,[contenteditable].form-control{padding:0;border:none;border-radius:0;-webkit-appearance:none;-webkit-box-shadow:inset 0 -1px 0 #ddd;box-shadow:inset 0 -1px 0 #ddd;font-size:16px}textarea:focus,textarea.form-control:focus,input.form-control:focus,input[type=text]:focus,input[type=password]:focus,input[type=email]:focus,input[type=number]:focus,[type=text].form-control:focus,[type=password].form-control:focus,[type=email].form-control:focus,[type=tel].form-control:focus,[contenteditable].form-control:focus{-webkit-box-shadow:inset 0 -2px 0 #2196f3;box-shadow:inset 0 -2px 0 #2196f3}textarea[disabled],textarea.form-control[disabled],input.form-control[disabled],input[type=text][disabled],input[type=password][disabled],input[type=email][disabled],input[type=number][disabled],[type=text].form-control[disabled],[type=password].form-control[disabled],[type=email].form-control[disabled],[type=tel].form-control[disabled],[contenteditable].form-control[disabled],textarea[readonly],textarea.form-control[readonly],input.form-control[readonly],input[type=text][readonly],input[type=password][readonly],input[type=email][readonly],input[type=number][readonly],[type=text].form-control[readonly],[type=password].form-control[readonly],[type=email].form-control[readonly],[type=tel].form-control[readonly],[contenteditable].form-control[readonly]{-webkit-box-shadow:none;box-shadow:none;border-bottom:1px dotted #ddd}textarea.input-sm,textarea.form-control.input-sm,input.form-control.input-sm,input[type=text].input-sm,input[type=password].input-sm,input[type=email].input-sm,input[type=number].input-sm,[type=text].form-control.input-sm,[type=password].form-control.input-sm,[type=email].form-control.input-sm,[type=tel].form-control.input-sm,[contenteditable].form-control.input-sm{font-size:12px}textarea.input-lg,textarea.form-control.input-lg,input.form-control.input-lg,input[type=text].input-lg,input[type=password].input-lg,input[type=email].input-lg,input[type=number].input-lg,[type=text].form-control.input-lg,[type=password].form-control.input-lg,[type=email].form-control.input-lg,[type=tel].form-control.input-lg,[contenteditable].form-control.input-lg{font-size:17px}select,select.form-control{border:0;border-radius:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding-left:0;padding-right:0\9;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAAJ1BMVEVmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmaP/QSjAAAADHRSTlMAAgMJC0uWpKa6wMxMdjkoAAAANUlEQVR4AeXJyQEAERAAsNl7Hf3X6xt0QL6JpZWq30pdvdadme+0PMdzvHm8YThHcT1H7K0BtOMDniZhWOgAAAAASUVORK5CYII=);-webkit-background-size:13px 13px;background-size:13px;background-repeat:no-repeat;background-position:right center;-webkit-box-shadow:inset 0 -1px 0 #ddd;box-shadow:inset 0 -1px 0 #ddd;font-size:16px;line-height:1.5}select::-ms-expand,select.form-control::-ms-expand{display:none}select.input-sm,select.form-control.input-sm{font-size:12px}select.input-lg,select.form-control.input-lg{font-size:17px}select:focus,select.form-control:focus{-webkit-box-shadow:inset 0 -2px 0 #2196f3;box-shadow:inset 0 -2px 0 #2196f3;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAAJ1BMVEUhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISF8S9ewAAAADHRSTlMAAgMJC0uWpKa6wMxMdjkoAAAANUlEQVR4AeXJyQEAERAAsNl7Hf3X6xt0QL6JpZWq30pdvdadme+0PMdzvHm8YThHcT1H7K0BtOMDniZhWOgAAAAASUVORK5CYII=)}select[multiple],select.form-control[multiple]{background:none}.radio label,.radio-inline label,.checkbox label,.checkbox-inline label{padding-left:25px}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="radio"],.checkbox-inline input[type="radio"],.radio input[type="checkbox"],.radio-inline input[type="checkbox"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{margin-left:-25px}input[type="radio"],.radio input[type="radio"],.radio-inline input[type="radio"]{position:relative;margin-top:5px;margin-right:4px;vertical-align:-4px;border:none;background-color:transparent;-webkit-appearance:none;appearance:none;cursor:pointer}input[type="radio"]:focus,.radio input[type="radio"]:focus,.radio-inline input[type="radio"]:focus{outline:none}input[type="radio"]:before,.radio input[type="radio"]:before,.radio-inline input[type="radio"]:before,input[type="radio"]:after,.radio input[type="radio"]:after,.radio-inline input[type="radio"]:after{content:"";display:block;width:18px;height:18px;margin-top:-3px;border-radius:50%;-webkit-transition:240ms;-o-transition:240ms;transition:240ms}input[type="radio"]:before,.radio input[type="radio"]:before,.radio-inline input[type="radio"]:before{position:absolute;left:0;top:0;background-color:#2196f3;-webkit-transform:scale(0);-ms-transform:scale(0);-o-transform:scale(0);transform:scale(0)}input[type="radio"]:after,.radio input[type="radio"]:after,.radio-inline input[type="radio"]:after{border:2px solid #666666}input[type="radio"]:checked:before,.radio input[type="radio"]:checked:before,.radio-inline input[type="radio"]:checked:before{-webkit-transform:scale(.5);-ms-transform:scale(.5);-o-transform:scale(.5);transform:scale(.5)}input[type="radio"]:disabled:checked:before,.radio input[type="radio"]:disabled:checked:before,.radio-inline input[type="radio"]:disabled:checked:before{background-color:#bbbbbb}input[type="radio"]:checked:after,.radio input[type="radio"]:checked:after,.radio-inline input[type="radio"]:checked:after{border-color:#2196f3}input[type="radio"]:disabled:after,.radio input[type="radio"]:disabled:after,.radio-inline input[type="radio"]:disabled:after,input[type="radio"]:disabled:checked:after,.radio input[type="radio"]:disabled:checked:after,.radio-inline input[type="radio"]:disabled:checked:after{border-color:#bbbbbb}input[type="checkbox"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{position:relative;vertical-align:-4px;border:none;-webkit-appearance:none;appearance:none;cursor:pointer}input[type="checkbox"]:focus,.checkbox input[type="checkbox"]:focus,.checkbox-inline input[type="checkbox"]:focus{outline:none}input[type="checkbox"]:after,.checkbox input[type="checkbox"]:after,.checkbox-inline input[type="checkbox"]:after{content:"";display:block;width:18px;height:18px;margin-top:-2px;margin-right:5px;border:2px solid #666666;border-radius:2px;-webkit-transition:240ms;-o-transition:240ms;transition:240ms}input[type="checkbox"]:checked:before,.checkbox input[type="checkbox"]:checked:before,.checkbox-inline input[type="checkbox"]:checked:before{content:"";position:absolute;top:0;left:6px;display:table;width:6px;height:12px;border:2px solid #fff;border-top-width:0;border-left-width:0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}input[type="checkbox"]:checked:after,.checkbox input[type="checkbox"]:checked:after,.checkbox-inline input[type="checkbox"]:checked:after{background-color:#2196f3;border-color:#2196f3}input[type="checkbox"]:disabled:after,.checkbox input[type="checkbox"]:disabled:after,.checkbox-inline input[type="checkbox"]:disabled:after{border-color:#bbbbbb}input[type="checkbox"]:disabled:checked:after,.checkbox input[type="checkbox"]:disabled:checked:after,.checkbox-inline input[type="checkbox"]:disabled:checked:after{background-color:#bbbbbb;border-color:transparent}.has-warning input:not([type=checkbox]),.has-warning .form-control,.has-warning input:not([type=checkbox]):focus,.has-warning .form-control:focus{-webkit-box-shadow:inset 0 -2px 0 #ff9800;box-shadow:inset 0 -2px 0 #ff9800}.has-error input:not([type=checkbox]),.has-error .form-control,.has-error input:not([type=checkbox]):focus,.has-error .form-control:focus{-webkit-box-shadow:inset 0 -2px 0 #e51c23;box-shadow:inset 0 -2px 0 #e51c23}.has-success input:not([type=checkbox]),.has-success .form-control,.has-success input:not([type=checkbox]):focus,.has-success .form-control:focus{-webkit-box-shadow:inset 0 -2px 0 #4caf50;box-shadow:inset 0 -2px 0 #4caf50}.nav-tabs>li>a,.nav-tabs>li>a:focus{margin-right:0;background-color:transparent;border:none;color:#666666;-webkit-box-shadow:inset 0 -1px 0 #ddd;box-shadow:inset 0 -1px 0 #ddd;-webkit-transition:all 0.2s;-o-transition:all 0.2s;transition:all 0.2s}.nav-tabs>li>a:hover,.nav-tabs>li>a:focus:hover{background-color:transparent;-webkit-box-shadow:inset 0 -2px 0 #2196f3;box-shadow:inset 0 -2px 0 #2196f3;color:#2196f3}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus{border:none;-webkit-box-shadow:inset 0 -2px 0 #2196f3;box-shadow:inset 0 -2px 0 #2196f3;color:#2196f3}.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus:hover{border:none;color:#2196f3}.nav-tabs>li.disabled>a{-webkit-box-shadow:inset 0 -1px 0 #ddd;box-shadow:inset 0 -1px 0 #ddd}.nav-tabs.nav-justified>li>a,.nav-tabs.nav-justified>li>a:hover,.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover{border:none}.nav-tabs .dropdown-menu{margin-top:0}.dropdown-menu{border:none;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.3);box-shadow:0 1px 4px rgba(0,0,0,0.3)}.alert{border:none;color:#fff}.alert-success{background-color:#4caf50}.alert-info{background-color:#9c27b0}.alert-warning{background-color:#ff9800}.alert-danger{background-color:#e51c23}.alert a:not(.close),.alert .alert-link{color:#fff;font-weight:bold}.alert .close{color:#fff}.badge{padding:3px 6px 5px}.progress{position:relative;z-index:1;height:6px;border-radius:0;-webkit-box-shadow:none;box-shadow:none}.progress-bar{-webkit-box-shadow:none;box-shadow:none}.progress-bar:last-child{border-radius:0 3px 3px 0}.progress-bar:last-child:before{display:block;content:"";position:absolute;width:100%;height:100%;left:0;right:0;z-index:-1;background-color:#cae6fc}.progress-bar-success:last-child.progress-bar:before{background-color:#c7e7c8}.progress-bar-info:last-child.progress-bar:before{background-color:#edc9f3}.progress-bar-warning:last-child.progress-bar:before{background-color:#ffe0b3}.progress-bar-danger:last-child.progress-bar:before{background-color:#f28e92}.close{font-size:34px;font-weight:300;line-height:24px;opacity:0.6}.close:hover{opacity:1}.list-group-item{padding:15px}.list-group-item-text{color:#bbbbbb}.well{border-radius:0;-webkit-box-shadow:none;box-shadow:none}.panel{border:none;border-radius:2px;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.3);box-shadow:0 1px 4px rgba(0,0,0,0.3)}.panel-heading{border-bottom:none}.panel-footer{border-top:none}.panel-success .panel-heading{background-color:#4caf50}.panel-success .panel-title{color:#fff}.panel-info .panel-heading{background-color:#9c27b0}.panel-info .panel-title{color:#fff}.panel-warning .panel-heading{background-color:#ff9800}.panel-warning .panel-title{color:#fff}.panel-danger .panel-heading{background-color:#e51c23}.panel-danger .panel-title{color:#fff}.popover{border:none;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.3);box-shadow:0 1px 4px rgba(0,0,0,0.3)}.carousel-caption h1,.carousel-caption h2,.carousel-caption h3,.carousel-caption h4,.carousel-caption h5,.carousel-caption h6{color:inherit}
@-webkit-keyframes showSweetAlert {
  0% {
    transform: scale(0.7);
    -webkit-transform: scale(0.7);
  }
  45% {
    transform: scale(1.05);
    -webkit-transform: scale(1.05);
  }
  80% {
    transform: scale(0.95);
    -webkit-tranform: scale(0.95);
  }
  100% {
    transform: scale(1);
    -webkit-transform: scale(1);
  }
}
@keyframes showSweetAlert {
  0% {
    transform: scale(0.7);
    -webkit-transform: scale(0.7);
  }
  45% {
    transform: scale(1.05);
    -webkit-transform: scale(1.05);
  }
  80% {
    transform: scale(0.95);
    -webkit-tranform: scale(0.95);
  }
  100% {
    transform: scale(1);
    -webkit-transform: scale(1);
  }
}
@-webkit-keyframes hideSweetAlert {
  0% {
    transform: scale(1);
    -webkit-transform: scale(1);
  }
  100% {
    transform: scale(0.5);
    -webkit-transform: scale(0.5);
  }
}
@keyframes hideSweetAlert {
  0% {
    transform: scale(1);
    -webkit-transform: scale(1);
  }
  100% {
    transform: scale(0.5);
    -webkit-transform: scale(0.5);
  }
}
.showSweetAlert {
  -webkit-animation: showSweetAlert 0.3s;
  animation: showSweetAlert 0.3s;
}
.hideSweetAlert {
  -webkit-animation: hideSweetAlert 0.2s;
  animation: hideSweetAlert 0.2s;
}
@-webkit-keyframes animateSuccessTip {
  0% {
    width: 0;
    left: 1px;
    top: 19px;
  }
  54% {
    width: 0;
    left: 1px;
    top: 19px;
  }
  70% {
    width: 50px;
    left: -8px;
    top: 37px;
  }
  84% {
    width: 17px;
    left: 21px;
    top: 48px;
  }
  100% {
    width: 25px;
    left: 14px;
    top: 45px;
  }
}
@keyframes animateSuccessTip {
  0% {
    width: 0;
    left: 1px;
    top: 19px;
  }
  54% {
    width: 0;
    left: 1px;
    top: 19px;
  }
  70% {
    width: 50px;
    left: -8px;
    top: 37px;
  }
  84% {
    width: 17px;
    left: 21px;
    top: 48px;
  }
  100% {
    width: 25px;
    left: 14px;
    top: 45px;
  }
}
@-webkit-keyframes animateSuccessLong {
  0% {
    width: 0;
    right: 46px;
    top: 54px;
  }
  65% {
    width: 0;
    right: 46px;
    top: 54px;
  }
  84% {
    width: 55px;
    right: 0px;
    top: 35px;
  }
  100% {
    width: 47px;
    right: 8px;
    top: 38px;
  }
}
@keyframes animateSuccessLong {
  0% {
    width: 0;
    right: 46px;
    top: 54px;
  }
  65% {
    width: 0;
    right: 46px;
    top: 54px;
  }
  84% {
    width: 55px;
    right: 0px;
    top: 35px;
  }
  100% {
    width: 47px;
    right: 8px;
    top: 38px;
  }
}
@-webkit-keyframes rotatePlaceholder {
  0% {
    transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
  }
  5% {
    transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
  }
  12% {
    transform: rotate(-405deg);
    -webkit-transform: rotate(-405deg);
  }
  100% {
    transform: rotate(-405deg);
    -webkit-transform: rotate(-405deg);
  }
}
@keyframes rotatePlaceholder {
  0% {
    transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
  }
  5% {
    transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
  }
  12% {
    transform: rotate(-405deg);
    -webkit-transform: rotate(-405deg);
  }
  100% {
    transform: rotate(-405deg);
    -webkit-transform: rotate(-405deg);
  }
}
.animateSuccessTip {
  -webkit-animation: animateSuccessTip 0.75s;
  animation: animateSuccessTip 0.75s;
}
.animateSuccessLong {
  -webkit-animation: animateSuccessLong 0.75s;
  animation: animateSuccessLong 0.75s;
}
.icon.success.animate::after {
  -webkit-animation: rotatePlaceholder 4.25s ease-in;
  animation: rotatePlaceholder 4.25s ease-in;
}
@-webkit-keyframes animateErrorIcon {
  0% {
    transform: rotateX(100deg);
    -webkit-transform: rotateX(100deg);
    opacity: 0;
  }
  100% {
    transform: rotateX(0deg);
    -webkit-transform: rotateX(0deg);
    opacity: 1;
  }
}
@keyframes animateErrorIcon {
  0% {
    transform: rotateX(100deg);
    -webkit-transform: rotateX(100deg);
    opacity: 0;
  }
  100% {
    transform: rotateX(0deg);
    -webkit-transform: rotateX(0deg);
    opacity: 1;
  }
}
.animateErrorIcon {
  -webkit-animation: animateErrorIcon 0.5s;
  animation: animateErrorIcon 0.5s;
}
@-webkit-keyframes animateXMark {
  0% {
    transform: scale(0.4);
    -webkit-transform: scale(0.4);
    margin-top: 26px;
    opacity: 0;
  }
  50% {
    transform: scale(0.4);
    -webkit-transform: scale(0.4);
    margin-top: 26px;
    opacity: 0;
  }
  80% {
    transform: scale(1.15);
    -webkit-transform: scale(1.15);
    margin-top: -6px;
  }
  100% {
    transform: scale(1);
    -webkit-transform: scale(1);
    margin-top: 0;
    opacity: 1;
  }
}
@keyframes animateXMark {
  0% {
    transform: scale(0.4);
    -webkit-transform: scale(0.4);
    margin-top: 26px;
    opacity: 0;
  }
  50% {
    transform: scale(0.4);
    -webkit-transform: scale(0.4);
    margin-top: 26px;
    opacity: 0;
  }
  80% {
    transform: scale(1.15);
    -webkit-transform: scale(1.15);
    margin-top: -6px;
  }
  100% {
    transform: scale(1);
    -webkit-transform: scale(1);
    margin-top: 0;
    opacity: 1;
  }
}
.animateXMark {
  -webkit-animation: animateXMark 0.5s;
  animation: animateXMark 0.5s;
}
@-webkit-keyframes pulseWarning {
  0% {
    border-color: #F8D486;
  }
  100% {
    border-color: #F8BB86;
  }
}
@keyframes pulseWarning {
  0% {
    border-color: #F8D486;
  }
  100% {
    border-color: #F8BB86;
  }
}
.pulseWarning {
  -webkit-animation: pulseWarning 0.75s infinite alternate;
  animation: pulseWarning 0.75s infinite alternate;
}
@-webkit-keyframes pulseWarningIns {
  0% {
    background-color: #F8D486;
  }
  100% {
    background-color: #F8BB86;
  }
}
@keyframes pulseWarningIns {
  0% {
    background-color: #F8D486;
  }
  100% {
    background-color: #F8BB86;
  }
}
.pulseWarningIns {
  -webkit-animation: pulseWarningIns 0.75s infinite alternate;
  animation: pulseWarningIns 0.75s infinite alternate;
}
.sweet-overlay {
  background-color: rgba(0, 0, 0, 0.4);
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: none;
  z-index: 1040;
}
.sweet-alert {
  background-color: #ffffff;
  width: 478px;
  padding: 17px;
  border-radius: 5px;
  text-align: center;
  position: fixed;
  left: 50%;
  top: 50%;
  margin-left: -256px;
  margin-top: -200px;
  overflow: hidden;
  display: none;
  z-index: 2000;
}
@media all and (max-width: 767px) {
  .sweet-alert {
    width: auto;
    margin-left: 0;
    margin-right: 0;
    left: 15px;
    right: 15px;
  }
}
.sweet-alert .icon {
  width: 80px;
  height: 80px;
  border: 4px solid gray;
  border-radius: 50%;
  margin: 20px auto;
  position: relative;
  box-sizing: content-box;
}
.sweet-alert .icon.error {
  border-color: #d43f3a;
}
.sweet-alert .icon.error .x-mark {
  position: relative;
  display: block;
}
.sweet-alert .icon.error .line {
  position: absolute;
  height: 5px;
  width: 47px;
  background-color: #d9534f;
  display: block;
  top: 37px;
  border-radius: 2px;
}
.sweet-alert .icon.error .line.left {
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
  left: 17px;
}
.sweet-alert .icon.error .line.right {
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
  right: 16px;
}
.sweet-alert .icon.warning {
  border-color: #eea236;
}
.sweet-alert .icon.warning .body {
  position: absolute;
  width: 5px;
  height: 47px;
  left: 50%;
  top: 10px;
  border-radius: 2px;
  margin-left: -2px;
  background-color: #f0ad4e;
}
.sweet-alert .icon.warning .dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: -3px;
  left: 50%;
  bottom: 10px;
  background-color: #f0ad4e;
}
.sweet-alert .icon.info {
  border-color: #46b8da;
}
.sweet-alert .icon.info::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 29px;
  left: 50%;
  bottom: 17px;
  border-radius: 2px;
  margin-left: -2px;
  background-color: #5bc0de;
}
.sweet-alert .icon.info::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: -3px;
  top: 19px;
  background-color: #5bc0de;
}
.sweet-alert .icon.success {
  border-color: #4cae4c;
}
.sweet-alert .icon.success::before,
.sweet-alert .icon.success::after {
  content: '';
  border-radius: 50%;
  position: absolute;
  width: 60px;
  height: 120px;
  background: white;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}
.sweet-alert .icon.success::before {
  border-radius: 120px 0 0 120px;
  top: -7px;
  left: -33px;
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
  -webkit-transform-origin: 60px 60px;
  transform-origin: 60px 60px;
}
.sweet-alert .icon.success::after {
  border-radius: 0 120px 120px 0;
  top: -11px;
  left: 30px;
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
  -webkit-transform-origin: 0px 60px;
  transform-origin: 0px 60px;
}
.sweet-alert .icon.success .placeholder {
  width: 80px;
  height: 80px;
  border: 4px solid rgba(92, 184, 92, 0.2);
  border-radius: 50%;
  box-sizing: content-box;
  position: absolute;
  left: -4px;
  top: -4px;
  z-index: 2;
}
.sweet-alert .icon.success .fix {
  width: 5px;
  height: 90px;
  background-color: #ffffff;
  position: absolute;
  left: 28px;
  top: 8px;
  z-index: 1;
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
}
.sweet-alert .icon.success .line {
  height: 5px;
  background-color: #5cb85c;
  display: block;
  border-radius: 2px;
  position: absolute;
  z-index: 2;
}
.sweet-alert .icon.success .line.tip {
  width: 25px;
  left: 14px;
  top: 46px;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}
.sweet-alert .icon.success .line.long {
  width: 47px;
  right: 8px;
  top: 38px;
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
}
.sweet-alert .icon.custom {
  background-size: contain;
  border-radius: 0;
  border: none;
  background-position: center center;
  background-repeat: no-repeat;
}
.sweet-alert .btn-default:focus {
  border-color: #cccccc;
  outline: 0;
  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(204, 204, 204, 0.6);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(204, 204, 204, 0.6);
}
.sweet-alert .btn-success:focus {
  border-color: #4cae4c;
  outline: 0;
  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(76, 174, 76, 0.6);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(76, 174, 76, 0.6);
}
.sweet-alert .btn-info:focus {
  border-color: #46b8da;
  outline: 0;
  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(70, 184, 218, 0.6);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(70, 184, 218, 0.6);
}
.sweet-alert .btn-danger:focus {
  border-color: #d43f3a;
  outline: 0;
  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(212, 63, 58, 0.6);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(212, 63, 58, 0.6);
}
.sweet-alert .btn-warning:focus {
  border-color: #eea236;
  outline: 0;
  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238, 162, 54, 0.6);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238, 162, 54, 0.6);
}
.sweet-alert button::-moz-focus-inner {
  border: 0;
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
header('Content-Type:text/html; charset=utf-8');
include 'class/sql.class.php';
$config['sql']['host'] = ''; // MySQL Host
$config['sql']['dbname'] = ''; // MySQL Database Name
$config['sql']['username'] = ''; // MySQL Username
$config['sql']['password'] = ''; // Password for the user
$db = new MySQL($config['sql']['dbname'], $config['sql']['username'], $config['sql']['password'], $config['sql']['host']);
$GLOBALS['db'] = $db;
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
</head>
<body>
    <form action="uploadfileiframe.php" enctype="multipart/form-data" method="post">
        <input id="file" name="file[]" type="file" multiple directory webkitdirectory mozdirectory required></br>
        <input id="submit" name="submit" type="submit" class="btn btn-primary" value="開始上傳">
        <a href="uploadiframe.php" class="btn btn-link">上傳檔案</a>
    </form>
</body>
</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
if (!session_id()) {
    session_start();
}
set_time_limit(10);
$show = true;
function sizecount($size)
{
    if ($size >= 0.001 && $size < 1) {
        echo round(($size * 1000), 2).'KB';
    } elseif ($size >= 1 && $size < 1000) {
        echo round($size, 2).'MB';
    } elseif ($size >= 1000) {
        echo round(($size / 1000), 2).'GB';
    }
}
function check_dir($id)
{
    $dir = $GLOBALS['db']->select('dir', array('id' => $id));
    if ($dir[0]['recycle'] == '1' || $dir[0]['share'] == '0') {
        return false;
    }
    if ($dir[0]['parent'] != '0') {
        $updir = $GLOBALS['db']->select('dir', array('id' => $dir[0]['parent']));
        if ($updir[0]['recycle'] == '1' || $updir[0]['share'] == '0') {
            return false;
        } else {
            return check_dir($updir[0]['id']);
        }
    } else {
        return true;
    }
}
$res = $db->select('file', array('id' => $_GET['id']));
if ($_SESSION['login'] && $_SESSION['username'] == $res[0]['owner'] && isset($_GET['download']) && $_GET['download'] == 'true') {
    header('Location: rdownfile.php?id='.$_GET['id'].'&download=true');
}
if ($res[0]['recycle'] == '1' || $res[0]['share'] == '0') {
    $show = false;
} else {
    if ($res[0]['dir'] != 0) {
        //if(!check_dir($res[0]["dir"])) $show = false;
    }
}
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $res[0]['name']; ?> - <?php echo $config['sitename'];?></title>
<meta charset="utf-8" />
<link href="css/bootstrap.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>body{ background-color: #F8F8F8; }</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
    <h1 class="text-center"><?php echo $config['sitetitle']; ?></h1>
        <?php
        if ($_SESSION['login']) {
            ?>
            <ul class="nav nav-tabs">
                <li><a href="index.php">首頁</a></li>
                <li><a href="logout.php">登出</a></li>
            </ul>
        <?php 
        } else {
            ?>
            <ul class="nav nav-tabs">
                <li><a href="index.php">首頁</a></li>
                <?php if ($config['why']) {
    ?><li><a href="why.php"><?php echo $config['sitename'];
    ?>的好處</a></li><?php 
}
            ?>
                <li><a href="login.php">登入</a></li>
                <?php if ($config['reg']) {
    ?><li><a href="reg.php">註冊</a></li><?php 
}
            ?>
                <?php if ($config['tos']) {
    ?><li><a href="tos.php">使用條款</a></li><?php 
}
            ?>
            </ul>
        <?php 
        } ?>
    <div class="jumbotron">
        <?php if ($show) {
    ?>
        <h1><?php echo $res[0]['name'];
    ?></h1>
        <p>擁有者：<?php echo $res[0]['owner'];
    ?></br>檔案大小：<?php sizecount($res[0]['size'] / 1000 / 1000);
    ?></br>上傳時間：<?php echo $res[0]['date'];
    ?></p>
        <p><a href="rdownfile.php?id=<?php echo htmlspecialchars($_GET['id']);
    ?>&password=<?php echo htmlspecialchars($_GET['password']);
    ?>" class="btn btn-large btn-primary">下載</a></p>
        <?php 
} else {
    ?>
        <h1>404 Not Found</h1>
        <p>此檔案不存在，可能不存在、已經被刪除或是被設定為不公開。</p>
        <?php 
} ?>
    </div>
    <p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</div>
</body>
</html>
Options -Indexes
<?php

/*
Allen Disk 1.5
Copyright (C) 2012~2015 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
header('HTTP/1.1 404 Not Found');
echo '404 Not Found';
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
@set_time_limit(20);
include 'config.php';
if (!session_id()) {
    session_start();
}
if (!$_SESSION['login']) {
    header('Location:login.php');
    exit();
}
function sizecount($size)
{
    if ($size < 0.001) {
        return round(($size * 1000 * 1000), 2).'B';
    } elseif ($size >= 0.001 && $size < 1) {
        return round(($size * 1000), 2).'KB';
    } elseif ($size >= 1 && $size < 1000) {
        return round($size, 2).'MB';
    } elseif ($size >= 1000) {
        return round(($size / 1000), 2).'GB';
    }
}

function getparentdir($id)
{
    global $dirlocation;
    if ($id != '0') {
        $p = $GLOBALS['db']->select('dir', array('id' => $id, 'owner' => $_SESSION['username'], 'recycle' => '0'));
        $dirlocation[] = array('id' => $id, 'name' => $p[0]['name']);
        if ($p[0]['parent'] != '0') {
            getparentdir($p[0]['parent']);
        }
    }
}

$info = $db->select('user', array('name' => $_SESSION['username']));
if (isset($_GET['dir']) && $_GET['dir'] != null) {
    $_SESSION['dir'] = $_GET['dir'];
} else {
    header('location: home.php?dir=0');
}
if ($_GET['dir'] != '0') {
    $dir = $db->select('dir', array('id' => $_GET['dir'], 'owner' => $_SESSION['username']));
    if ($dir[0]['name'] == null) {
        header('location: home.php?dir=0');
        exit();
    }
}
$dirlocation = array();
getparentdir($_GET['dir']);
$dirlocation = array_reverse($dirlocation);
?>
<!DOCTYPE html>
<html>
<head onselect='return false;'>
	<title>
		<?php echo $config[ 'sitename'];?>
	</title>
	<meta charset="utf-8" />
	<link href="css/bootstrap.min.css" rel="stylesheet">
	<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
	<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
	<script src="//netdna.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
	<script src="js/sweet-alert.min.js"></script>
    <link rel="stylesheet" href="css/sweet-alert.css">
	<script>
		var dir = '<?php echo $_SESSION['dir']; ?>';
	</script>
	<script src="js/modernizr.js" charset="utf-8"></script>
	<script src="js/script.js" charset="utf-8"></script>
	<style>
		html,
		body {
			height: 100%;
			/* 避免影響 jQuery selectable */
			
			-moz-user-select: none;
			-webkit-user-select: none;
		}
		
		#file_list_container {
			margin-top: 0;
			margin-bottom: 0;
			min-height: 100vh;
		}

		#contextMenu {
		  	position: absolute;
		  	display:none;
		  	z-index: 10000;
		}
		
		nav.dir_tree ul,
		nav.dir_tree li {
			margin: 0;
			padding: 0;
			list-style: none;
		}
		
		ul.list-home ul {
			border-left: 1px solid #DDD
		}
		
		nav.dir_tree ul li {
			margin-left: 15px
		}
		
		nav.dir_tree ul li a {
			color: #444
		}
		
		nav.dir_tree ul li.current>a,nav.dir_tree ul li.current>i {
			color: #2196f3
		}

		.tree_selected{
			background-color: #666666;
			color: #ffffff !important;
		}

		.filetreeselector:hover{
			cursor: pointer;
		}

		#color-tag .btn i {    			
			opacity: 0;				
		}
		#color-tag .btn.active i {				
			opacity: 1;				
		}
		.btn-black i {
			color:#FFF
		}

		.panel {
			border: 2px solid transparent;
			padding: 3px;
		}
		
		.panel-body {
			padding: 0;
			text-align: center;
			overflow: hidden;
		}
		
		.panel-body i {
			margin: 25px
		}
		
		.panel-body img {
			width: 100%
		}

		.panel-footer {
			height:3em;
			overflow:hidden;
		}
		
		.panel:hover,
		.panel:active {
			border-color: #2196f3;
		}

		.ui-selected {
			border-color: #1a78c2 !important;
		}

		.btn-black{
			background-color: #666666;
		}
		
		.tag-info {
			border-left: 4px solid #9C27B0 !important;
		}
		
		.tag-success {
			border-left: 4px solid #4CAF50 !important;
		}
		
		.tag-warning {
			border-left: 4px solid #FF9800 !important;
		}
		
		.tag-danger {
			border-left: 4px solid #E51C23 !important;
		}
		
		.tag-active {
			border-left: 4px solid #BBB !important;
		}

		.tag-black {
			border-left: 4px solid #666666 !important;
		}
		
		.tag-primary {
			border-left: 4px solid #2196F3 !important;
		}
		
		button.btn-arrow {
			padding: 5px !important
		}
		
		#usage_box {
			padding: 0
		}
		
		#usage_box p,#usage_box ul {
			padding: 0 10px;
		}
		
		.modal-dialog {
			z-index: 1050;
		}
		
		.dragover_box {
			background-color: #f8f8f8 !important;
		}

		.ui-selectable-helper{
            border: 1px solid #a9a9a9;
            background-color: rgba(169,169,169,0.3);
        }
	</style>
</head>

<body>
	<nav class="navbar navbar-default navbar-fixed-top">
		<div class="container-fluid" style="max-width:1170px">
			<div class="col-md-2">
				<div class="navbar-header">
					<a class="navbar-brand" href="home.php?dir=0">
						<?php echo $config[ 'sitetitle']; ?>
					</a>
				</div>
			</div>
			<div class="col-md-8">
				<div class="collapse navbar-collapse">
					<div class="nav navbar-form navbar-left">
						<div class="btn-group btn-group-sm">
							<a href="home.php?dir=0" class="btn <?php echo ($_GET['dir'] == '0') ? 'btn-primary' : 'btn-default'; ?>"><i class="fa fa-home"></i> 首頁</a>
							<?php
                                if (!empty($dirlocation)) {
                                    foreach ($dirlocation as $key => $value) {
                                        ?>
										<button class="btn btn-default btn-arrow"><i class="fa fa-caret-right"></i></button>
										<a href="home.php?dir=<?php echo $value['id'];
                                        ?>" class="btn <?php echo ($value['id'] == $_GET['dir']) ? 'btn-primary' : 'btn-default';
                                        ?>"><i class="fa fa-folder"></i> <?php echo $value['name'];
                                        ?></a>
								<?php	
                                    }
                                }
                            ?>
						</div>
					</div>
					<div class="pull-left btn-group" id="action_btn_multi" style="display:none;">
					    <button class="btn btn-danger" type="button" id="delete-btn">刪除</button>
					    <button class="btn btn-default" type="button" id="move-btn">移動</button>
					    <button class="btn btn-primary" type="button" id="tag-btn">標記</button>
					</div>
				</div>
			</div>
			<div class="col-md-2">
				<ul class="nav navbar-nav navbar-right">
                    <li class="dropdown">
						<a href="#" id="user-info-btn" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> <?php echo $_SESSION[ 'username']?> <small><i class="fa fa-chevron-down"></i></small></a>
                        <ul class="dropdown-menu" id="user-info">
                            <li>
                                <div class="navbar-login" style="padding:5px 15px;width:200px;max-width:250px">
									<h5>帳號資訊</h5>
									<i class="fa fa-user fa-fw"></i> <?php echo $_SESSION['username']?><br/>
                                    <i class="fa fa-envelope fa-fw"></i> <?php echo $info[0]['email']?><br/>
                                    <i class="fa fa-history fa-fw"></i> <?php echo $info[0]['jointime']?>
                                </div>
                            </li>
							<li><a href="#" id="info-btn"><i class="fa fa-lock"></i> 更改密碼</a></li>
                            <li class="divider"></li>
                            <li><a href="logout.php"><i class="fa fa-power-off"></i> 登出</a></li>
                        </ul>
                    </li>
				</ul>
			</div>
		</div>
	</nav>
	<div class="container" style="margin:100px auto">
		<div class="col-md-3">
			<div class="well">
				<nav class="dir_tree">
					<div class="btn-group btn-group-justified">
						<a href="#" class="btn btn-primary" id="upload-btn"><i class="fa fa-upload"></i> 上傳檔案</a>
						<a href="#" class="btn btn-success" id="mkdir-btn"><i class="fa fa-plus"></i> 新資料夾</a>
					</div>
					<br/>
						<li<?php if ($_GET['dir'] == '0') {
    echo ' class="current"';
} ?>><i class="fa fa-home"></i> <a href="home.php?dir=0" data-id="0"  <?php if ($_GET['dir'] != '0') {
    echo ' style="color:#444;"';
} ?>>主目錄</a>
							<ul class="list-home" id="dir-tree">
							</ul>
						</li>
					<br/>
					<button class="btn btn-danger btn-block btn-sm" id="recycle-btn"><i class="fa fa-trash"></i> 垃圾桶</button>
				</nav>
			</div>
			<div class="well" id="usage_box"></div>
		</div>
		<div class="col-md-9">
			<div id="file_list_container"></div>
		</div>
	</div>
	<nav class="navbar navbar-default navbar-fixed-bottom">
		<div class="container-fluid text-center text-info">
			Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a>
		</div>
	</nav>
	<div id="contextMenu" class="dropdown clearfix">
	    <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu" style="display:block;position:absolute;margin-bottom:5px;">
	    </ul>
	</div>
	<div id="upload-file" class="modal fade">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h3>上傳檔案</h3>
				</div>
				<div class="modal-body">
					<p>檔案大小限制：
						<?php echo ($config[ 'size'] != 0) ? sizecount($config[ 'size']) : '無'; ?><?php if ($config['tos']) {
    ?>，當您上傳檔案，代表您已經同意<a href="tos.php" target="_blank">使用條款</a>了，如果您不同意，請勿上傳任何檔案<?php 
} ?></p>
					<p>如果您的瀏覽器較為老舊，或是要上傳較多檔案，請使用傳統上傳。 拖曳上傳如果卡在 100% ，代表正在進行加密程序，請耐心等候。</p>
					<p class="text-center"><a href="#" class="btn btn-info" id="ajax_upload_btn">拖曳上傳</a>&nbsp;<a href="#" class="btn btn-info" id="traditional_upload_btn">傳統上傳</a>&nbsp;<a href="#" class="btn btn-info" id="remote_upload_btn">遠端上傳</a>
					</p>
					<div id="upload_box" style="width:100%; height:200px; background-color:#eeeeee; -webkit-border-radius: 10px;-moz-border-radius: 10px;border-radius: 10px;">
						<div style="margin:0 auto; width:50%; font-size:25px; text-align:center; padding:50px;">
							<span>拖拉到此上傳</span>
							<br /><span style="font-size:15px;">或</span>
							<br />
							<div style="height:44px; width:94px; margin:0 auto;">
								<button class="btn primary" id="upload_button">瀏覽檔案</button>
								<input id="file" name="file[]" type="file" style="opacity:0 ;margin-top: -44px;width: 93px;height: 44px;" multiple>
								<br />
							</div>
						</div>
					</div>
					<div class="progress" id="upload_progress_box" style="margin-top:20px;">
						<div class="progress-bar progress-bar-striped active" id="upload_progress" style="width: 0%"></div>
					</div>
					<div id="upload_table_box">
						<table class="table">
							<tbody id="upload_table">
								<tr>
									<td>檔案名稱</td>
									<td>檔案大小</td>
									<td>上傳結果</td>
								</tr>
							</tbody>
						</table>
					</div>
					<iframe src="uploadiframe.php" style="border:none; width:100%; height:200px; display:none;" id="upload_iframe">您的瀏覽器暫時不支援 iframe </iframe>
					<iframe src="remotedownload.php" style="border:none; width:100%; height:200px; display:none;" id="remote_iframe">您的瀏覽器暫時不支援 iframe </iframe>
				</div>
				<div class="modal-footer">
					<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">關閉</button>
				</div>
			</div>
		</div>
	</div>
	<div id="preview-file" class="modal fade">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h3>預覽檔案</h3>
				</div>
				<div class="modal-body">
					<iframe onload="javascript:resizeIframe(this);" src="preview.php" id="preview-iframe" style="border:none; width:100%; height:100%;">您的瀏覽器暫時不支援 iframe </iframe>
				</div>
				<div class="modal-footer">
					<button class="btn" data-dismiss="modal" aria-hidden="true">關閉</button>
				</div>
			</div>
		</div>
	</div>
	<div id="info-modal" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h3>更改密碼</h3>
				</div>
				<div class="modal-body">
					<iframe src="setpass.php" style="border:none; width:100%;">您的瀏覽器暫時不支援 iframe ，請使用 <a href="setpass.php">此連結</a> 修改</iframe>
				</div>
				<div class="modal-footer">
					<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">關閉</button>
				</div>
			</div>
		</div>
	</div>
	<div id="mkdir-modal" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h3>新增資料夾</h3>
				</div>
				<div class="modal-body">
					<iframe src="mkdir.php" style="border:none; width:100%; height:200px;">您的瀏覽器暫時不支援 iframe ，請使用 <a href="mkdir.php">此連結</a> 新增</iframe>
				</div>
				<div class="modal-footer">
					<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">關閉</button>
				</div>
			</div>
		</div>
	</div>
	<div id="mvfile-modal" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h3>移動檔案</h3>
				</div>
				<div class="modal-body">
					<nav class="dir_tree">
					<ul>
						<li><i class="fa fa-home"></i> <a data-id="0" class="filetreeselector">主目錄</a>
							<ul class="list-home" id="ajax_load_tree"></ul>
						</li>
					<ul>
					</nav>
				</div>
				<div class="modal-footer">
					<button class="btn btn-primary" id="move-submit-btn">移動檔案</button>
					<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">關閉</button>
				</div>
			</div>
		</div>
	</div>
	<div id="recycle-box" class="modal fade">
		<div class="modal-lg modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h3>回收筒</h3>
				</div>
				<div class="modal-body">
					<button class="btn btn-default" id="real_delete_all">清空</button>
					<table class="table">
						<thead>
							<tr>
								<td>檔案名稱</td>
								<td style="max-width: 400px;">檔案類型</td>
								<td>原始位置</td>
								<td style="min-width: 200px;">動作</td>
							</tr>
						</thead>
						<tbody id="recycle_list">
						</tbody>
					</table>
				</div>
				<div class="modal-footer">
					<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">關閉</button>
				</div>
			</div>
		</div>
	</div>
	<div id="color-tag" class="modal fade">
		<div class="modal-sm modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h3>顏色標注</h3>
				</div>
				<div class="modal-body">
				<!--
					<button type="button" class="btn btn-lg btn-block color-tag-btn btn-default" id="">無色</button>
					<button type="button" class="btn btn btn-lg btn-block color-tag-btn" id="active">灰色</button>
					<button type="button" class="btn btn btn-lg btn-block color-tag-btn btn-primary" id="primary">藍色</button>
					<button type="button" class="btn btn-success btn-lg btn-block color-tag-btn" id="success">綠色</button>
					<button type="button" class="btn btn-info btn-lg btn-block color-tag-btn" id="info">紫色</button>
					<button type="button" class="btn btn-warning btn-lg btn-block color-tag-btn" id="warning">黃色</button>
					<button type="button" class="btn btn-danger btn-lg btn-block color-tag-btn" id="danger">紅色</button>
				-->
					<div class="btn-group btn-group-sm btn-group-justified" data-toggle="buttons">

						<label class="btn btn-default color-tag-btn" id=""><!--default 是白色所以 id 不用設定-->
							<input type="radio" autocomplete="off" name='color-tag'>
							<i class="fa fa-check"></i>
						</label>
						<label class="btn color-tag-btn btn-black" id="black">
							<input type="radio" autocomplete="off" name='color-tag'>
							<i class="fa fa-check"></i>
						</label>
						<label class="btn btn-success color-tag-btn" id="success">
							<input type="radio" autocomplete="off" name='color-tag'>
							<i class="fa fa-check"></i>
						</label>
						<label class="btn btn-primary color-tag-btn" id="primary">
							<input type="radio" autocomplete="off" name='color-tag'>
							<i class="fa fa-check"></i>
						</label>			
						<label class="btn btn-info color-tag-btn" id="info">
							<input type="radio" autocomplete="off" name='color-tag'>
							<i class="fa fa-check"></i>
						</label>			
						<label class="btn btn-warning color-tag-btn" id="warning">
							<input type="radio" autocomplete="off" name='color-tag'>
							<i class="fa fa-check"></i>
						</label>			
						<label class="btn btn-danger color-tag-btn" id="danger">
							<input type="radio" autocomplete="off" name='color-tag'>
							<i class="fa fa-check"></i>
						</label>			
					</div>
				</div>
				<div class="modal-footer">
					<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">關閉</button>
				</div>
			</div>
		</div>
	</div>
</body>

</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
if (!session_id()) {
    session_start();
}
if (!file_exists('install/install.lock')) {
    header('Location: install/index.php');
    exit();
}
if (isset($_SESSION['login']) && $_SESSION['login'] === true) {
    header('Location:home.php');
    exit();
}
?>
<!DOCTYPE html>
<html>
<head>
    <title><?php echo $config['sitename'];?></title>
    <meta charset="utf-8" />
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
    <script src="js/script.js"></script>
    <style>body{ background-color: #F8F8F8; }</style>
</head>
<body>
<div class="container">
    <h1 class="text-center"><?php echo $config['sitetitle']; ?></h1>
        <ul class="nav nav-tabs">
            <li><a href="index.php">首頁</a></li>
            <?php if ($config['why']) {
    ?><li><a href="why.php"><?php echo $config['sitename'];
    ?>的好處</a></li><?php 
} ?>
            <li><a href="login.php">登入</a></li>
            <?php if ($config['reg']) {
    ?><li><a href="reg.php">註冊</a></li><?php 
} ?>
            <?php if ($config['tos']) {
    ?><li><a href="tos.php">使用條款</a></li><?php 
} ?>
        </ul>
    <div class="jumbotron">
    <h1><?php echo $config['sitename'];?></h1>
    <p><?php echo $config['subtitle'];?></p>
    <p>
        <?php if ($config['why']) {
    ?><a href="why.php" class="btn btn-primary btn-large">為何使用<?php echo $config['sitename'];
    ?></a><?php 
} ?>
    </p>
</div>
<p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</div>
</body>
</html>
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
header('Content-Type:text/html; charset=utf-8');
include 'class/sql.class.php';
$config['sql']['host'] = '%s'; // MySQL Host
$config['sql']['dbname'] = '%s'; // MySQL Database Name
$config['sql']['username'] = '%s'; // MySQL Username
$config['sql']['password'] = '%s'; // Password for the user
$db = new MySQL($config['sql']['dbname'], $config['sql']['username'], $config['sql']['password'], $config['sql']['host']);
$GLOBALS['db'] = $db;
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
if (file_exists('install.lock')) {
    header('Location: ../index.php');
    exit();
}
function check($val)
{
    global $error;
    if ($val) {
        echo '<span style="color:green;">√</span>';
    } else {
        $error = true;
        echo '<span style="color:red;">Χ</span>';
    }
}

function check_php_version($version)
{
    check(phpversion() >= $version);
}

function check_extension($ext)
{
    check(extension_loaded($ext));
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>Allen Disk安裝程序</title>
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
    <style>body{ background-color: #F8F8F8; }</style>
</head>
<body>
<div class="container">
    <h1 class="text-center">Allen Disk安裝程序</h1>
    <ul class="nav nav-tabs">
        <li class="active"><a href="#">環境檢查</a></li>
        <li><a href="#">安裝模式</a></li>
        <li><a href="#">MySQL 連線資訊</a></li>
        <li><a href="#">網站設定</a></li>
        <li><a href="#">新增帳號</a></li>
    </ul>
    <h2>安裝環境檢測</h2>
        <table class="table table-hover">
            <tr>
                <th width="30%">項目</th>
                <th width="25%">最低配置</th>
                <th width="25%">最佳配置</th>
                <th width="20%">檢測結果</th>
            </tr>
            <tr>
                <td>PHP</td>
                <td>5.3.7 以上</td>
                <td>5.5 以上</td>
                <td><?php check_php_version(5.3); ?></td>
            </tr>
            <tr>
                <td>Multibyte String 函式庫</td>
                <td>必須支援</td>
                <td>必須支援</td>
                <td><?php check_extension('mbstring'); ?></td>
            </tr>
            <tr>
                <td>Mysqli 函式庫 </td>
                <td>必須支援</td>
                <td>必須支援</td>
                <td><?php check_extension('mysqli'); ?></td>
            </tr>
            <tr>
                <td>Mcrypt 函式庫</td>
                <td>必須支援</td>
                <td>必須支援</td>
                <td><?php check_extension('mcrypt'); ?></td>
            </tr>
            <tr>
                <td>GD 函式庫</td>
                <td>必須支援</td>
                <td>必須支援</td>
                <td><?php check_extension('gd'); ?></td>
            </tr>
        </table>
        <h2>權限檢測</h2>
        <table class="table table-hover">
            <tr>
                <th width="30%">項目</th>
                <th width="25%">所需權限</th>
                <th width="20%">檢測結果</th>
            </tr>
            <tr>
                <td>database.php</td>
                <td>可寫</td>
                <td><?php check(is_writable(dirname(dirname(__FILE__)).'/database.php')); ?></td>
            </tr>
            <tr>
                <td>database-sample.php</td>
                <td>可讀</td>
                <td><?php check(is_readable('database-sample.php')); ?></td>
            </tr>
            <tr>
                <td>install.sql</td>
                <td>可讀</td>
                <td><?php check(is_writable('install.sql')); ?></td>
            </tr>
            <tr>
                <td>/file</td>
                <td>可寫</td>
                <td><?php check(is_writable(dirname(dirname(__FILE__)).'/file')); ?></td>
            </tr>
        </table>
        <p><?php if ($error) {
    ?><span style="color:red;">您必須解決以上問題才能繼續安裝</span><!--當然你可以用直接瀏覽 install-method.php 的方式來繞過檢測，但是到時無法正常運作是你家的事，我不負責--><?php 
} else {
    ?><a href="install-method.php" class="btn btn-primary">下一步</a><?php 
} ?></p>
</div>
<p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</body>
</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
?>
<!DOCTYPE html>
<html>
<head>
<title>Allen Disk安裝程序</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<style>body{ background-color: #F8F8F8; }</style>
<?php if (isset($_GET['fin']) && $_GET['fin'] == 'fin') {
    echo '<meta http-equiv="refresh" content="3; url=../index.php">';
} ?>
</head>
<body>
<div class="container">
    <h1 class="text-center">Allen Disk安裝程序</h1>
    <ul class="nav nav-tabs">
            <li><a href="#">環境檢查</a></li>
            <li><a href="#">MySQL 連線資訊</a></li>
            <li><a href="#">網站設定</a></li>
            <li><a href="#">新增帳號</a></li>
    </ul>
<?php
if (file_exists('install.lock') && !isset($_GET['fin'])) {
    ?>
    <div class="alert alert-warning" role="alert">很抱歉，Allen Disk已經安裝完成，如果要重新進行安裝，請刪除 /install/install.lock</div>
<?php 
} elseif (isset($_GET['fin']) && $_GET['fin'] == 'fin') {
    ?>
    <div class="alert alert-success" role="alert">恭喜！Allen Disk已經安裝完成，您即將被導引至首頁</div>
<?php 
} elseif (!file_exists('install.lock') && !isset($_GET['fin'])) {
    ?>
    <script>window.location.href = 'env-check.php';</script>
<?php 
} ?>
</div>
<p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</body>
</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
if (file_exists('install.lock')) {
    header('Location: ../index.php');
    exit();
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>Allen Disk安裝程序</title>
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
    <style>body{ background-color: #F8F8F8; }</style>
</head>
<body>
<div class="container">
    <h1 class="text-center">Allen Disk安裝程序</h1>
    <ul class="nav nav-tabs">
        <li><a href="#">環境檢查</a></li>
        <li class="active"><a href="#">安裝模式</a></li>
        <li><a href="#">MySQL 連線資訊</a></li>
        <li><a href="#">網站設定</a></li>
        <li><a href="#">新增帳號</a></li>
    </ul>
    <br />
    <div>
        <a href="mysql-setting.php" class="btn btn-primary btn-lg btn-block">全新安裝</a>
        <p>如果您已經有 1.5 版且正常運作，請留下 /file 與 database.php ，其餘直接覆蓋後即完成更新程序</p>
    </div>
</div>
<p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</body>
</html>
CREATE TABLE IF NOT EXISTS `dir` (`id` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`name` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`owner` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`parent` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,`recycle` int(11) NOT NULL DEFAULT '0',`share` int(11) NOT NULL DEFAULT '0',`color` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `file` (`name` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,`size` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`owner` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`secret` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`id` varchar(256) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`realname` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`type` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`dir` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`recycle` int(11) NOT NULL DEFAULT '0',`share` int(11) NOT NULL DEFAULT '0',`color` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `setting` (`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`value` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `user` (`name` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`pass` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`email` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,`jointime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `setting` (`name`, `value`) VALUES('sitename', 'Allen Disk'),('sitetitle', 'Allen Disk'),('size', '10000'),('url', 'url'),('total', '10000'),('reg', 'true'),('why', 'true'),('updatesec', '5'),('tos', 'true'),('admin', '1234'),('subtitle', '最先進，最大方，最安全的網路硬碟');
ALTER TABLE `dir` ADD PRIMARY KEY (`id`);
ALTER TABLE `file` ADD PRIMARY KEY (`id`);
ALTER TABLE `setting` ADD PRIMARY KEY (`name`);
ALTER TABLE `user` ADD PRIMARY KEY (`name`);
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
if (file_exists('install.lock')) {
    header('Location: ../index.php');
    exit();
}
$error = false;
$errormsg = null;
try {
    if (isset($_POST['dbname']) && $_POST['dbname'] != '') {
        $mysql_file = '../database.php';
        $mysql_sample_file = 'database-sample.php';
        $mysql_config = vsprintf(file_get_contents($mysql_sample_file), array(
            addslashes($_POST['host']),
            addslashes($_POST['dbname']),
            addslashes($_POST['username']),
            addslashes($_POST['password']),
        ));

        file_put_contents($mysql_file, $mysql_config);
    }

    require_once '../database.php';

    $query = file('install.sql');
    foreach ($query as $val) {
        $result = $db->ExecuteSQL($val);
        if (!$result) {
            throw new Exception($db->lastError);
        }
    }
} catch (Exception $e) {
    $error = true;
    $errormsg = array(
        'type' => 'SQL Insert Error',
        'line' => __LINE__,
        'file' => dirname(__FILE__).';'.__FILE__,
        'errormsg' => $e->getMessage(),
    );
}
if ($error) {
    echo 'SQL 發生錯誤：';
    print_r($errormsg);
    echo '若您無法自行解決，請嘗試聯絡 Allen Disk 開發者，或直接聯絡 Allen ( <a href="mailto:s3131212@gmail.com">s3131212@gmail.com</a> ) ，並將此頁訊息完整題交給我們，我們會儘速為您解答';
} else {
    if ($_GET['update'] != 'true') {
        header('Location:site-setting.php');
    } else {
        $install_token = fopen('install.lock', 'w');
        fclose($install_token);
        header('Location: index.php?fin=fin');
    }
}
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
if (file_exists('install.lock')) {
    header('Location: ../index.php');
    exit();
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>Allen Disk安裝程序</title>
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
    <style>body{ background-color: #F8F8F8; }</style>
</head>
<body>
<div class="container">
    <h1 class="text-center">Allen Disk安裝程序</h1>
    <ul class="nav nav-tabs">
        <li><a href="#">環境檢查</a></li>
        <li><a href="#">安裝模式</a></li>
        <li class="active"><a href="#">MySQL 連線資訊</a></li>
        <li><a href="#">網站設定</a></li>
        <li><a href="#">新增帳號</a></li>
    </ul>
    <form method="post" action="mysql-set.php">
        <table class="table table-hover">
            <thead>
                <tr>
                    <td>名稱</td>
                    <td>值</td>
                    <td>註解</td>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>MySQL 伺服器</td>
                    <td><input type="text" value="localhost" name="host" id="host" class="form-control" /></td>
                    <td>MySQL伺服器網址 / IP ，本機可用 localhost</td>
                </tr>
                <tr>
                    <td>MySQL 使用者名稱</td>
                    <td><input type="text" value="" name="username" id="username" class="form-control" /></td>
                    <td>MySQL 使用者名稱，基於安全性請盡量不要使用 root</td>
                </tr>
                <tr>
                    <td>MySQL 使用者密碼</td>
                    <td><input type="text" value="" name="password" id="password" class="form-control" /></td>
                    <td>MySQL 使用者密碼</td>
                </tr>
                <tr>
                    <td>MySQL 資料庫名稱</td>
                    <td><input type="text" value="" name="dbname" id="dbname" class="form-control" /></td>
                    <td>MySQL 資料庫名稱，請預先新增好此資料庫，安裝程式會自動為您處理資料庫結構</td>
                </tr>
            </tbody>
        </table>
    <input type="submit" value="送出" class="btn btn-primary">
    </form>
</div>
<p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</body>
</html>
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
if (file_exists('install.lock')) {
    header('Location: ../index.php');
    exit();
}
require '../config.php';
include '../class/password_compat.php';
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password'];
if ($username == '') {
    header('Location: newuser-setting.php?err=0');
    exit();
}
if ($email == '') {
    header('Location: newuser-setting.php?err=0');
    exit();
}
if ($password == '') {
    header('Location: newuser-setting.php?err=0');
    exit();
}
$db->insert(array('name' => $username, 'pass' => password_hash($password, PASSWORD_DEFAULT), 'email' => $email), 'user');
$install_token = fopen('install.lock', 'w');
fclose($install_token);
header('Location: index.php?fin=fin');
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
if (file_exists('install.lock')) {
    header('Location: ../index.php');
    exit();
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>Allen Disk安裝程序</title>
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
    <style>body{ background-color: #F8F8F8; }</style>
</head>
<body>
<div class="container">
    <h1 class="text-center">Allen Disk安裝程序</h1>
    <ul class="nav nav-tabs">
        <li><a href="#">環境檢查</a></li>
        <li><a href="#">安裝模式</a></li>
        <li><a href="#">MySQL 連線資訊</a></li>
        <li><a href="#">網站設定</a></li>
        <li class="active"><a href="#">新增帳號</a></li>
    </ul>
    <?php 
    if (isset($_GET['err']) && $_GET['err'] == '0') {
        echo '<div class="alert alert-danger">不能有任何欄位是空白的</div>';
    }
    ?>
    <form method="post" action="newuser-set.php">
        <div class="form-group">
            <label for="username">帳號</label>
            <input type="text" class="form-control" id="username" placeholder="帳號" name="username">
        </div>
        <div class="form-group">
            <label for="password">密碼</label>
            <input type="text" class="form-control" id="password" placeholder="密碼" name="password">
        </div>
        <div class="form-group">
            <label for="email">Email</label>
            <input type="email" class="form-control" id="email" placeholder="Email" name="email">
        </div>
    <input type="submit" value="送出" class="btn btn-primary">
    </form>
</div>
<p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</body>
</html>
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
if (file_exists('install.lock')) {
    header('Location: ../index.php');
    exit();
}
function check_set($key)
{
    if (isset($_POST[$key]) && $_POST[$key] != null) {
        return true;
    } else {
        return false;
    }
}
require '../config.php';
if (!(check_set('sitename') && check_set('sitetitle') && check_set('size') && check_set('url') && check_set('total') && check_set('admin') && check_set('subtitle'))) {
    echo '<script>alert("請確認所有空格都有填寫"); window.history.go(-1);</script>';
    exit();
}
$db->update('setting', array('value' => $_POST['sitename']), array('name' => 'sitename'));
$db->ExecuteSQL(sprintf("UPDATE `setting` SET `value` = '%s' WHERE `setting`.`name` = 'sitetitle';", $db->databaseLink->real_escape_string($_POST['sitetitle'])));
$db->update('setting', array('value' => $_POST['size']), array('name' => 'size'));
$db->update('setting', array('value' => $_POST['url']), array('name' => 'url'));
$db->update('setting', array('value' => $_POST['total']), array('name' => 'total'));
$db->update('setting', array('value' => $_POST['admin']), array('name' => 'admin'));
$db->update('setting', array('value' => $_POST['subtitle']), array('name' => 'subtitle'));

if (isset($_POST['tos']) && $_POST['tos'] != 'true') {
    $tos = 'false';
} else {
    $tos = 'true';
}
$db->update('setting', array('value' => $tos), array('name' => 'tos'));
if (isset($_POST['why']) && $_POST['why'] != 'true') {
    $why = 'false';
} else {
    $why = 'true';
}
$db->update('setting', array('value' => $why), array('name' => 'why'));
if (isset($_POST['reg']) && $_POST['reg'] != 'true') {
    $reg = 'false';
} else {
    $reg = 'true';
}
$db->update('setting', array('value' => $reg), array('name' => 'reg'));
header('location:newuser-setting.php');
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
if (file_exists('install.lock')) {
    header('Location: ../index.php');
    exit();
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>Allen Disk安裝程序</title>
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
    <style>body{ background-color: #F8F8F8; }</style>
</head>
<body>
<div class="container">
    <h1 class="text-center">Allen Disk安裝程序</h1>
    <ul class="nav nav-tabs">
        <li><a href="#">環境檢查</a></li>
        <li><a href="#">安裝模式</a></li>
        <li><a href="#">MySQL 連線資訊</a></li>
        <li class="active"><a href="#">網站設定</a></li>
        <li><a href="#">新增帳號</a></li>
    </ul>
    <form method="post" action="site-set.php">
        <table class="table table-hover">
            <thead>
                <tr>
                    <td>名稱</td>
                    <td>值</td>
                    <td>註解</td>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>網頁標題</td>
                    <td><input type="text" value="" name="sitename" id="sitename" class="form-control" /></td>
                    <td>顯示在&lt;title&gt;，所以別使用HTML Tag</td>
                </tr>
                <tr>
                    <td>網頁名稱</td>
                    <td><input type="text" value="" name="sitetitle" id="sitetitle" class="form-control" /></td>
                    <td>可以利用&lt;img&gt;來顯示Logo</td>
                </tr>
                <tr>
                    <td>上傳單檔大小限制</td>
                    <td><input type="text" value="" name="size" id="size" class="form-control" /></td>
                    <td>單一檔案上傳最大限制，單位為MB，1000MB = 1GB，必須 ≤ upload_max_filesize & post_max_size ， 0 代表無限</td>
                </tr>
                <tr>
                    <td>使用者空間</td>
                    <td><input type="text" value="" name="total" id="total" class="form-control" /></td>
                    <td>單一使用者最大可用空間，單位為MB，1000MB = 1GB ， 0 代表無限</td>
                </tr>
                <tr>
                    <td>網站網址</td>
                    <td><input type="text" value="" name="url" id="url" class="form-control" /></td>
                    <td>填入「首頁網址」而非管理員介面網址，記得加上" http(s):// "和網址最後的" / "</td>
                </tr>
                <tr>
                    <td>標語</td>
                    <td><input type="text" value="" name="subtitle" id="subtitle" class="form-control" /></td>
                    <td>顯示在首頁的標語</td>
                </tr>
                <tr>
                    <td>啟用註冊功能</td>
                    <td><input type="checkbox" name="reg" id="reg" value="true" /></td>
                    <td>允許使用者註冊帳號，個人用網路硬碟請勿勾選</td>
                </tr>
                <tr>
                    <td>顯示「為何選用XXX」</td>
                    <td><input type="checkbox" name="why" id="why" value="true" /></td>
                    <td>內容請至why.php修改</td>
                </tr>
                <tr>
                    <td>顯示「使用條款」</td>
                    <td><input type="checkbox" name="tos" id="tos" value="true" /></td>
                    <td>單一使用者可以使用的空間</td>
                </tr>
                <tr>
                    <td>管理員密碼</td>
                    <td><input type="text" value="" name="admin" id="admin" class="form-control" /></td>
                    <td>到管理介面的密碼</td>
                </tr>
            </tbody>
        </table>
    <input type="submit" value="送出" class="btn btn-primary">
    </form>
</div>
<p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</body>
</html>
(function(h,o,g){var p=function(){for(var b=/audio(.min)?.js.*/,a=document.getElementsByTagName("script"),c=0,d=a.length;c<d;c++){var e=a[c].getAttribute("src");if(b.test(e))return e.replace(b,"")}}();g[h]={instanceCount:0,instances:{},flashSource:'      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="$1" width="1" height="1" name="$1" style="position: absolute; left: -1px;">         <param name="movie" value="$2?playerInstance='+h+'.instances[\'$1\']&datetime=$3">         <param name="allowscriptaccess" value="always">         <embed name="$1" src="$2?playerInstance='+
h+'.instances[\'$1\']&datetime=$3" width="1" height="1" allowscriptaccess="always">       </object>',settings:{autoplay:false,loop:false,preload:true,imageLocation:p+"player-graphics.gif",swfLocation:p+"audiojs.swf",useFlash:function(){var b=document.createElement("audio");return!(b.canPlayType&&b.canPlayType("audio/mpeg;").replace(/no/,""))}(),hasFlash:function(){if(navigator.plugins&&navigator.plugins.length&&navigator.plugins["Shockwave Flash"])return true;else if(navigator.mimeTypes&&navigator.mimeTypes.length){var b=
navigator.mimeTypes["application/x-shockwave-flash"];return b&&b.enabledPlugin}else try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return true}catch(a){}return false}(),createPlayer:{markup:'          <div class="play-pause">             <p class="play"></p>             <p class="pause"></p>             <p class="loading"></p>             <p class="error"></p>           </div>           <div class="scrubber">             <div class="progress"></div>             <div class="loaded"></div>           </div>           <div class="time">             <em class="played">00:00</em>/<strong class="duration">00:00</strong>           </div>           <div class="error-message"></div>',
playPauseClass:"play-pause",scrubberClass:"scrubber",progressClass:"progress",loaderClass:"loaded",timeClass:"time",durationClass:"duration",playedClass:"played",errorMessageClass:"error-message",playingClass:"playing",loadingClass:"loading",errorClass:"error"},css:'        .audiojs audio { position: absolute; left: -1px; }         .audiojs { width: 460px; height: 36px; background: #404040; overflow: hidden; font-family: monospace; font-size: 12px;           background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #444), color-stop(0.5, #555), color-stop(0.51, #444), color-stop(1, #444));           background-image: -moz-linear-gradient(center top, #444 0%, #555 50%, #444 51%, #444 100%);           -webkit-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); -moz-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3);           -o-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); }         .audiojs .play-pause { width: 25px; height: 40px; padding: 4px 6px; margin: 0px; float: left; overflow: hidden; border-right: 1px solid #000; }         .audiojs p { display: none; width: 25px; height: 40px; margin: 0px; cursor: pointer; }         .audiojs .play { display: block; }         .audiojs .scrubber { position: relative; float: left; width: 280px; background: #5a5a5a; height: 14px; margin: 10px; border-top: 1px solid #3f3f3f; border-left: 0px; border-bottom: 0px; overflow: hidden; }         .audiojs .progress { position: absolute; top: 0px; left: 0px; height: 14px; width: 0px; background: #ccc; z-index: 1;           background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ccc), color-stop(0.5, #ddd), color-stop(0.51, #ccc), color-stop(1, #ccc));           background-image: -moz-linear-gradient(center top, #ccc 0%, #ddd 50%, #ccc 51%, #ccc 100%); }         .audiojs .loaded { position: absolute; top: 0px; left: 0px; height: 14px; width: 0px; background: #000;           background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #222), color-stop(0.5, #333), color-stop(0.51, #222), color-stop(1, #222));           background-image: -moz-linear-gradient(center top, #222 0%, #333 50%, #222 51%, #222 100%); }         .audiojs .time { float: left; height: 36px; line-height: 36px; margin: 0px 0px 0px 6px; padding: 0px 6px 0px 12px; border-left: 1px solid #000; color: #ddd; text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5); }         .audiojs .time em { padding: 0px 2px 0px 0px; color: #f9f9f9; font-style: normal; }         .audiojs .time strong { padding: 0px 0px 0px 2px; font-weight: normal; }         .audiojs .error-message { float: left; display: none; margin: 0px 10px; height: 36px; width: 400px; overflow: hidden; line-height: 36px; white-space: nowrap; color: #fff;           text-overflow: ellipsis; -o-text-overflow: ellipsis; -icab-text-overflow: ellipsis; -khtml-text-overflow: ellipsis; -moz-text-overflow: ellipsis; -webkit-text-overflow: ellipsis; }         .audiojs .error-message a { color: #eee; text-decoration: none; padding-bottom: 1px; border-bottom: 1px solid #999; white-space: wrap; }                 .audiojs .play { background: url("$1") -2px -1px no-repeat; }         .audiojs .loading { background: url("$1") -2px -31px no-repeat; }         .audiojs .error { background: url("$1") -2px -61px no-repeat; }         .audiojs .pause { background: url("$1") -2px -91px no-repeat; }                 .playing .play, .playing .loading, .playing .error { display: none; }         .playing .pause { display: block; }                 .loading .play, .loading .pause, .loading .error { display: none; }         .loading .loading { display: block; }                 .error .time, .error .play, .error .pause, .error .scrubber, .error .loading { display: none; }         .error .error { display: block; }         .error .play-pause p { cursor: auto; }         .error .error-message { display: block; }',
trackEnded:function(){},flashError:function(){var b=this.settings.createPlayer,a=j(b.errorMessageClass,this.wrapper),c='Missing <a href="http://get.adobe.com/flashplayer/">flash player</a> plugin.';if(this.mp3)c+=' <a href="'+this.mp3+'">Download audio file</a>.';g[h].helpers.removeClass(this.wrapper,b.loadingClass);g[h].helpers.addClass(this.wrapper,b.errorClass);a.innerHTML=c},loadError:function(){var b=this.settings.createPlayer,a=j(b.errorMessageClass,this.wrapper);g[h].helpers.removeClass(this.wrapper,
b.loadingClass);g[h].helpers.addClass(this.wrapper,b.errorClass);a.innerHTML='Error loading: "'+this.mp3+'"'},init:function(){g[h].helpers.addClass(this.wrapper,this.settings.createPlayer.loadingClass)},loadStarted:function(){var b=this.settings.createPlayer,a=j(b.durationClass,this.wrapper),c=Math.floor(this.duration/60),d=Math.floor(this.duration%60);g[h].helpers.removeClass(this.wrapper,b.loadingClass);a.innerHTML=(c<10?"0":"")+c+":"+(d<10?"0":"")+d},loadProgress:function(b){var a=this.settings.createPlayer,
c=j(a.scrubberClass,this.wrapper);j(a.loaderClass,this.wrapper).style.width=c.offsetWidth*b+"px"},playPause:function(){this.playing?this.settings.play():this.settings.pause()},play:function(){g[h].helpers.addClass(this.wrapper,this.settings.createPlayer.playingClass)},pause:function(){g[h].helpers.removeClass(this.wrapper,this.settings.createPlayer.playingClass)},updatePlayhead:function(b){var a=this.settings.createPlayer,c=j(a.scrubberClass,this.wrapper);j(a.progressClass,this.wrapper).style.width=
c.offsetWidth*b+"px";a=j(a.playedClass,this.wrapper);c=this.duration*b;b=Math.floor(c/60);c=Math.floor(c%60);a.innerHTML=(b<10?"0":"")+b+":"+(c<10?"0":"")+c}},create:function(b,a){a=a||{};return b.length?this.createAll(a,b):this.newInstance(b,a)},createAll:function(b,a){var c=a||document.getElementsByTagName("audio"),d=[];b=b||{};for(var e=0,i=c.length;e<i;e++)d.push(this.newInstance(c[e],b));return d},newInstance:function(b,a){var c=this.helpers.clone(this.settings),d="audiojs"+this.instanceCount,
e="audiojs_wrapper"+this.instanceCount;this.instanceCount++;if(b.getAttribute("autoplay")!=null)c.autoplay=true;if(b.getAttribute("loop")!=null)c.loop=true;if(b.getAttribute("preload")=="none")c.preload=false;a&&this.helpers.merge(c,a);if(c.createPlayer.markup)b=this.createPlayer(b,c.createPlayer,e);else b.parentNode.setAttribute("id",e);e=new g[o](b,c);c.css&&this.helpers.injectCss(e,c.css);if(c.useFlash&&c.hasFlash){this.injectFlash(e,d);this.attachFlashEvents(e.wrapper,e)}else c.useFlash&&!c.hasFlash&&
this.settings.flashError.apply(e);if(!c.useFlash||c.useFlash&&c.hasFlash)this.attachEvents(e.wrapper,e);return this.instances[d]=e},createPlayer:function(b,a,c){var d=document.createElement("div"),e=b.cloneNode(true);d.setAttribute("class","audiojs");d.setAttribute("className","audiojs");d.setAttribute("id",c);if(e.outerHTML&&!document.createElement("audio").canPlayType){e=this.helpers.cloneHtml5Node(b);d.innerHTML=a.markup;d.appendChild(e);b.outerHTML=d.outerHTML;d=document.getElementById(c)}else{d.appendChild(e);
d.innerHTML+=a.markup;b.parentNode.replaceChild(d,b)}return d.getElementsByTagName("audio")[0]},attachEvents:function(b,a){if(a.settings.createPlayer){var c=a.settings.createPlayer,d=j(c.playPauseClass,b),e=j(c.scrubberClass,b);g[h].events.addListener(d,"click",function(){a.playPause.apply(a)});g[h].events.addListener(e,"click",function(i){i=i.clientX;var f=this,k=0;if(f.offsetParent){do k+=f.offsetLeft;while(f=f.offsetParent)}a.skipTo((i-k)/e.offsetWidth)});if(!a.settings.useFlash){g[h].events.trackLoadProgress(a);
g[h].events.addListener(a.element,"timeupdate",function(){a.updatePlayhead.apply(a)});g[h].events.addListener(a.element,"ended",function(){a.trackEnded.apply(a)});g[h].events.addListener(a.source,"error",function(){clearInterval(a.readyTimer);clearInterval(a.loadTimer);a.settings.loadError.apply(a)})}}},attachFlashEvents:function(b,a){a.swfReady=false;a.load=function(c){a.mp3=c;a.swfReady&&a.element.load(c)};a.loadProgress=function(c,d){a.loadedPercent=c;a.duration=d;a.settings.loadStarted.apply(a);
a.settings.loadProgress.apply(a,[c])};a.skipTo=function(c){if(!(c>a.loadedPercent)){a.updatePlayhead.call(a,[c]);a.element.skipTo(c)}};a.updatePlayhead=function(c){a.settings.updatePlayhead.apply(a,[c])};a.play=function(){if(!a.settings.preload){a.settings.preload=true;a.element.init(a.mp3)}a.playing=true;a.element.pplay();a.settings.play.apply(a)};a.pause=function(){a.playing=false;a.element.ppause();a.settings.pause.apply(a)};a.setVolume=function(c){a.element.setVolume(c)};a.loadStarted=function(){a.swfReady=
true;a.settings.preload&&a.element.init(a.mp3);a.settings.autoplay&&a.play.apply(a)}},injectFlash:function(b,a){var c=this.flashSource.replace(/\$1/g,a);c=c.replace(/\$2/g,b.settings.swfLocation);c=c.replace(/\$3/g,+new Date+Math.random());var d=b.wrapper.innerHTML,e=document.createElement("div");e.innerHTML=c+d;b.wrapper.innerHTML=e.innerHTML;b.element=this.helpers.getSwf(a)},helpers:{merge:function(b,a){for(attr in a)if(b.hasOwnProperty(attr)||a.hasOwnProperty(attr))b[attr]=a[attr]},clone:function(b){if(b==
null||typeof b!=="object")return b;var a=new b.constructor,c;for(c in b)a[c]=arguments.callee(b[c]);return a},addClass:function(b,a){RegExp("(\\s|^)"+a+"(\\s|$)").test(b.className)||(b.className+=" "+a)},removeClass:function(b,a){b.className=b.className.replace(RegExp("(\\s|^)"+a+"(\\s|$)")," ")},injectCss:function(b,a){for(var c="",d=document.getElementsByTagName("style"),e=a.replace(/\$1/g,b.settings.imageLocation),i=0,f=d.length;i<f;i++){var k=d[i].getAttribute("title");if(k&&~k.indexOf("audiojs")){f=
d[i];if(f.innerHTML===e)return;c=f.innerHTML;break}}d=document.getElementsByTagName("head")[0];i=d.firstChild;f=document.createElement("style");if(d){f.setAttribute("type","text/css");f.setAttribute("title","audiojs");if(f.styleSheet)f.styleSheet.cssText=c+e;else f.appendChild(document.createTextNode(c+e));i?d.insertBefore(f,i):d.appendChild(styleElement)}},cloneHtml5Node:function(b){var a=document.createDocumentFragment(),c=a.createElement?a:document;c.createElement("audio");c=c.createElement("div");
a.appendChild(c);c.innerHTML=b.outerHTML;return c.firstChild},getSwf:function(b){b=document[b]||window[b];return b.length>1?b[b.length-1]:b}},events:{memoryLeaking:false,listeners:[],addListener:function(b,a,c){if(b.addEventListener)b.addEventListener(a,c,false);else if(b.attachEvent){this.listeners.push(b);if(!this.memoryLeaking){window.attachEvent("onunload",function(){if(this.listeners)for(var d=0,e=this.listeners.length;d<e;d++)g[h].events.purge(this.listeners[d])});this.memoryLeaking=true}b.attachEvent("on"+
a,function(){c.call(b,window.event)})}},trackLoadProgress:function(b){if(b.settings.preload){var a,c;b=b;var d=/(ipod|iphone|ipad)/i.test(navigator.userAgent);a=setInterval(function(){if(b.element.readyState>-1)d||b.init.apply(b);if(b.element.readyState>1){b.settings.autoplay&&b.play.apply(b);clearInterval(a);c=setInterval(function(){b.loadProgress.apply(b);b.loadedPercent>=1&&clearInterval(c)})}},10);b.readyTimer=a;b.loadTimer=c}},purge:function(b){var a=b.attributes,c;if(a)for(c=0;c<a.length;c+=
1)if(typeof b[a[c].name]==="function")b[a[c].name]=null;if(a=b.childNodes)for(c=0;c<a.length;c+=1)purge(b.childNodes[c])},ready:function(){return function(b){var a=window,c=false,d=true,e=a.document,i=e.documentElement,f=e.addEventListener?"addEventListener":"attachEvent",k=e.addEventListener?"removeEventListener":"detachEvent",n=e.addEventListener?"":"on",m=function(l){if(!(l.type=="readystatechange"&&e.readyState!="complete")){(l.type=="load"?a:e)[k](n+l.type,m,false);if(!c&&(c=true))b.call(a,l.type||
l)}},q=function(){try{i.doScroll("left")}catch(l){setTimeout(q,50);return}m("poll")};if(e.readyState=="complete")b.call(a,"lazy");else{if(e.createEventObject&&i.doScroll){try{d=!a.frameElement}catch(r){}d&&q()}e[f](n+"DOMContentLoaded",m,false);e[f](n+"readystatechange",m,false);a[f](n+"load",m,false)}}}()}};g[o]=function(b,a){this.element=b;this.wrapper=b.parentNode;this.source=b.getElementsByTagName("source")[0]||b;this.mp3=function(c){var d=c.getElementsByTagName("source")[0];return c.getAttribute("src")||
(d?d.getAttribute("src"):null)}(b);this.settings=a;this.loadStartedCalled=false;this.loadedPercent=0;this.duration=1;this.playing=false};g[o].prototype={updatePlayhead:function(){this.settings.updatePlayhead.apply(this,[this.element.currentTime/this.duration])},skipTo:function(b){if(!(b>this.loadedPercent)){this.element.currentTime=this.duration*b;this.updatePlayhead()}},load:function(b){this.loadStartedCalled=false;this.source.setAttribute("src",b);this.element.load();this.mp3=b;g[h].events.trackLoadProgress(this)},
loadError:function(){this.settings.loadError.apply(this)},init:function(){this.settings.init.apply(this)},loadStarted:function(){if(!this.element.duration)return false;this.duration=this.element.duration;this.updatePlayhead();this.settings.loadStarted.apply(this)},loadProgress:function(){if(this.element.buffered!=null&&this.element.buffered.length){if(!this.loadStartedCalled)this.loadStartedCalled=this.loadStarted();this.loadedPercent=this.element.buffered.end(this.element.buffered.length-1)/this.duration;
this.settings.loadProgress.apply(this,[this.loadedPercent])}},playPause:function(){this.playing?this.pause():this.play()},play:function(){/(ipod|iphone|ipad)/i.test(navigator.userAgent)&&this.element.readyState==0&&this.init.apply(this);if(!this.settings.preload){this.settings.preload=true;this.element.setAttribute("preload","auto");g[h].events.trackLoadProgress(this)}this.playing=true;this.element.play();this.settings.play.apply(this)},pause:function(){this.playing=false;this.element.pause();this.settings.pause.apply(this)},
setVolume:function(b){this.element.volume=b},trackEnded:function(){this.skipTo.apply(this,[0]);this.settings.loop||this.pause.apply(this);this.settings.trackEnded.apply(this)}};var j=function(b,a){var c=[];a=a||document;if(a.getElementsByClassName)c=a.getElementsByClassName(b);else{var d,e,i=a.getElementsByTagName("*"),f=RegExp("(^|\\s)"+b+"(\\s|$)");d=0;for(e=i.length;d<e;d++)f.test(i[d].className)&&c.push(i[d])}return c.length>1?c:c[0]}})("audiojs","audiojsInstance",this);
/* ===================================================
 * bootstrap-transition.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#transitions
 * ===================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */


!function ($) {

  "use strict"; // jshint ;_;


  /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
   * ======================================================= */

  $(function () {

    $.support.transition = (function () {

      var transitionEnd = (function () {

        var el = document.createElement('bootstrap')
          , transEndEventNames = {
               'WebkitTransition' : 'webkitTransitionEnd'
            ,  'MozTransition'    : 'transitionend'
            ,  'OTransition'      : 'oTransitionEnd otransitionend'
            ,  'transition'       : 'transitionend'
            }
          , name

        for (name in transEndEventNames){
          if (el.style[name] !== undefined) {
            return transEndEventNames[name]
          }
        }

      }())

      return transitionEnd && {
        end: transitionEnd
      }

    })()

  })

}(window.jQuery);/* ==========================================================
 * bootstrap-alert.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#alerts
 * ==========================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */


!function ($) {

  "use strict"; // jshint ;_;


 /* ALERT CLASS DEFINITION
  * ====================== */

  var dismiss = '[data-dismiss="alert"]'
    , Alert = function (el) {
        $(el).on('click', dismiss, this.close)
      }

  Alert.prototype.close = function (e) {
    var $this = $(this)
      , selector = $this.attr('data-target')
      , $parent

    if (!selector) {
      selector = $this.attr('href')
      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
    }

    $parent = $(selector)

    e && e.preventDefault()

    $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())

    $parent.trigger(e = $.Event('close'))

    if (e.isDefaultPrevented()) return

    $parent.removeClass('in')

    function removeElement() {
      $parent
        .trigger('closed')
        .remove()
    }

    $.support.transition && $parent.hasClass('fade') ?
      $parent.on($.support.transition.end, removeElement) :
      removeElement()
  }


 /* ALERT PLUGIN DEFINITION
  * ======================= */

  var old = $.fn.alert

  $.fn.alert = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('alert')
      if (!data) $this.data('alert', (data = new Alert(this)))
      if (typeof option == 'string') data[option].call($this)
    })
  }

  $.fn.alert.Constructor = Alert


 /* ALERT NO CONFLICT
  * ================= */

  $.fn.alert.noConflict = function () {
    $.fn.alert = old
    return this
  }


 /* ALERT DATA-API
  * ============== */

  $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)

}(window.jQuery);/* ============================================================
 * bootstrap-button.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#buttons
 * ============================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */


!function ($) {

  "use strict"; // jshint ;_;


 /* BUTTON PUBLIC CLASS DEFINITION
  * ============================== */

  var Button = function (element, options) {
    this.$element = $(element)
    this.options = $.extend({}, $.fn.button.defaults, options)
  }

  Button.prototype.setState = function (state) {
    var d = 'disabled'
      , $el = this.$element
      , data = $el.data()
      , val = $el.is('input') ? 'val' : 'html'

    state = state + 'Text'
    data.resetText || $el.data('resetText', $el[val]())

    $el[val](data[state] || this.options[state])

    // push to event loop to allow forms to submit
    setTimeout(function () {
      state == 'loadingText' ?
        $el.addClass(d).attr(d, d) :
        $el.removeClass(d).removeAttr(d)
    }, 0)
  }

  Button.prototype.toggle = function () {
    var $parent = this.$element.closest('[data-toggle="buttons-radio"]')

    $parent && $parent
      .find('.active')
      .removeClass('active')

    this.$element.toggleClass('active')
  }


 /* BUTTON PLUGIN DEFINITION
  * ======================== */

  var old = $.fn.button

  $.fn.button = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('button')
        , options = typeof option == 'object' && option
      if (!data) $this.data('button', (data = new Button(this, options)))
      if (option == 'toggle') data.toggle()
      else if (option) data.setState(option)
    })
  }

  $.fn.button.defaults = {
    loadingText: 'loading...'
  }

  $.fn.button.Constructor = Button


 /* BUTTON NO CONFLICT
  * ================== */

  $.fn.button.noConflict = function () {
    $.fn.button = old
    return this
  }


 /* BUTTON DATA-API
  * =============== */

  $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
    var $btn = $(e.target)
    if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
    $btn.button('toggle')
  })

}(window.jQuery);/* ==========================================================
 * bootstrap-carousel.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#carousel
 * ==========================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */


!function ($) {

  "use strict"; // jshint ;_;


 /* CAROUSEL CLASS DEFINITION
  * ========================= */

  var Carousel = function (element, options) {
    this.$element = $(element)
    this.$indicators = this.$element.find('.carousel-indicators')
    this.options = options
    this.options.pause == 'hover' && this.$element
      .on('mouseenter', $.proxy(this.pause, this))
      .on('mouseleave', $.proxy(this.cycle, this))
  }

  Carousel.prototype = {

    cycle: function (e) {
      if (!e) this.paused = false
      if (this.interval) clearInterval(this.interval);
      this.options.interval
        && !this.paused
        && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
      return this
    }

  , getActiveIndex: function () {
      this.$active = this.$element.find('.item.active')
      this.$items = this.$active.parent().children()
      return this.$items.index(this.$active)
    }

  , to: function (pos) {
      var activeIndex = this.getActiveIndex()
        , that = this

      if (pos > (this.$items.length - 1) || pos < 0) return

      if (this.sliding) {
        return this.$element.one('slid', function () {
          that.to(pos)
        })
      }

      if (activeIndex == pos) {
        return this.pause().cycle()
      }

      return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
    }

  , pause: function (e) {
      if (!e) this.paused = true
      if (this.$element.find('.next, .prev').length && $.support.transition.end) {
        this.$element.trigger($.support.transition.end)
        this.cycle(true)
      }
      clearInterval(this.interval)
      this.interval = null
      return this
    }

  , next: function () {
      if (this.sliding) return
      return this.slide('next')
    }

  , prev: function () {
      if (this.sliding) return
      return this.slide('prev')
    }

  , slide: function (type, next) {
      var $active = this.$element.find('.item.active')
        , $next = next || $active[type]()
        , isCycling = this.interval
        , direction = type == 'next' ? 'left' : 'right'
        , fallback  = type == 'next' ? 'first' : 'last'
        , that = this
        , e

      this.sliding = true

      isCycling && this.pause()

      $next = $next.length ? $next : this.$element.find('.item')[fallback]()

      e = $.Event('slide', {
        relatedTarget: $next[0]
      , direction: direction
      })

      if ($next.hasClass('active')) return

      if (this.$indicators.length) {
        this.$indicators.find('.active').removeClass('active')
        this.$element.one('slid', function () {
          var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
          $nextIndicator && $nextIndicator.addClass('active')
        })
      }

      if ($.support.transition && this.$element.hasClass('slide')) {
        this.$element.trigger(e)
        if (e.isDefaultPrevented()) return
        $next.addClass(type)
        $next[0].offsetWidth // force reflow
        $active.addClass(direction)
        $next.addClass(direction)
        this.$element.one($.support.transition.end, function () {
          $next.removeClass([type, direction].join(' ')).addClass('active')
          $active.removeClass(['active', direction].join(' '))
          that.sliding = false
          setTimeout(function () { that.$element.trigger('slid') }, 0)
        })
      } else {
        this.$element.trigger(e)
        if (e.isDefaultPrevented()) return
        $active.removeClass('active')
        $next.addClass('active')
        this.sliding = false
        this.$element.trigger('slid')
      }

      isCycling && this.cycle()

      return this
    }

  }


 /* CAROUSEL PLUGIN DEFINITION
  * ========================== */

  var old = $.fn.carousel

  $.fn.carousel = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('carousel')
        , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
        , action = typeof option == 'string' ? option : options.slide
      if (!data) $this.data('carousel', (data = new Carousel(this, options)))
      if (typeof option == 'number') data.to(option)
      else if (action) data[action]()
      else if (options.interval) data.pause().cycle()
    })
  }

  $.fn.carousel.defaults = {
    interval: 5000
  , pause: 'hover'
  }

  $.fn.carousel.Constructor = Carousel


 /* CAROUSEL NO CONFLICT
  * ==================== */

  $.fn.carousel.noConflict = function () {
    $.fn.carousel = old
    return this
  }

 /* CAROUSEL DATA-API
  * ================= */

  $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
    var $this = $(this), href
      , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
      , options = $.extend({}, $target.data(), $this.data())
      , slideIndex

    $target.carousel(options)

    if (slideIndex = $this.attr('data-slide-to')) {
      $target.data('carousel').pause().to(slideIndex).cycle()
    }

    e.preventDefault()
  })

}(window.jQuery);/* =============================================================
 * bootstrap-collapse.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#collapse
 * =============================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */


!function ($) {

  "use strict"; // jshint ;_;


 /* COLLAPSE PUBLIC CLASS DEFINITION
  * ================================ */

  var Collapse = function (element, options) {
    this.$element = $(element)
    this.options = $.extend({}, $.fn.collapse.defaults, options)

    if (this.options.parent) {
      this.$parent = $(this.options.parent)
    }

    this.options.toggle && this.toggle()
  }

  Collapse.prototype = {

    constructor: Collapse

  , dimension: function () {
      var hasWidth = this.$element.hasClass('width')
      return hasWidth ? 'width' : 'height'
    }

  , show: function () {
      var dimension
        , scroll
        , actives
        , hasData

      if (this.transitioning || this.$element.hasClass('in')) return

      dimension = this.dimension()
      scroll = $.camelCase(['scroll', dimension].join('-'))
      actives = this.$parent && this.$parent.find('> .accordion-group > .in')

      if (actives && actives.length) {
        hasData = actives.data('collapse')
        if (hasData && hasData.transitioning) return
        actives.collapse('hide')
        hasData || actives.data('collapse', null)
      }

      this.$element[dimension](0)
      this.transition('addClass', $.Event('show'), 'shown')
      $.support.transition && this.$element[dimension](this.$element[0][scroll])
    }

  , hide: function () {
      var dimension
      if (this.transitioning || !this.$element.hasClass('in')) return
      dimension = this.dimension()
      this.reset(this.$element[dimension]())
      this.transition('removeClass', $.Event('hide'), 'hidden')
      this.$element[dimension](0)
    }

  , reset: function (size) {
      var dimension = this.dimension()

      this.$element
        .removeClass('collapse')
        [dimension](size || 'auto')
        [0].offsetWidth

      this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')

      return this
    }

  , transition: function (method, startEvent, completeEvent) {
      var that = this
        , complete = function () {
            if (startEvent.type == 'show') that.reset()
            that.transitioning = 0
            that.$element.trigger(completeEvent)
          }

      this.$element.trigger(startEvent)

      if (startEvent.isDefaultPrevented()) return

      this.transitioning = 1

      this.$element[method]('in')

      $.support.transition && this.$element.hasClass('collapse') ?
        this.$element.one($.support.transition.end, complete) :
        complete()
    }

  , toggle: function () {
      this[this.$element.hasClass('in') ? 'hide' : 'show']()
    }

  }


 /* COLLAPSE PLUGIN DEFINITION
  * ========================== */

  var old = $.fn.collapse

  $.fn.collapse = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('collapse')
        , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
      if (!data) $this.data('collapse', (data = new Collapse(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  $.fn.collapse.defaults = {
    toggle: true
  }

  $.fn.collapse.Constructor = Collapse


 /* COLLAPSE NO CONFLICT
  * ==================== */

  $.fn.collapse.noConflict = function () {
    $.fn.collapse = old
    return this
  }


 /* COLLAPSE DATA-API
  * ================= */

  $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
    var $this = $(this), href
      , target = $this.attr('data-target')
        || e.preventDefault()
        || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
      , option = $(target).data('collapse') ? 'toggle' : $this.data()
    $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
    $(target).collapse(option)
  })

}(window.jQuery);/* ============================================================
 * bootstrap-dropdown.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#dropdowns
 * ============================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */


!function ($) {

  "use strict"; // jshint ;_;


 /* DROPDOWN CLASS DEFINITION
  * ========================= */

  var toggle = '[data-toggle=dropdown]'
    , Dropdown = function (element) {
        var $el = $(element).on('click.dropdown.data-api', this.toggle)
        $('html').on('click.dropdown.data-api', function () {
          $el.parent().removeClass('open')
        })
      }

  Dropdown.prototype = {

    constructor: Dropdown

  , toggle: function (e) {
      var $this = $(this)
        , $parent
        , isActive

      if ($this.is('.disabled, :disabled')) return

      $parent = getParent($this)

      isActive = $parent.hasClass('open')

      clearMenus()

      if (!isActive) {
        if ('ontouchstart' in document.documentElement) {
          // if mobile we we use a backdrop because click events don't delegate
          $('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
        }
        $parent.toggleClass('open')
      }

      $this.focus()

      return false
    }

  , keydown: function (e) {
      var $this
        , $items
        , $active
        , $parent
        , isActive
        , index

      if (!/(38|40|27)/.test(e.keyCode)) return

      $this = $(this)

      e.preventDefault()
      e.stopPropagation()

      if ($this.is('.disabled, :disabled')) return

      $parent = getParent($this)

      isActive = $parent.hasClass('open')

      if (!isActive || (isActive && e.keyCode == 27)) {
        if (e.which == 27) $parent.find(toggle).focus()
        return $this.click()
      }

      $items = $('[role=menu] li:not(.divider):visible a', $parent)

      if (!$items.length) return

      index = $items.index($items.filter(':focus'))

      if (e.keyCode == 38 && index > 0) index--                                        // up
      if (e.keyCode == 40 && index < $items.length - 1) index++                        // down
      if (!~index) index = 0

      $items
        .eq(index)
        .focus()
    }

  }

  function clearMenus() {
    $('.dropdown-backdrop').remove()
    $(toggle).each(function () {
      getParent($(this)).removeClass('open')
    })
  }

  function getParent($this) {
    var selector = $this.attr('data-target')
      , $parent

    if (!selector) {
      selector = $this.attr('href')
      selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
    }

    $parent = selector && $(selector)

    if (!$parent || !$parent.length) $parent = $this.parent()

    return $parent
  }


  /* DROPDOWN PLUGIN DEFINITION
   * ========================== */

  var old = $.fn.dropdown

  $.fn.dropdown = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('dropdown')
      if (!data) $this.data('dropdown', (data = new Dropdown(this)))
      if (typeof option == 'string') data[option].call($this)
    })
  }

  $.fn.dropdown.Constructor = Dropdown


 /* DROPDOWN NO CONFLICT
  * ==================== */

  $.fn.dropdown.noConflict = function () {
    $.fn.dropdown = old
    return this
  }


  /* APPLY TO STANDARD DROPDOWN ELEMENTS
   * =================================== */

  $(document)
    .on('click.dropdown.data-api', clearMenus)
    .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
    .on('click.dropdown.data-api'  , toggle, Dropdown.prototype.toggle)
    .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)

}(window.jQuery);
/* =========================================================
 * bootstrap-modal.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#modals
 * =========================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================= */


!function ($) {

  "use strict"; // jshint ;_;


 /* MODAL CLASS DEFINITION
  * ====================== */

  var Modal = function (element, options) {
    this.options = options
    this.$element = $(element)
      .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
    this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
  }

  Modal.prototype = {

      constructor: Modal

    , toggle: function () {
        return this[!this.isShown ? 'show' : 'hide']()
      }

    , show: function () {
        var that = this
          , e = $.Event('show')

        this.$element.trigger(e)

        if (this.isShown || e.isDefaultPrevented()) return

        this.isShown = true

        this.escape()

        this.backdrop(function () {
          var transition = $.support.transition && that.$element.hasClass('fade')

          if (!that.$element.parent().length) {
            that.$element.appendTo(document.body) //don't move modals dom position
          }

          that.$element.show()

          if (transition) {
            that.$element[0].offsetWidth // force reflow
          }

          that.$element
            .addClass('in')
            .attr('aria-hidden', false)

          that.enforceFocus()

          transition ?
            that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
            that.$element.focus().trigger('shown')

        })
      }

    , hide: function (e) {
        e && e.preventDefault()

        var that = this

        e = $.Event('hide')

        this.$element.trigger(e)

        if (!this.isShown || e.isDefaultPrevented()) return

        this.isShown = false

        this.escape()

        $(document).off('focusin.modal')

        this.$element
          .removeClass('in')
          .attr('aria-hidden', true)

        $.support.transition && this.$element.hasClass('fade') ?
          this.hideWithTransition() :
          this.hideModal()
      }

    , enforceFocus: function () {
        var that = this
        $(document).on('focusin.modal', function (e) {
          if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
            that.$element.focus()
          }
        })
      }

    , escape: function () {
        var that = this
        if (this.isShown && this.options.keyboard) {
          this.$element.on('keyup.dismiss.modal', function ( e ) {
            e.which == 27 && that.hide()
          })
        } else if (!this.isShown) {
          this.$element.off('keyup.dismiss.modal')
        }
      }

    , hideWithTransition: function () {
        var that = this
          , timeout = setTimeout(function () {
              that.$element.off($.support.transition.end)
              that.hideModal()
            }, 500)

        this.$element.one($.support.transition.end, function () {
          clearTimeout(timeout)
          that.hideModal()
        })
      }

    , hideModal: function () {
        var that = this
        this.$element.hide()
        this.backdrop(function () {
          that.removeBackdrop()
          that.$element.trigger('hidden')
        })
      }

    , removeBackdrop: function () {
        this.$backdrop && this.$backdrop.remove()
        this.$backdrop = null
      }

    , backdrop: function (callback) {
        var that = this
          , animate = this.$element.hasClass('fade') ? 'fade' : ''

        if (this.isShown && this.options.backdrop) {
          var doAnimate = $.support.transition && animate

          this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
            .appendTo(document.body)

          this.$backdrop.click(
            this.options.backdrop == 'static' ?
              $.proxy(this.$element[0].focus, this.$element[0])
            : $.proxy(this.hide, this)
          )

          if (doAnimate) this.$backdrop[0].offsetWidth // force reflow

          this.$backdrop.addClass('in')

          if (!callback) return

          doAnimate ?
            this.$backdrop.one($.support.transition.end, callback) :
            callback()

        } else if (!this.isShown && this.$backdrop) {
          this.$backdrop.removeClass('in')

          $.support.transition && this.$element.hasClass('fade')?
            this.$backdrop.one($.support.transition.end, callback) :
            callback()

        } else if (callback) {
          callback()
        }
      }
  }


 /* MODAL PLUGIN DEFINITION
  * ======================= */

  var old = $.fn.modal

  $.fn.modal = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('modal')
        , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
      if (!data) $this.data('modal', (data = new Modal(this, options)))
      if (typeof option == 'string') data[option]()
      else if (options.show) data.show()
    })
  }

  $.fn.modal.defaults = {
      backdrop: true
    , keyboard: true
    , show: true
  }

  $.fn.modal.Constructor = Modal


 /* MODAL NO CONFLICT
  * ================= */

  $.fn.modal.noConflict = function () {
    $.fn.modal = old
    return this
  }


 /* MODAL DATA-API
  * ============== */

  $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
    var $this = $(this)
      , href = $this.attr('href')
      , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
      , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())

    e.preventDefault()

    $target
      .modal(option)
      .one('hide', function () {
        $this.focus()
      })
  })

}(window.jQuery);
/* ===========================================================
 * bootstrap-tooltip.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#tooltips
 * Inspired by the original jQuery.tipsy by Jason Frame
 * ===========================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */


!function ($) {

  "use strict"; // jshint ;_;


 /* TOOLTIP PUBLIC CLASS DEFINITION
  * =============================== */

  var Tooltip = function (element, options) {
    this.init('tooltip', element, options)
  }

  Tooltip.prototype = {

    constructor: Tooltip

  , init: function (type, element, options) {
      var eventIn
        , eventOut
        , triggers
        , trigger
        , i

      this.type = type
      this.$element = $(element)
      this.options = this.getOptions(options)
      this.enabled = true

      triggers = this.options.trigger.split(' ')

      for (i = triggers.length; i--;) {
        trigger = triggers[i]
        if (trigger == 'click') {
          this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
        } else if (trigger != 'manual') {
          eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
          eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
          this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
          this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
        }
      }

      this.options.selector ?
        (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
        this.fixTitle()
    }

  , getOptions: function (options) {
      options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)

      if (options.delay && typeof options.delay == 'number') {
        options.delay = {
          show: options.delay
        , hide: options.delay
        }
      }

      return options
    }

  , enter: function (e) {
      var defaults = $.fn[this.type].defaults
        , options = {}
        , self

      this._options && $.each(this._options, function (key, value) {
        if (defaults[key] != value) options[key] = value
      }, this)

      self = $(e.currentTarget)[this.type](options).data(this.type)

      if (!self.options.delay || !self.options.delay.show) return self.show()

      clearTimeout(this.timeout)
      self.hoverState = 'in'
      this.timeout = setTimeout(function() {
        if (self.hoverState == 'in') self.show()
      }, self.options.delay.show)
    }

  , leave: function (e) {
      var self = $(e.currentTarget)[this.type](this._options).data(this.type)

      if (this.timeout) clearTimeout(this.timeout)
      if (!self.options.delay || !self.options.delay.hide) return self.hide()

      self.hoverState = 'out'
      this.timeout = setTimeout(function() {
        if (self.hoverState == 'out') self.hide()
      }, self.options.delay.hide)
    }

  , show: function () {
      var $tip
        , pos
        , actualWidth
        , actualHeight
        , placement
        , tp
        , e = $.Event('show')

      if (this.hasContent() && this.enabled) {
        this.$element.trigger(e)
        if (e.isDefaultPrevented()) return
        $tip = this.tip()
        this.setContent()

        if (this.options.animation) {
          $tip.addClass('fade')
        }

        placement = typeof this.options.placement == 'function' ?
          this.options.placement.call(this, $tip[0], this.$element[0]) :
          this.options.placement

        $tip
          .detach()
          .css({ top: 0, left: 0, display: 'block' })

        this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)

        pos = this.getPosition()

        actualWidth = $tip[0].offsetWidth
        actualHeight = $tip[0].offsetHeight

        switch (placement) {
          case 'bottom':
            tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
            break
          case 'top':
            tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
            break
          case 'left':
            tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
            break
          case 'right':
            tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
            break
        }

        this.applyPlacement(tp, placement)
        this.$element.trigger('shown')
      }
    }

  , applyPlacement: function(offset, placement){
      var $tip = this.tip()
        , width = $tip[0].offsetWidth
        , height = $tip[0].offsetHeight
        , actualWidth
        , actualHeight
        , delta
        , replace

      $tip
        .offset(offset)
        .addClass(placement)
        .addClass('in')

      actualWidth = $tip[0].offsetWidth
      actualHeight = $tip[0].offsetHeight

      if (placement == 'top' && actualHeight != height) {
        offset.top = offset.top + height - actualHeight
        replace = true
      }

      if (placement == 'bottom' || placement == 'top') {
        delta = 0

        if (offset.left < 0){
          delta = offset.left * -2
          offset.left = 0
          $tip.offset(offset)
          actualWidth = $tip[0].offsetWidth
          actualHeight = $tip[0].offsetHeight
        }

        this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
      } else {
        this.replaceArrow(actualHeight - height, actualHeight, 'top')
      }

      if (replace) $tip.offset(offset)
    }

  , replaceArrow: function(delta, dimension, position){
      this
        .arrow()
        .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
    }

  , setContent: function () {
      var $tip = this.tip()
        , title = this.getTitle()

      $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
      $tip.removeClass('fade in top bottom left right')
    }

  , hide: function () {
      var that = this
        , $tip = this.tip()
        , e = $.Event('hide')

      this.$element.trigger(e)
      if (e.isDefaultPrevented()) return

      $tip.removeClass('in')

      function removeWithAnimation() {
        var timeout = setTimeout(function () {
          $tip.off($.support.transition.end).detach()
        }, 500)

        $tip.one($.support.transition.end, function () {
          clearTimeout(timeout)
          $tip.detach()
        })
      }

      $.support.transition && this.$tip.hasClass('fade') ?
        removeWithAnimation() :
        $tip.detach()

      this.$element.trigger('hidden')

      return this
    }

  , fixTitle: function () {
      var $e = this.$element
      if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
        $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
      }
    }

  , hasContent: function () {
      return this.getTitle()
    }

  , getPosition: function () {
      var el = this.$element[0]
      return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
        width: el.offsetWidth
      , height: el.offsetHeight
      }, this.$element.offset())
    }

  , getTitle: function () {
      var title
        , $e = this.$element
        , o = this.options

      title = $e.attr('data-original-title')
        || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)

      return title
    }

  , tip: function () {
      return this.$tip = this.$tip || $(this.options.template)
    }

  , arrow: function(){
      return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
    }

  , validate: function () {
      if (!this.$element[0].parentNode) {
        this.hide()
        this.$element = null
        this.options = null
      }
    }

  , enable: function () {
      this.enabled = true
    }

  , disable: function () {
      this.enabled = false
    }

  , toggleEnabled: function () {
      this.enabled = !this.enabled
    }

  , toggle: function (e) {
      var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
      self.tip().hasClass('in') ? self.hide() : self.show()
    }

  , destroy: function () {
      this.hide().$element.off('.' + this.type).removeData(this.type)
    }

  }


 /* TOOLTIP PLUGIN DEFINITION
  * ========================= */

  var old = $.fn.tooltip

  $.fn.tooltip = function ( option ) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('tooltip')
        , options = typeof option == 'object' && option
      if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  $.fn.tooltip.Constructor = Tooltip

  $.fn.tooltip.defaults = {
    animation: true
  , placement: 'top'
  , selector: false
  , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
  , trigger: 'hover focus'
  , title: ''
  , delay: 0
  , html: false
  , container: false
  }


 /* TOOLTIP NO CONFLICT
  * =================== */

  $.fn.tooltip.noConflict = function () {
    $.fn.tooltip = old
    return this
  }

}(window.jQuery);
/* ===========================================================
 * bootstrap-popover.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#popovers
 * ===========================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =========================================================== */


!function ($) {

  "use strict"; // jshint ;_;


 /* POPOVER PUBLIC CLASS DEFINITION
  * =============================== */

  var Popover = function (element, options) {
    this.init('popover', element, options)
  }


  /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
     ========================================== */

  Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {

    constructor: Popover

  , setContent: function () {
      var $tip = this.tip()
        , title = this.getTitle()
        , content = this.getContent()

      $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
      $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)

      $tip.removeClass('fade top bottom left right in')
    }

  , hasContent: function () {
      return this.getTitle() || this.getContent()
    }

  , getContent: function () {
      var content
        , $e = this.$element
        , o = this.options

      content = (typeof o.content == 'function' ? o.content.call($e[0]) :  o.content)
        || $e.attr('data-content')

      return content
    }

  , tip: function () {
      if (!this.$tip) {
        this.$tip = $(this.options.template)
      }
      return this.$tip
    }

  , destroy: function () {
      this.hide().$element.off('.' + this.type).removeData(this.type)
    }

  })


 /* POPOVER PLUGIN DEFINITION
  * ======================= */

  var old = $.fn.popover

  $.fn.popover = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('popover')
        , options = typeof option == 'object' && option
      if (!data) $this.data('popover', (data = new Popover(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  $.fn.popover.Constructor = Popover

  $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
    placement: 'right'
  , trigger: 'click'
  , content: ''
  , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
  })


 /* POPOVER NO CONFLICT
  * =================== */

  $.fn.popover.noConflict = function () {
    $.fn.popover = old
    return this
  }

}(window.jQuery);
/* =============================================================
 * bootstrap-scrollspy.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#scrollspy
 * =============================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================== */


!function ($) {

  "use strict"; // jshint ;_;


 /* SCROLLSPY CLASS DEFINITION
  * ========================== */

  function ScrollSpy(element, options) {
    var process = $.proxy(this.process, this)
      , $element = $(element).is('body') ? $(window) : $(element)
      , href
    this.options = $.extend({}, $.fn.scrollspy.defaults, options)
    this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
    this.selector = (this.options.target
      || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
      || '') + ' .nav li > a'
    this.$body = $('body')
    this.refresh()
    this.process()
  }

  ScrollSpy.prototype = {

      constructor: ScrollSpy

    , refresh: function () {
        var self = this
          , $targets

        this.offsets = $([])
        this.targets = $([])

        $targets = this.$body
          .find(this.selector)
          .map(function () {
            var $el = $(this)
              , href = $el.data('target') || $el.attr('href')
              , $href = /^#\w/.test(href) && $(href)
            return ( $href
              && $href.length
              && [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
          })
          .sort(function (a, b) { return a[0] - b[0] })
          .each(function () {
            self.offsets.push(this[0])
            self.targets.push(this[1])
          })
      }

    , process: function () {
        var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
          , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
          , maxScroll = scrollHeight - this.$scrollElement.height()
          , offsets = this.offsets
          , targets = this.targets
          , activeTarget = this.activeTarget
          , i

        if (scrollTop >= maxScroll) {
          return activeTarget != (i = targets.last()[0])
            && this.activate ( i )
        }

        for (i = offsets.length; i--;) {
          activeTarget != targets[i]
            && scrollTop >= offsets[i]
            && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
            && this.activate( targets[i] )
        }
      }

    , activate: function (target) {
        var active
          , selector

        this.activeTarget = target

        $(this.selector)
          .parent('.active')
          .removeClass('active')

        selector = this.selector
          + '[data-target="' + target + '"],'
          + this.selector + '[href="' + target + '"]'

        active = $(selector)
          .parent('li')
          .addClass('active')

        if (active.parent('.dropdown-menu').length)  {
          active = active.closest('li.dropdown').addClass('active')
        }

        active.trigger('activate')
      }

  }


 /* SCROLLSPY PLUGIN DEFINITION
  * =========================== */

  var old = $.fn.scrollspy

  $.fn.scrollspy = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('scrollspy')
        , options = typeof option == 'object' && option
      if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  $.fn.scrollspy.Constructor = ScrollSpy

  $.fn.scrollspy.defaults = {
    offset: 10
  }


 /* SCROLLSPY NO CONFLICT
  * ===================== */

  $.fn.scrollspy.noConflict = function () {
    $.fn.scrollspy = old
    return this
  }


 /* SCROLLSPY DATA-API
  * ================== */

  $(window).on('load', function () {
    $('[data-spy="scroll"]').each(function () {
      var $spy = $(this)
      $spy.scrollspy($spy.data())
    })
  })

}(window.jQuery);/* ========================================================
 * bootstrap-tab.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#tabs
 * ========================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ======================================================== */


!function ($) {

  "use strict"; // jshint ;_;


 /* TAB CLASS DEFINITION
  * ==================== */

  var Tab = function (element) {
    this.element = $(element)
  }

  Tab.prototype = {

    constructor: Tab

  , show: function () {
      var $this = this.element
        , $ul = $this.closest('ul:not(.dropdown-menu)')
        , selector = $this.attr('data-target')
        , previous
        , $target
        , e

      if (!selector) {
        selector = $this.attr('href')
        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
      }

      if ( $this.parent('li').hasClass('active') ) return

      previous = $ul.find('.active:last a')[0]

      e = $.Event('show', {
        relatedTarget: previous
      })

      $this.trigger(e)

      if (e.isDefaultPrevented()) return

      $target = $(selector)

      this.activate($this.parent('li'), $ul)
      this.activate($target, $target.parent(), function () {
        $this.trigger({
          type: 'shown'
        , relatedTarget: previous
        })
      })
    }

  , activate: function ( element, container, callback) {
      var $active = container.find('> .active')
        , transition = callback
            && $.support.transition
            && $active.hasClass('fade')

      function next() {
        $active
          .removeClass('active')
          .find('> .dropdown-menu > .active')
          .removeClass('active')

        element.addClass('active')

        if (transition) {
          element[0].offsetWidth // reflow for transition
          element.addClass('in')
        } else {
          element.removeClass('fade')
        }

        if ( element.parent('.dropdown-menu') ) {
          element.closest('li.dropdown').addClass('active')
        }

        callback && callback()
      }

      transition ?
        $active.one($.support.transition.end, next) :
        next()

      $active.removeClass('in')
    }
  }


 /* TAB PLUGIN DEFINITION
  * ===================== */

  var old = $.fn.tab

  $.fn.tab = function ( option ) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('tab')
      if (!data) $this.data('tab', (data = new Tab(this)))
      if (typeof option == 'string') data[option]()
    })
  }

  $.fn.tab.Constructor = Tab


 /* TAB NO CONFLICT
  * =============== */

  $.fn.tab.noConflict = function () {
    $.fn.tab = old
    return this
  }


 /* TAB DATA-API
  * ============ */

  $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
    e.preventDefault()
    $(this).tab('show')
  })

}(window.jQuery);/* =============================================================
 * bootstrap-typeahead.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#typeahead
 * =============================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================ */


!function($){

  "use strict"; // jshint ;_;


 /* TYPEAHEAD PUBLIC CLASS DEFINITION
  * ================================= */

  var Typeahead = function (element, options) {
    this.$element = $(element)
    this.options = $.extend({}, $.fn.typeahead.defaults, options)
    this.matcher = this.options.matcher || this.matcher
    this.sorter = this.options.sorter || this.sorter
    this.highlighter = this.options.highlighter || this.highlighter
    this.updater = this.options.updater || this.updater
    this.source = this.options.source
    this.$menu = $(this.options.menu)
    this.shown = false
    this.listen()
  }

  Typeahead.prototype = {

    constructor: Typeahead

  , select: function () {
      var val = this.$menu.find('.active').attr('data-value')
      this.$element
        .val(this.updater(val))
        .change()
      return this.hide()
    }

  , updater: function (item) {
      return item
    }

  , show: function () {
      var pos = $.extend({}, this.$element.position(), {
        height: this.$element[0].offsetHeight
      })

      this.$menu
        .insertAfter(this.$element)
        .css({
          top: pos.top + pos.height
        , left: pos.left
        })
        .show()

      this.shown = true
      return this
    }

  , hide: function () {
      this.$menu.hide()
      this.shown = false
      return this
    }

  , lookup: function (event) {
      var items

      this.query = this.$element.val()

      if (!this.query || this.query.length < this.options.minLength) {
        return this.shown ? this.hide() : this
      }

      items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source

      return items ? this.process(items) : this
    }

  , process: function (items) {
      var that = this

      items = $.grep(items, function (item) {
        return that.matcher(item)
      })

      items = this.sorter(items)

      if (!items.length) {
        return this.shown ? this.hide() : this
      }

      return this.render(items.slice(0, this.options.items)).show()
    }

  , matcher: function (item) {
      return ~item.toLowerCase().indexOf(this.query.toLowerCase())
    }

  , sorter: function (items) {
      var beginswith = []
        , caseSensitive = []
        , caseInsensitive = []
        , item

      while (item = items.shift()) {
        if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
        else if (~item.indexOf(this.query)) caseSensitive.push(item)
        else caseInsensitive.push(item)
      }

      return beginswith.concat(caseSensitive, caseInsensitive)
    }

  , highlighter: function (item) {
      var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
      return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
        return '<strong>' + match + '</strong>'
      })
    }

  , render: function (items) {
      var that = this

      items = $(items).map(function (i, item) {
        i = $(that.options.item).attr('data-value', item)
        i.find('a').html(that.highlighter(item))
        return i[0]
      })

      items.first().addClass('active')
      this.$menu.html(items)
      return this
    }

  , next: function (event) {
      var active = this.$menu.find('.active').removeClass('active')
        , next = active.next()

      if (!next.length) {
        next = $(this.$menu.find('li')[0])
      }

      next.addClass('active')
    }

  , prev: function (event) {
      var active = this.$menu.find('.active').removeClass('active')
        , prev = active.prev()

      if (!prev.length) {
        prev = this.$menu.find('li').last()
      }

      prev.addClass('active')
    }

  , listen: function () {
      this.$element
        .on('focus',    $.proxy(this.focus, this))
        .on('blur',     $.proxy(this.blur, this))
        .on('keypress', $.proxy(this.keypress, this))
        .on('keyup',    $.proxy(this.keyup, this))

      if (this.eventSupported('keydown')) {
        this.$element.on('keydown', $.proxy(this.keydown, this))
      }

      this.$menu
        .on('click', $.proxy(this.click, this))
        .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
        .on('mouseleave', 'li', $.proxy(this.mouseleave, this))
    }

  , eventSupported: function(eventName) {
      var isSupported = eventName in this.$element
      if (!isSupported) {
        this.$element.setAttribute(eventName, 'return;')
        isSupported = typeof this.$element[eventName] === 'function'
      }
      return isSupported
    }

  , move: function (e) {
      if (!this.shown) return

      switch(e.keyCode) {
        case 9: // tab
        case 13: // enter
        case 27: // escape
          e.preventDefault()
          break

        case 38: // up arrow
          e.preventDefault()
          this.prev()
          break

        case 40: // down arrow
          e.preventDefault()
          this.next()
          break
      }

      e.stopPropagation()
    }

  , keydown: function (e) {
      this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
      this.move(e)
    }

  , keypress: function (e) {
      if (this.suppressKeyPressRepeat) return
      this.move(e)
    }

  , keyup: function (e) {
      switch(e.keyCode) {
        case 40: // down arrow
        case 38: // up arrow
        case 16: // shift
        case 17: // ctrl
        case 18: // alt
          break

        case 9: // tab
        case 13: // enter
          if (!this.shown) return
          this.select()
          break

        case 27: // escape
          if (!this.shown) return
          this.hide()
          break

        default:
          this.lookup()
      }

      e.stopPropagation()
      e.preventDefault()
  }

  , focus: function (e) {
      this.focused = true
    }

  , blur: function (e) {
      this.focused = false
      if (!this.mousedover && this.shown) this.hide()
    }

  , click: function (e) {
      e.stopPropagation()
      e.preventDefault()
      this.select()
      this.$element.focus()
    }

  , mouseenter: function (e) {
      this.mousedover = true
      this.$menu.find('.active').removeClass('active')
      $(e.currentTarget).addClass('active')
    }

  , mouseleave: function (e) {
      this.mousedover = false
      if (!this.focused && this.shown) this.hide()
    }

  }


  /* TYPEAHEAD PLUGIN DEFINITION
   * =========================== */

  var old = $.fn.typeahead

  $.fn.typeahead = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('typeahead')
        , options = typeof option == 'object' && option
      if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  $.fn.typeahead.defaults = {
    source: []
  , items: 8
  , menu: '<ul class="typeahead dropdown-menu"></ul>'
  , item: '<li><a href="#"></a></li>'
  , minLength: 1
  }

  $.fn.typeahead.Constructor = Typeahead


 /* TYPEAHEAD NO CONFLICT
  * =================== */

  $.fn.typeahead.noConflict = function () {
    $.fn.typeahead = old
    return this
  }


 /* TYPEAHEAD DATA-API
  * ================== */

  $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
    var $this = $(this)
    if ($this.data('typeahead')) return
    $this.typeahead($this.data())
  })

}(window.jQuery);
/* ==========================================================
 * bootstrap-affix.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#affix
 * ==========================================================
 * Copyright 2013 Twitter, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */


!function ($) {

  "use strict"; // jshint ;_;


 /* AFFIX CLASS DEFINITION
  * ====================== */

  var Affix = function (element, options) {
    this.options = $.extend({}, $.fn.affix.defaults, options)
    this.$window = $(window)
      .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
      .on('click.affix.data-api',  $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
    this.$element = $(element)
    this.checkPosition()
  }

  Affix.prototype.checkPosition = function () {
    if (!this.$element.is(':visible')) return

    var scrollHeight = $(document).height()
      , scrollTop = this.$window.scrollTop()
      , position = this.$element.offset()
      , offset = this.options.offset
      , offsetBottom = offset.bottom
      , offsetTop = offset.top
      , reset = 'affix affix-top affix-bottom'
      , affix

    if (typeof offset != 'object') offsetBottom = offsetTop = offset
    if (typeof offsetTop == 'function') offsetTop = offset.top()
    if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()

    affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
      false    : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
      'bottom' : offsetTop != null && scrollTop <= offsetTop ?
      'top'    : false

    if (this.affixed === affix) return

    this.affixed = affix
    this.unpin = affix == 'bottom' ? position.top - scrollTop : null

    this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
  }


 /* AFFIX PLUGIN DEFINITION
  * ======================= */

  var old = $.fn.affix

  $.fn.affix = function (option) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('affix')
        , options = typeof option == 'object' && option
      if (!data) $this.data('affix', (data = new Affix(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  $.fn.affix.Constructor = Affix

  $.fn.affix.defaults = {
    offset: 0
  }


 /* AFFIX NO CONFLICT
  * ================= */

  $.fn.affix.noConflict = function () {
    $.fn.affix = old
    return this
  }


 /* AFFIX DATA-API
  * ============== */

  $(window).on('load', function () {
    $('[data-spy="affix"]').each(function () {
      var $spy = $(this)
        , data = $spy.data()

      data.offset = data.offset || {}

      data.offsetBottom && (data.offset.bottom = data.offsetBottom)
      data.offsetTop && (data.offset.top = data.offsetTop)

      $spy.affix(data)
    })
  })


}(window.jQuery);
/*!
* Bootstrap.js by @fat & @mdo
* Copyright 2013 Twitter, Inc.
* http://www.apache.org/licenses/LICENSE-2.0.txt
*/
!function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(".dropdown-backdrop").remove(),e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||("ontouchstart"in document.documentElement&&e('<div class="dropdown-backdrop"/>').insertBefore(e(this)).on("click",r),s.toggleClass("open")),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f<s.length-1&&f++,~f||(f=0),s.eq(f).focus()}};var s=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=s,this},e(document).on("click.dropdown.data-api",r).on("click.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.dropdown.data-api",t,n.prototype.toggle).on("keydown.dropdown.data-api",t+", [role=menu]",n.prototype.keydown)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e.fn[this.type].defaults,r={},i;this._options&&e.each(this._options,function(e,t){n[e]!=t&&(r[e]=t)},this),i=e(t.currentTarget)[this.type](r).data(this.type);if(!i.options.delay||!i.options.delay.show)return i.show();clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(n=e.isFunction(this.source)?this.source(this.query,e.proxy(this.process,this)):this.source,n?this.process(n):this)},process:function(t){var n=this;return t=e.grep(t,function(e){return n.matcher(e)}),t=this.sorter(t),t.length?this.render(t.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(e){return~e.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(e){var t=[],n=[],r=[],i;while(i=e.shift())i.toLowerCase().indexOf(this.query.toLowerCase())?~i.indexOf(this.query)?n.push(i):r.push(i):t.push(i);return t.concat(n,r)},highlighter:function(e){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),function(e,t){return"<strong>"+t+"</strong>"})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery);
/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
 * Build: http://modernizr.com/download/#-draganddrop-shiv-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes
 */
;window.Modernizr=function(a,b,c){function A(a){j.cssText=a}function B(a,b){return A(m.join(a+";")+(b||""))}function C(a,b){return typeof a===b}function D(a,b){return!!~(""+a).indexOf(b)}function E(a,b){for(var d in a){var e=a[d];if(!D(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function F(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:C(f,"function")?f.bind(d||b):f}return!1}function G(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return C(b,"string")||C(b,"undefined")?E(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),F(e,b,c))}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=C(e[d],"function"),C(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y={}.hasOwnProperty,z;!C(y,"undefined")&&!C(y.call,"undefined")?z=function(a,b){return y.call(a,b)}:z=function(a,b){return b in a&&C(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a};for(var H in q)z(q,H)&&(v=H.toLowerCase(),e[v]=q[H](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)z(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},A(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.hasEvent=x,e.testProp=function(a){return E([a])},e.testAllProps=G,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document);
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/

var update = true;
function setCookie(cname, cvalue, exdays) {
	var d = new Date();
	d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
	var expires = 'expires='+ d.toUTCString();
    document.cookie = cname + '=' + cvalue + '; ' + expires;
}
function getCookie(cname) {
    var name = cname + '=';
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1);
        if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
    }
    return '';
}
function resizeIframe(obj) {
	var height = obj.contentWindow.document.body.scrollHeight;
	console.log(obj.contentWindow.document.body.scrollHeight);
	if (height === 'undefined' || height / $(window).height() < 0.5) {
		height = $(window).height() * 0.7;
	}
	console.log(height);
    obj.style.height = height + 'px';
}
$(function() {
	sweetAlertInitialize();
	function progressload(e) {
		if (e.lengthComputable) {
			$('#upload_progress').css('width', (e.loaded / e.total) * 100 + '%');
		}
	}

	function updateList() {
		$.ajax({
			url: 'ajax/ajax_filelist.php',
			type: 'GET',
			dataType: 'html',
			cache: false,
			timeout: 30000,
			data: {
				dir: dir
			},
			success: function(data) {
				$('#file_list_container').html(data);
			}
		});
	};

	function updateRecycleList() {
		$.ajax({
			url: 'ajax/ajax_recyclelist.php',
			type: 'GET',
			dataType: 'html',
			cache: false,
			timeout: 30000,
			success: function(data) {
				$('#recycle_list').html(data);
			}
		});
	};

	function updateUsage() {
		$.ajax({
			url: 'ajax/ajax_list_usage.php',
			type: 'GET',
			dataType: 'html',
			cache: false,
			timeout: 30000,
			success: function(data) {
				$('#usage_box').html(data);
			}
		});
	};
	function updateDirTree() {
		$.ajax({
			url: 'ajax/ajax_dir_tree.php',
			type: 'GET',
			dataType: 'json',
			data: {current: dir},
			success: function(data) {
				$('#dir-tree').html(data[0].content);
			},
		});
	};
	function updateAll() {
		updateList();
		updateUsage();
		updateRecycleList();
		updateDirTree();
	};
	function checkUpdate() {
		$.ajax({
			url: 'ajax/ajax_polling.php',
			type: 'GET',
			dataType: 'text',
			cache: false,
			timeout: 30000,
			success: function(data) {
				if (data == 'updatenow') {
					updateAll();
				}
				checkUpdate();
			},
			error: function() {
				checkUpdate();
			}
		});
	};


	$('body').on('click', '.tree-indicator', function() {
		var $state = $(this).html();
		$(this).parent().find('ul.dir-tree').slideToggle(500);
		$(this).html($state == '<i class="ion-ios7-plus-empty"></i>' ? '<i class="ion-ios7-minus-empty"></i>' : '<i class="ion-ios7-plus-empty"></i>');
	});

	$('#mkdir-modal').modal({
		show: false
	});

	$('#preview-file').modal({
		show: false
	});

	$('#info-modal').modal({
		show: false
	});

	$('#color-tag').modal({
		show: false
	});

	$('#upload-file').modal({
		show: false
	});

	$('#recycle-box').modal({
		show: false
	});

	/* Context Menu */
	var $contextMenu = $('#contextMenu');
	var $ContextMenuTarget = $('body');
	var ContextMenuType = '';
	$('body').on('click', ':not(#contextMenu)', function() {
		$contextMenu.hide();
	});
	$('body').on('contextmenu', '#file_list_container .panel[data-type=file] .panel-footer, #file_list_container .panel[data-type=file] .panel-body', function(e) {
		$contextMenu.hide();
		if ($('.ui-selected').length > 1) {
			ContextMenuType = 'multi';
			$contextMenu.find('ul').html('<li><a tabindex="-1" href="#" data-action="delete"><i class="fa fa-trash-o fa-fw"></i> 刪除</a></li><li><a tabindex="-1" href="#" data-action="move"><i class="fa fa-arrows fa-fw"></i> 移動</a></li><li><a tabindex="-1" href="#" data-action="tag"><i class="fa fa-tag fa-fw"></i> 標記</a></li>');
		}else {
			$contextMenu.find('ul').html('<li><a tabindex="-1" href="#" data-action="download"><i class="fa fa-download fa-fw"></i> 下載</a></li><li><a tabindex="-1" href="#" data-action="share"><i class="fa fa-share-square-o fa-fw"></i> 分享</a></li><li><a tabindex="-1" href="#" data-action="public"><i class="fa fa-cloud-upload fa-fw"></i> 公開/取消公開 檔案</a></li><li><a tabindex="-1" href="#" data-action="link"><i class="fa fa-globe fa-fw"></i> 外連檔案</a></li><li><a tabindex="-1" href="#" data-action="delete"><i class="fa fa-trash-o fa-fw"></i> 刪除</a></li><li><a tabindex="-1" href="#" data-action="rename"><i class="fa fa-edit fa-fw"></i> 重新命名</a></li><li><a tabindex="-1" href="#" data-action="move"><i class="fa fa-arrows fa-fw"></i> 移動</a></li><li><a tabindex="-1" href="#" data-action="preview"><i class="fa fa-eye fa-fw"></i> 預覽</a></li><li><a tabindex="-1" href="#" data-action="tag"><i class="fa fa-tag fa-fw"></i> 標記</a></li>');
		   	$ContextMenuTarget = $(e.target).parents('.panel');
		   	ContextMenuType = 'file';
		   	$('.ui-selected').removeClass('ui-selected');
		   	$ContextMenuTarget.addClass('ui-selected');
		   	//check preview
		   	if ($ContextMenuTarget.find('.file-action').find(':nth-child(7)').hasClass('disabled')) {
		   		$('#contextMenu').find('a[data-action=preview]').parent().remove();
		   	}

		   	//check link
		   	if ($ContextMenuTarget.find('.file-action').find(':nth-child(3)').hasClass('disabled')) {
		   		$('#contextMenu').find('a[data-action=link]').parent().remove();
		   	}

		   	//check share
		   	if ($ContextMenuTarget.find('.file-action').find(':nth-child(1)').hasClass('disabled')) {
		   		$('#contextMenu').find('a[data-action=share]').parent().remove();
		   	}

		   	//check public
		   	$('#contextMenu').find('a[data-action=public]').html('<i class="fa fa-cloud-upload fa-fw"></i> ' + $ContextMenuTarget.find('.file-action').find(':nth-child(2)').text());
	   	}
	   	$contextMenu.css({ display: 'block' });
		$contextMenu.position({
			my: 'left top',
			at: 'left bottom',
			of: e,
			collision: 'fit'
		});
	   	return false;
	});
	$('body').on('contextmenu', '#file_list_container .panel[data-type=dir] .panel-body, #file_list_container .panel[data-type=dir] .panel-footer', function(e) {
		$contextMenu.hide();
		if ($('.ui-selected').length > 1) {
			ContextMenuType = 'multi';
			$contextMenu.find('ul').html('<li><a tabindex="-1" href="#" data-action="delete"><i class="fa fa-trash-o fa-fw"></i> 刪除</a></li><li><a tabindex="-1" href="#" data-action="move"><i class="fa fa-arrows fa-fw"></i> 移動</a></li><li><a tabindex="-1" href="#" data-action="tag"><i class="fa fa-tag fa-fw"></i> 標記</a></li>');
		}else {
			$contextMenu.find('ul').html('<li><a tabindex="-1" href="#" data-action="open"><i class="fa fa-folder-open fa-fw"></i> 開啟</a></li><li><a tabindex="-1" href="#" data-action="delete"><i class="fa fa-trash-o fa-fw"></i> 刪除</a></li><li><a tabindex="-1" href="#" data-action="rename"><i class="fa fa-edit fa-fw"></i> 重新命名</a></li><li><a tabindex="-1" href="#" data-action="move"><i class="fa fa-arrows fa-fw"></i> 移動</a></li><li><a tabindex="-1" href="#" data-action="share"><i class="fa fa-share-square-o fa-fw"></i> 分享</a></li><li><a tabindex="-1" href="#" data-action="public"><i class="fa fa-globe fa-fw"></i> 公開/取消公開 資料夾</a></li><li><a tabindex="-1" href="#" data-action="tag"><i class="fa fa-tag fa-fw"></i> 標記</a></li>');
		   	$ContextMenuTarget = $(e.target).parents('.panel');
		   	ContextMenuType = 'dir';
		   	$('.ui-selected').removeClass('ui-selected');
		   	$ContextMenuTarget.addClass('ui-selected');

		   	//check share
		   	if ($ContextMenuTarget.find('.file-action').find(':nth-child(5)').hasClass('disabled')) {
		   		$('#contextMenu').find('a[data-action=share]').parent().remove();
		   	}

		   	//check public
		   	$('#contextMenu').find('a[data-action=public]').html('<i class="fa fa-globe fa-fw fa-fw"></i> ' + $ContextMenuTarget.find('.file-action').find(':nth-child(6)').text());

		}
		$contextMenu.css({ display: 'block' });
		$contextMenu.position({
			my: 'left top',
			at: 'left bottom',
			of: e,
			collision: 'fit'
		});
	   	return false;
	});
	$contextMenu.on('click', 'a', function(e) {
		e.preventDefault();
	   	$contextMenu.hide();
	   	var action = $(this).attr('data-action');
	   	if (ContextMenuType == 'file') {
		   	switch (action) {
		   		case 'download':
					window.open($ContextMenuTarget.attr('data-download-url') , '_self');
		   			break;
		   		case 'share':
		   			window.open($ContextMenuTarget.find('.file-action').find(':nth-child(1)').attr('href') , '_blank');
		   			break;
		   		case 'public':
		   			$ContextMenuTarget.find('.file-action').find(':nth-child(2)').click();
		   			break;
		   		case 'link':
		   			window.open($ContextMenuTarget.find('.file-action').find(':nth-child(3)').attr('href') , '_blank');
		   			break;
		   		case 'delete':
		   			$ContextMenuTarget.find('.file-action').find(':nth-child(4)').click();
		   			break;
		   		case 'rename':
		   			$ContextMenuTarget.find('.file-action').find(':nth-child(5)').click();
		   			break;
		   		case 'move':
		   			$ContextMenuTarget.find('.file-action').find(':nth-child(6)').click();
		   			break;
		   		case 'preview':
		   			$ContextMenuTarget.find('.file-action').find(':nth-child(7)').click();
		   			break;
		   		case 'tag':
		   			$ContextMenuTarget.find('.file-action').find(':nth-child(8)').click();
		   			break;
		   	}
	   	}else if (ContextMenuType == 'dir') {
	   		switch (action) {
		   		case 'open':
					window.open($ContextMenuTarget.find(':nth-child(1)').attr('data-download-url') , '_self');
		   			break;
		   		case 'delete':
		   			$ContextMenuTarget.find('.file-action').find(':nth-child(2)').click();
		   			break;
		   		case 'rename':
		   			$ContextMenuTarget.find('.file-action').find(':nth-child(3)').click();
		   			break;
		   		case 'move':
		   			$ContextMenuTarget.find('.file-action').find(':nth-child(4)').click();
		   			break;
		   		case 'share':
		   			window.open($ContextMenuTarget.find('.file-action').find(':nth-child(5)').attr('href') , '_blank');
		   			break;
		   		case 'public':
		   			$ContextMenuTarget.find('.file-action').find(':nth-child(6)').click();
		   			break;
		   		case 'tag':
		   			$ContextMenuTarget.find('.file-action').find(':nth-child(7)').click();
		   			break;
		   	}
		}else if (ContextMenuType == 'multi') {
	   		switch (action) {
			   	case 'delete':
			   		$('#delete-btn').click();
			   		break;
			   	case 'move':
			   		$('#move-btn').click();
			   		break;
			   	case 'tag':
			   		$('#tag-btn').click();
			   		break;
		   	}
	   	}
	});
	$('body').on('click', '.file-action a[data-delete-id]', function(e) {
		e.preventDefault();
		$.ajax({
			url: 'ajax/' + $(this).attr('href'),
			type: 'GET',
			dataType: 'json',
			data: {
				id: $(this).attr('data-delete-id')
			},
			success: function(data) {
				if (data.message != '成功刪除檔案。') {
					swal('刪除失敗', data.message, 'warning');
				}
				updateAll();
			},
			error: function() {
				swal('刪除失敗', '', 'warning');
			}
		});
	});

	$('body').on('click', '.file-action a[data-dir-delete-id]', function(e) {
		e.preventDefault();
		$.ajax({
			url: 'ajax/' + $(this).attr('href'),
			type: 'GET',
			dataType: 'json',
			data: {
				id: $(this).attr('data-dir-delete-id')
			},
			success: function(data) {
				if (data.message != '成功刪除。') {
					swal('刪除失敗', data.message, 'warning');
				}
				updateAll();

			},
			error: function() {
				swal('刪除失敗', '', 'warning');
			}
		});
	});

	$('#rename-file').on('hide.bs.modal', function() {
		$('#rename-file-btn').off();
	});
	$('body').on('click', '.file-action a[data-dir-color-id], .file-action a[data-color-id]', function(e) {
		e.preventDefault();
		$('.color-tag-btn.btn').removeClass('active');
		$('.color-tag-btn.btn').find('input').removeAttr('checked');
		if ($('.ui-selected').length == 1) {
			if ($(this).attr('data-dir-color-id') != null) {
				$('.color-tag-btn').attr('data-id', $(this).attr('data-dir-color-id')).attr('data-type', 'dir');
			} else {
				$('.color-tag-btn').attr('data-id', $(this).attr('data-color-id')).attr('data-type', 'file');
			}
			if ($(this).parents('.panel').find('.panel-footer').hasClass('tag-success')) {
				$('.color-tag-btn.btn-success').addClass('active');
				$('.color-tag-btn.btn-success').find('input').attr('checked', 'checked');
			}else if ($(this).parents('.panel').find('.panel-footer').hasClass('tag-warning')) {
				$('.color-tag-btn.btn-warning').addClass('active');
				$('.color-tag-btn.btn-warning').find('input').attr('checked', 'checked');
			}else if ($(this).parents('.panel').find('.panel-footer').hasClass('tag-info')) {
				$('.color-tag-btn.btn-info').addClass('active');
				$('.color-tag-btn.btn-info').find('input').attr('checked', 'checked');
			}else if ($(this).parents('.panel').find('.panel-footer').hasClass('tag-danger')) {
				$('.color-tag-btn.btn-danger').addClass('active');
				$('.color-tag-btn.btn-danger').find('input').attr('checked', 'checked');
			}else if ($(this).parents('.panel').find('.panel-footer').hasClass('tag-primary')) {
				$('.color-tag-btn.btn-primary').addClass('active');
				$('.color-tag-btn.btn-primary').find('input').attr('checked', 'checked');
			}else if ($(this).parents('.panel').find('.panel-footer').hasClass('tag-default')) {
				$('.color-tag-btn.btn-default').addClass('active');
				$('.color-tag-btn.btn-default').find('input').attr('checked', 'checked');
			}else if ($(this).parents('.panel').find('.panel-footer').hasClass('tag-black')) {
				$('.color-tag-btn.btn-black').addClass('active');
				$('.color-tag-btn.btn-black').find('input').attr('checked', 'checked');
			} else {
				$('.color-tag-btn.btn-default').addClass('active');
				$('.color-tag-btn.btn-default').find('input').attr('checked', 'checked');
			}
		}
		$('#color-tag').modal('show');
	});
	$('body').on('click', '#tag-btn', function(e) {
		e.preventDefault();
		$('#color-tag').modal('show');
	});
	$('body').on('click', '.color-tag-btn', function(e) {
		e.preventDefault();
		$(this).addClass('active');
		var id = $(this).attr('id');
		$('.ui-selected').each(function() {
			$.ajax({
				url: 'ajax/ajax_set_color.php',
				type: 'GET',
				dataType: 'json',
				data: {
					id: $(this).attr('data-id'),
					type: $(this).attr('data-type'),
					color: id
				},
				success: function() {
					updateAll();
				},
				error: function() {
					swal('檔案標記錯誤', '', 'warning');
				}
			});
		});
		$('.color-tag-btn.btn').removeClass('active');
		$('.color-tag-btn.btn').find('input').removeAttr('checked');

		$('#color-tag').modal('hide');
	});
	$('body').on('click', '.file-action a[data-rename-id]', function(e) {
		e.preventDefault();
		var filename = $(this).parents('.panel').find('.panel-footer').eq(0).text();
		var ext = filename.split('.').pop();
		var name = filename.replace('.' + ext, '');
		console.log(filename + ', ' + name + ', ' + ext);
		$(this).parents('.panel').removeClass('ui-selectee ui-selected').addClass('renaming').find('.panel-footer').attr('style', 'padding:6px 15px').html('<div class="input-group input-group-sm"><input class="form-control rename-input" data-rename-url="' + $(this).attr('href') + '" data-id="' + $(this).attr('data-rename-id') + '" value="' + name + '" /><div class="input-group-addon file-ext">.' + ext + '</div></div>');
		$('.rename-input').focus();
	});
	$('body').on('blur', '.rename-input', function() {
		$('.rename-input').focus();
	});
	$('body').on('keyup', '.rename-input', function(e) {
		if (e.keyCode == 27) {
			e.preventDefault();
			$('.rename-input').remove();
			updateAll();
			return false;
		}else if (e.type == 'keyup' && e.keyCode == 13) {
			e.preventDefault();
			if ($('.rename-input').val() == '') {
				updateAll();
				return false;
			}
			var val = $('.rename-input').val() + $('.file-ext').eq(0).text();
			if (val) {
				$.ajax({
					url: 'ajax/' + $('.rename-input').attr('data-rename-url'),
					type: 'GET',
					dataType: 'json',
					data: {
						id: $('.rename-input').attr('data-id'),
						name: val
					},
					success: function(data) {
						updateAll();

					},
					error: function() {
						swal('重新命名發生錯誤', '', 'warning');
					}
				});
			}
		}
	});
	$('body').on('click', '.file-action a[data-dir-rename-id]', function(e) {
		e.preventDefault();
		var name = $(this).parents('.panel').find('.panel-footer').eq(0).text();
		console.log(name);
		$(this).parents('.panel').removeClass('ui-selectee ui-selected').addClass('renaming').find('.panel-footer').attr('style', 'padding:6px 15px').find('span').html('<div class="input-group input-group-sm"><input class="form-control rename-input-dir" data-rename-url="' + $(this).attr('href') + '" data-id="' + $(this).attr('data-dir-rename-id') + '" value="' + name + '" /></div>');
		$('.rename-input-dir').focus();
	});
	$('body').on('blur', '.rename-input-dir', function() {
		$('.rename-input-dir').focus();
	});
	$('body').on('keydown', '.rename-input-dir', function(e) {
		if (e.keyCode === 27) {
			e.preventDefault();
			$('.rename-input-dir').remove();
			updateAll();
			return false;
		}else if (e.keyCode === 13) {
			if ($('.rename-input-dir').val() == '') {
				updateAll();
				return false;
			}
			$.ajax({
				url: 'ajax/' + $('.rename-input-dir').attr('data-rename-url'),
				type: 'GET',
				dataType: 'json',
				data: {
					id: $('.rename-input-dir').attr('data-id'),
					name: $('.rename-input-dir').val()
				},
				success: function(data) {
					updateAll();
				},
				error: function() {
					swal('重新命名發生錯誤', '', 'warning');
				}
			});
		}
	});
	$('body').on('click', '.file-action a[data-share-id]', function(e) {
		e.preventDefault();
		if ($(this).text() == '公開檔案' || $(this).text() == '公開資料夾') {
			var $target = $(this);
			console.log(getCookie('share_warning'));
			if (getCookie('share_warning') != 'no_warning') {
				swal({
				  title: '你確定要公開檔案嗎？',
				  text: '公開檔案會降低您檔案的安全係數，您確定要這麼作嗎？',
				  type: 'warning',
				  showCancelButton: true,
				  confirmButtonClass: 'btn-danger',
				  confirmButtonText: '恩，我確定要公開檔案',
				  cancelButtonText: '取消',
				  closeOnConfirm: false
				},function(isConfirm) {
					if (isConfirm) {
						$.ajax({
							url: 'ajax/ajax_share.php',
							type: 'GET',
							dataType: 'json',
							data: {
								id: $target.attr('data-share-id'),
								type: $target.attr('data-share-type'),
							},
							success: function(data) {
								updateAll();
							},
							error: function() {
								swal('改變權限發生錯誤', '', 'warning');
							}
						});
					  	swal({
						    title: '未來還需要提醒您嗎？',
						    text: '未來是否還要再跳此通知',
						    type: 'warning',
						    showCancelButton: true,
						    confirmButtonClass: 'btn-info',
						    confirmButtonText: '以後不需要再提醒我了',
						    cancelButtonText: '以後還是要提醒我',
						    closeOnConfirm: true
					  	},function() {
					  		setCookie('share_warning', 'no_warning', 365);
					  	});
					}else {
						return false;
					}
				});
			}else {
				$.ajax({
					url: 'ajax/ajax_share.php',
					type: 'GET',
					dataType: 'json',
					data: {
						id: $target.attr('data-share-id'),
						type: $target.attr('data-share-type'),
					},
					success: function(data) {
						updateAll();
					},
					error: function() {
						swal('改變權限發生錯誤', '', 'warning');
					}
				});
			}
		}else {
			$.ajax({
				url: 'ajax/ajax_share.php',
				type: 'GET',
				dataType: 'json',
				data: {
					id: $(this).attr('data-share-id'),
					type: $(this).attr('data-share-type'),
				},
				success: function(data) {
					updateAll();
				},
				error: function() {
					swal('改變權限發生錯誤', '', 'warning');
				}
			});
		}

		console.log(4);
	});

	$('#recycle-btn').on('click', function(e) {
		e.preventDefault();

		$('#recycle-box').modal('show');
	});
	$('#upload-file').on('hide.bs.modal', function() {
		$('#upload-file-btn').off();
	});
	$('#upload-btn').on('click', function(e) {
		e.preventDefault();
		$('#upload-file').modal('show');
	});
	$('#mkdir-btn').on('click', function(e) {
		e.preventDefault();
		$('#mkdir-modal').modal('show');
	});
	$('#info-btn').on('click', function(e) {
		e.preventDefault();
		$('#info-modal').modal('show');
	});
	$('#move-btn').on('click', function(e) {
		e.preventDefault();
		$.ajax({
			url: 'ajax/ajax_list_dir.php',
			type: 'GET',
			dataType: 'json',
			success: function(data) {
				$('#ajax_load_tree').html(data[0].content);
			},
		});
		$('#mvfile-modal').modal('show');
	});
	$('body').on('click', '.file-action a[data-preview-id]', function(e) {
		e.preventDefault();
		$('#preview-iframe').attr('src', 'preview.php?id=' + $(this).attr('data-preview-id'));
		$('#preview-file').modal('show');
	});
	$('#file_list_container').selectable({
		filter: '.panel',
		cancel: '.ui-selected, .renaming',
		start: function(e, ui ) {
			$contextMenu.hide();
		},
		selecting: function(e, ui) {
			$('#navbar-file-action').html('');
		}
	});

	$('body').on('mousedown', '#file_list_container .ui-selectee', function(e) {
		if (e.which == 1) {
			if (!e.ctrlKey && !e.metaKey) {
				$('.ui-selected').removeClass('ui-selected');
		        $('#file_list_container').trigger('selectableselected');
		    }
		    if (e.ctrlKey || e.metaKey) {
				$(this).removeClass('ui-selected');
		    }
		}
    });
	$('.ui-selected').on('click', function() {
  		$(this).removeClass('ui-selected').parents('.ui-selectable').trigger('selectablestop');
	});

	$('body').on('dblclick', '.panel:not(.renaming), .panel i', function(e) {
		if (!e.ctrlKey && !e.metaKey) {
			console.log($(this).parent().html());
			window.open($(this).attr('data-download-url') , '_self');
        }
    });

    $('body').on('click', '.file-action', function(e) {
    	e.stopPropagation();
    });

	$('#preview-file').on('hide.bs.modal', function(e) {
		$('#preview-iframe').attr('src', 'preview.php');
	});
	var moving_id = '';
	$('body').on('click', '.file-action a[data-move-id] , .file-action a[data-dir-move-id]', function(e) {
		e.preventDefault();
		if ($(this).attr('data-dir-move-id') != null) {
			moving_id = $(this).attr('data-dir-move-id');
			//$('tr[data-id="' + $(this).attr('data-dir-move-id') + '"]').addClass('is_moving');
			var cdir = $(this).attr('data-dir-move-id');
		} else {
			moving_id = $(this).attr('data-move-id');
			//$('tr[data-id="' + $(this).attr('data-move-id') + '"]').addClass('is_moving');
			var cdir = '';
		}
		console.log($(this).attr('data-move-id'));
		$.ajax({
			url: 'ajax/ajax_list_dir.php',
			type: 'GET',
			dataType: 'json',
			success: function(data) {
				$('#ajax_load_tree').html(data[0].content);
				$('#ajax_load_tree').find('a').addClass('filetreeselector').removeAttr('href');
				//$('[data-id=' + cdir + ']').removeClass("filetreeselector");
				//$('[data-parent=' + cdir + ']').remove();
			},
		});
		$('#mvfile-modal').modal('show');
	});
	$('body').on('click', '.real_delete', function(e) {
		e.preventDefault();
		var $Target = $(this);
		swal({
		  title: '永久刪除',
		  text: '此行為無法回復，你確定要執行嗎？',
		  type: 'warning',
		  showCancelButton: true,
		  confirmButtonClass: 'btn-danger',
		  confirmButtonText: '確定',
		  cancelButtonText: '取消',
		  closeOnConfirm: false
		},
		function() {
			var url = '';
			if ($Target.attr('data-type') == 'dir') {
				url = 'ajax/ajax_delete_dir.php';
			} else {
				url = 'ajax/ajax_delete.php';
			}
			$.ajax({
				url: url,
				type: 'GET',
				dataType: 'json',
				data: {
					id: $Target.attr('data-id')
				},
				error: function() {
					swal('檔案刪除失敗', '', 'warning');
				}
			});
			updateAll();
			swal('刪除完成', '該檔案已經被永久刪除', 'success');
		});

	});
	$('body').on('click', '#real_delete_all', function(e) {
		e.preventDefault();
		swal({
		  title: '永久刪除',
		  text: '此行為無法回復，你確定要執行嗎？',
		  type: 'warning',
		  showCancelButton: true,
		  confirmButtonClass: 'btn-danger',
		  confirmButtonText: '確定',
		  cancelButtonText: '取消',
		  closeOnConfirm: false
		},
		function() {
			$('.real_delete').each(function() {
				if ($(this).attr('data-type') == 'dir') {
					url = 'ajax/ajax_delete_dir.php';
				} else {
					url = 'ajax/ajax_delete.php';
				}
				$.ajax({
					url: url,
					type: 'GET',
					dataType: 'json',
					data: {
						id: $(this).attr('data-id')
					},
					error: function() {
						swal('檔案刪除失敗', '', 'warning');
					}
				});
			});
			swal('刪除完成', '所有檔案已經被永久刪除', 'success');
			updateAll();
		});
	});

	$('body').on('click', '.recycle_back', function(e) {
		e.preventDefault();
		var url = '';
		if ($(this).attr('data-type') == 'dir') {
			url = 'ajax/ajax_recycle_back_dir.php';
		} else {
			url = 'ajax/ajax_recycle_back.php';
		}
		$.ajax({
			url: url,
			type: 'GET',
			dataType: 'json',
			data: {
				id: $(this).attr('data-id')
			},
			error: function() {
				swal('檔案還原失敗', '', 'warning');
			}
		});
		updateAll();

	});
	$('body').on('click', '.filetreeselector', function(e) {
		e.preventDefault();
		$('.filetreeselector').removeClass('tree_selected');
		$(this).addClass('tree_selected');
	});
	$('#delete-btn').on('click', function(e) {
		var url = '';
		$('.ui-selected').each(function() {
			if ($(this).attr('data-type') == 'dir') {
				url = 'ajax/ajax_recycle_dir.php';
			} else {
				url = 'ajax/ajax_recycle.php';
			}
			$.ajax({
				url: url,
				type: 'GET',
				dataType: 'json',
				data: {
					id: $(this).attr('data-id')
				},
				error: function() {
					swal('檔案刪除失敗', '', 'warning');
				}
			});
			updateAll();
		});
	});
	$('#move-submit-btn').on('click', function(e) {
		var url = '';
		if ($('.tree_selected').attr('data-id') != null) {
			$('.ui-selected').each(function() {
				if ($(this).attr('data-type') == 'dir') {
					url = 'ajax/ajax_move_dir.php';
				} else {
					url = 'ajax/ajax_move.php';
				}
				$.ajax({
					url: url,
					type: 'GET',
					dataType: 'json',
					data: {
						id: $(this).attr('data-id'),
						dir: $('.tree_selected').attr('data-id')
					},
					error: function() {
						swal('檔案移動失敗', '', 'warning');
					}
				});
			});
			updateAll();
			$('#mvfile-modal').modal('hide');
		}else {
			swal('您沒有選取資料夾', '', 'warning');
		}
	});

	//$('#file_list_container').css('height', $(document.body).height() + 'px');

	//Upload
	if (window.FileReader && Modernizr.draganddrop) {
		$('#ajax_upload_btn').removeClass('btn-info').addClass('btn-primary');
		$('#upload_box').show();
		$('#upload_progress_box').show();
		$('#upload_table_box').show();
		$('#upload_iframe').hide();
		$('#remote_iframe').hide();
	} else {
		$('#traditional_upload_btn').removeClass('btn-info').addClass('btn-primary');
		$('#upload_box').hide();
		$('#upload_progress_box').hide();
		$('#upload_table_box').hide();
		$('#upload_iframe').show();
		$('#remote_iframe').hide();
	}
	$('body').on('click', '#ajax_upload_btn', function(e) {
		e.preventDefault();
		$('#ajax_upload_btn').removeClass('btn-info').addClass('btn-primary');
		$('#traditional_upload_btn').removeClass('btn-primary').addClass('btn-info');
		$('#remote_upload_btn').removeClass('btn-primary').addClass('btn-info');
		$('#upload_box').show();
		$('#upload_progress_box').show();
		$('#upload_table_box').show();
		$('#upload_iframe').hide();
		$('#remote_iframe').hide();
	});
	$('body').on('click', '#traditional_upload_btn', function(e) {
		e.preventDefault();
		$('#traditional_upload_btn').removeClass('btn-info').addClass('btn-primary');
		$('#ajax_upload_btn').removeClass('btn-primary').addClass('btn-info');
		$('#remote_upload_btn').removeClass('btn-primary').addClass('btn-info');
		$('#upload_box').hide();
		$('#upload_progress_box').hide();
		$('#upload_table_box').hide();
		$('#upload_iframe').show();
		$('#remote_iframe').hide();
	});
	$('body').on('click', '#remote_upload_btn', function(e) {
		e.preventDefault();
		$('#remote_upload_btn').removeClass('btn-info').addClass('btn-primary');
		$('#ajax_upload_btn').removeClass('btn-primary').addClass('btn-info');
		$('#traditional_upload_btn').removeClass('btn-primary').addClass('btn-info');
		$('#upload_box').hide();
		$('#upload_progress_box').hide();
		$('#upload_table_box').hide();
		$('#upload_iframe').hide();
		$('#remote_iframe').show();
	});
	$('#upload_box').on('drop', function(e) {
		e.preventDefault();
		var files = e.originalEvent.dataTransfer.files;
		var length = e.originalEvent.dataTransfer.files.length;
		for (var i = 0; i < length; i++) {
			$('#upload_progress').css('width', '0%');
			var formData = new FormData();
			formData.append('file[]', files[i]);
			$.ajax({
				url: 'uploadfile.php',
				data: formData,
				type: 'post',
				dataType: 'html',
				processData: false, //important!
				contentType: false,
				cache: false,
				xhr: function() {
					var myXhr = $.ajaxSettings.xhr();
					if (myXhr.upload) {
						myXhr.upload.addEventListener('progress', progressload, false);
					}
					return myXhr;
				},
				success: function(data) {
					$('#upload_table').append(data);
					updateAll();
				},
				error: function() {
					swal('上傳程序發生錯誤', 'warning');
				}
			});
		}
	});
	$('#file:file').on('change', function(e) {
		e.preventDefault();
		$('#upload_progress').css('width', '0%');
		var files = this.files;
		var length = $(this)[0].files.length;
		for (var i = 0; i < length; i++) {
			$('#upload_progress').css('width', '0%');
			var uploadData = new FormData();
			uploadData.append('file[]', files[i]);
			$.ajax({
				url: 'uploadfile.php',
				data: uploadData,
				type: 'post',
				dataType: 'html',
				processData: false, //important!
				contentType: false,
				cache: false,
				xhr: function() {
					var myXhr = $.ajaxSettings.xhr();
					if (myXhr.upload) {
						myXhr.upload.addEventListener('progress', progressload, false);
					}
					return myXhr;
				},
				success: function(data) {
					$('#upload_table').append(data);
					updateAll();
				},
				error: function() {
					swal('上傳程序發生錯誤', '', 'warning');
				}
			});
		}
	});
	$('div #upload_box').on('dragover', function(e) {
		e.preventDefault();
		$(this).addClass('dragover_box');
	});
	$('div #upload_box').on('dragleave', function(e) {
		e.preventDefault();
		$(this).removeClass('dragover_box');
	});
	$('div #upload_box').on('dragenter', function(e) {
		e.preventDefault();
		$(this).addClass('dragover_box');
	});
	$('div #upload_box').on('dragout', function(e) {
		e.preventDefault();
		$(this).removeClass('dragover_box');
	});

	/* 啟動 AJAX */
	updateAll();
	checkUpdate();
});
!function(a,b){function c(b){var c=p(),d=c.querySelector("h2"),e=c.querySelector("p"),f=c.querySelector("button.cancel"),g=c.querySelector("button.confirm");if(d.innerHTML=u(b.title).split("\n").join("<br>"),e.innerHTML=u(b.text||"").split("\n").join("<br>"),b.text&&w(e),y(c.querySelectorAll(".icon")),b.type){for(var h=!1,i=0;i<n.length;i++)if(b.type===n[i]){h=!0;break}if(!h)return a.console.error("Unknown alert type: "+b.type),!1;var j=c.querySelector(".icon."+b.type);switch(w(j),b.type){case"success":s(j,"animate"),s(j.querySelector(".tip"),"animateSuccessTip"),s(j.querySelector(".long"),"animateSuccessLong");break;case"error":s(j,"animateErrorIcon"),s(j.querySelector(".x-mark"),"animateXMark");break;case"warning":s(j,"pulseWarning"),s(j.querySelector(".body"),"pulseWarningIns"),s(j.querySelector(".dot"),"pulseWarningIns")}}if(b.imageUrl){var k=c.querySelector(".icon.custom");k.style.backgroundImage="url("+b.imageUrl+")",w(k);var l=80,m=80;if(b.imageSize){var o=b.imageSize.split("x")[0],q=b.imageSize.split("x")[1];o&&q?(l=o,m=q,k.css({width:o+"px",height:q+"px"})):a.console.error("Parameter imageSize expects value with format WIDTHxHEIGHT, got "+b.imageSize)}k.setAttribute("style",k.getAttribute("style")+"width:"+l+"px; height:"+m+"px")}c.setAttribute("data-has-cancel-button",b.showCancelButton),b.showCancelButton?f.style.display="inline-block":y(f),c.setAttribute("data-has-confirm-button",b.showConfirmButton),b.showConfirmButton?g.style.display="inline-block":y(g),b.cancelButtonText&&(f.innerHTML=u(b.cancelButtonText)),b.confirmButtonText&&(g.innerHTML=u(b.confirmButtonText)),g.className="confirm btn btn-lg",s(c,b.containerClass),s(g,b.confirmButtonClass),s(f,b.cancelButtonClass),s(d,b.titleClass),s(e,b.textClass),c.setAttribute("data-allow-ouside-click",b.allowOutsideClick);var r=b.doneFunction?!0:!1;c.setAttribute("data-has-done-function",r),c.setAttribute("data-timer",b.timer)}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function e(){var a=p();B(q(),10),w(a),s(a,"showSweetAlert"),t(a,"hideSweetAlert"),h=b.activeElement;var c=a.querySelector("button.confirm");c.focus(),setTimeout(function(){s(a,"visible")},500);var d=a.getAttribute("data-timer");"null"!==d&&""!==d&&setTimeout(function(){f()},d)}function f(){var c=p();C(q(),5),C(c,5),t(c,"showSweetAlert"),s(c,"hideSweetAlert"),t(c,"visible");var d=c.querySelector(".icon.success");t(d,"animate"),t(d.querySelector(".tip"),"animateSuccessTip"),t(d.querySelector(".long"),"animateSuccessLong");var e=c.querySelector(".icon.error");t(e,"animateErrorIcon"),t(e.querySelector(".x-mark"),"animateXMark");var f=c.querySelector(".icon.warning");t(f,"pulseWarning"),t(f.querySelector(".body"),"pulseWarningIns"),t(f.querySelector(".dot"),"pulseWarningIns"),a.onkeydown=j,b.onclick=i,h&&h.focus(),k=void 0}function g(){var a=p();a.style.marginTop=A(p())}var h,i,j,k,l=".sweet-alert",m=".sweet-overlay",n=["error","warning","info","success"],o={title:"",text:"",type:null,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!0,closeOnConfirm:!0,closeOnCancel:!0,confirmButtonText:"OK",confirmButtonClass:"btn-primary",cancelButtonText:"Cancel",cancelButtonClass:"btn-default",containerClass:"",titleClass:"",textClass:"",imageUrl:null,imageSize:null,timer:null},p=function(){return b.querySelector(l)},q=function(){return b.querySelector(m)},r=function(a,b){return new RegExp(" "+b+" ").test(" "+a.className+" ")},s=function(a,b){b&&!r(a,b)&&(a.className+=" "+b)},t=function(a,b){var c=" "+a.className.replace(/[\t\r\n]/g," ")+" ";if(r(a,b)){for(;c.indexOf(" "+b+" ")>=0;)c=c.replace(" "+b+" "," ");a.className=c.replace(/^\s+|\s+$/g,"")}},u=function(a){var c=b.createElement("div");return c.appendChild(b.createTextNode(a)),c.innerHTML},v=function(a){a.style.opacity="",a.style.display="block"},w=function(a){if(a&&!a.length)return v(a);for(var b=0;b<a.length;++b)v(a[b])},x=function(a){a.style.opacity="",a.style.display="none"},y=function(a){if(a&&!a.length)return x(a);for(var b=0;b<a.length;++b)x(a[b])},z=function(a,b){for(var c=b.parentNode;null!==c;){if(c===a)return!0;c=c.parentNode}return!1},A=function(a){a.style.left="-9999px",a.style.display="block";var b=a.clientHeight,c=parseInt(getComputedStyle(a).getPropertyValue("padding"),10);return a.style.left="",a.style.display="none","-"+parseInt(b/2+c)+"px"},B=function(a,b){if(+a.style.opacity<1){b=b||16,a.style.opacity=0,a.style.display="block";var c=+new Date,d=function(){a.style.opacity=+a.style.opacity+(new Date-c)/100,c=+new Date,+a.style.opacity<1&&setTimeout(d,b)};d()}},C=function(a,b){b=b||16,a.style.opacity=1;var c=+new Date,d=function(){a.style.opacity=+a.style.opacity-(new Date-c)/100,c=+new Date,+a.style.opacity>0?setTimeout(d,b):a.style.display="none"};d()},D=function(c){if(MouseEvent){var d=new MouseEvent("click",{view:a,bubbles:!1,cancelable:!0});c.dispatchEvent(d)}else if(b.createEvent){var e=b.createEvent("MouseEvents");e.initEvent("click",!1,!1),c.dispatchEvent(e)}else b.createEventObject?c.fireEvent("onclick"):"function"==typeof c.onclick&&c.onclick()},E=function(b){"function"==typeof b.stopPropagation?(b.stopPropagation(),b.preventDefault()):a.event&&a.event.hasOwnProperty("cancelBubble")&&(a.event.cancelBubble=!0)};a.sweetAlertInitialize=function(){var a='<div class="sweet-overlay" tabIndex="-1"></div><div class="sweet-alert" tabIndex="-1"><div class="icon error"><span class="x-mark"><span class="line left"></span><span class="line right"></span></span></div><div class="icon warning"> <span class="body"></span> <span class="dot"></span> </div> <div class="icon info"></div> <div class="icon success"> <span class="line tip"></span> <span class="line long"></span> <div class="placeholder"></div> <div class="fix"></div> </div> <div class="icon custom"></div> <h2>Title</h2><p class="lead text-muted">Text</p><p><button class="cancel btn btn-lg" tabIndex="2">Cancel</button> <button class="confirm btn btn-lg" tabIndex="1">OK</button></p></div>',c=b.createElement("div");c.innerHTML=a,b.body.appendChild(c)},a.sweetAlert=a.swal=function(){function h(a){var b=a.keyCode||a.which;if(-1!==[9,13,32,27].indexOf(b)){for(var c=a.target||a.srcElement,d=-1,e=0;e<w.length;e++)if(c===w[e]){d=e;break}9===b?(c=-1===d?u:d===w.length-1?w[0]:w[d+1],E(a),c.focus()):(c=13===b||32===b?-1===d?u:void 0:27!==b||v.hidden||"none"===v.style.display?void 0:v,void 0!==c&&D(c,a))}}function l(a){var b=a.target||a.srcElement,c=a.relatedTarget,d=r(n,"visible");if(d){var e=-1;if(null!==c){for(var f=0;f<w.length;f++)if(c===w[f]){e=f;break}-1===e&&b.focus()}else k=b}}if(void 0===arguments[0])return a.console.error("sweetAlert expects at least 1 attribute!"),!1;var m=d({},o);switch(typeof arguments[0]){case"string":m.title=arguments[0],m.text=arguments[1]||"",m.type=arguments[2]||"";break;case"object":if(void 0===arguments[0].title)return a.console.error('Missing "title" argument!'),!1;m.title=arguments[0].title,m.text=arguments[0].text||o.text,m.type=arguments[0].type||o.type,m.allowOutsideClick=arguments[0].allowOutsideClick||o.allowOutsideClick,m.showCancelButton=void 0!==arguments[0].showCancelButton?arguments[0].showCancelButton:o.showCancelButton,m.showConfirmButton=void 0!==arguments[0].showConfirmButton?arguments[0].showConfirmButton:o.showConfirmButton,m.closeOnConfirm=void 0!==arguments[0].closeOnConfirm?arguments[0].closeOnConfirm:o.closeOnConfirm,m.closeOnCancel=void 0!==arguments[0].closeOnCancel?arguments[0].closeOnCancel:o.closeOnCancel,m.timer=arguments[0].timer||o.timer,m.confirmButtonText=o.showCancelButton?"Confirm":o.confirmButtonText,m.confirmButtonText=arguments[0].confirmButtonText||o.confirmButtonText,m.confirmButtonClass=arguments[0].confirmButtonClass||(arguments[0].type?"btn-"+arguments[0].type:null)||o.confirmButtonClass,m.cancelButtonText=arguments[0].cancelButtonText||o.cancelButtonText,m.cancelButtonClass=arguments[0].cancelButtonClass||o.cancelButtonClass,m.containerClass=arguments[0].containerClass||o.containerClass,m.titleClass=arguments[0].titleClass||o.titleClass,m.textClass=arguments[0].textClass||o.textClass,m.imageUrl=arguments[0].imageUrl||o.imageUrl,m.imageSize=arguments[0].imageSize||o.imageSize,m.doneFunction=arguments[1]||null;break;default:return a.console.error('Unexpected type of argument! Expected "string" or "object", got '+typeof arguments[0]),!1}c(m),g(),e();for(var n=p(),q=function(a){var b=a.target||a.srcElement,c=b.className.indexOf("confirm")>-1,d=r(n,"visible"),e=m.doneFunction&&"true"===n.getAttribute("data-has-done-function");switch(a.type){case"click":if(c&&e&&d)m.doneFunction(!0),m.closeOnConfirm&&f();else if(e&&d){var g=String(m.doneFunction).replace(/\s/g,""),h="function("===g.substring(0,9)&&")"!==g.substring(9,10);h&&m.doneFunction(!1),m.closeOnCancel&&f()}else f()}},s=n.querySelectorAll("button"),t=0;t<s.length;t++)s[t].onclick=q;i=b.onclick,b.onclick=function(a){var b=a.target||a.srcElement,c=n===b,d=z(n,a.target),e=r(n,"visible"),g="true"===n.getAttribute("data-allow-ouside-click");!c&&!d&&e&&g&&f()};var u=n.querySelector("button.confirm"),v=n.querySelector("button.cancel"),w=n.querySelectorAll("button:not([type=hidden])");j=a.onkeydown,a.onkeydown=h,u.onblur=l,v.onblur=l,a.onfocus=function(){a.setTimeout(function(){void 0!==k&&(k.focus(),k=void 0)},0)}},a.swal.setDefaults=function(a){if(!a)throw new Error("userParams is required");if("object"!=typeof a)throw new Error("userParams has to be a object");d(o,a)},a.swal.close=function(){f()},function(){"complete"===b.readyState||"interactive"===b.readyState&&b.body?sweetAlertInitialize():b.addEventListener?b.addEventListener("DOMContentLoaded",function a(){b.removeEventListener("DOMContentLoaded",a,!1),sweetAlertInitialize()},!1):b.attachEvent&&b.attachEvent("onreadystatechange",function c(){"complete"===b.readyState&&(b.detachEvent("onreadystatechange",c),sweetAlertInitialize())})}()}(window,document);
<?php
/*
Allen Disk 1.4
Copyright (C) 2012~2014 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
if (!session_id()) {
    session_start();
    //setcookie(session_name(),session_id(),0, '/' . parse_url($config['url'])['path']);
}
?>
<!DOCTYPE html>
<html>
<head>
<title>登入 - <?php echo $config['sitename'];?></title>
<meta charset="utf-8" />
<link href="css/bootstrap.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style>
	html,body{height:100%;width:100%;}
	body{background: transparent linear-gradient(to right bottom, #2196F3 0%, #43E3A6 100%) repeat scroll 0% 0%;position:relative}
	h1,p,a{color:#FFF}
	h1{margin:.5em;font-weight:100}
	.panel{background:rgba(255,255,255,.5)}
	label{color:#333}
	.alert{margin:5em 0 1em}
</style>
<script>
    $(function() {
        $('button').on('click', function(e){
            e.preventDefault();
            $.ajax({
                url: 'loginc.php',
                type: 'POST',
                dataType: 'text',
                data: {
                    name: $('#name').val(),
                    password: $('#password').val()
                },
                cache: false,
                success: function(data) {
                    if(data == 1){
                        $('.alertcon').empty().html('<div class="alert alert-danger"><p>帳號或密碼有錯誤</p></div>');
                    }else if(data == 2){
                        $('.alertcon').empty().html('<div class="alert alert-success"><p>登入成功</p></div>');
                        setTimeout(function(){location.href = 'home.php';}, 1000);
                    }else{
                        $('.alertcon').empty().html('<div class="alert alert-danger"><p>系統發生錯誤</p></div>');
                    }
                }
            });
        });
    });
</script>
</head>
<body>
<div class="container">
	<div class="col-md-4 col-md-offset-4 alertcon">
        <div class="alert"><p>&nbsp;</p></div>
	</div>
	<div class="col-md-12">
		<h1 class="text-center"><?php echo $config['sitetitle']; ?></h1>
	</div>
    <div class="row" style="margin:0 auto;">
        <div class="col-md-4 col-md-offset-4">
            <div class="panel panel-default">
                <div class="panel-body">
                        <form class="form-horizontal" action="loginc.php" method="post" role="form" style="margin:20px">
                            <div class="form-group">
                                <label class="control-label" for="name">帳號</label>
                                <div class="controls">
                                    <input type="text" id="name" class="form-control" name="name">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="password">密碼</label>
                                <div class="controls">
                                    <input type="password" id="password" class="form-control" name="password">
                                </div>
                            </div>
                            <br/>
                            <div class="form-group">
                                <div class="controls">
                                    <button type="submit" class="btn btn-success btn-block">登入</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <a href="index.php">← 回首頁</a> <?php if ($config['reg'] == 'true') {
    ?><a href="reg.php" class="pull-right">註冊新帳號 →</a><?php 
} ?>
            </div>
        </div>
    <br />
    <p class="text-center">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</div>
</body>
</html>
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/

include 'config.php';
if (!session_id()) {
    session_start();
}
include dirname(__FILE__).'/class/password_compat.php';
function login($username, $password)
{
    $res = $GLOBALS['db']->select('user', array('name' => $username));

    if (password_verify($password, $res[0]['pass'])) {
        return true;
    } else {
        return false;
    }
}

function md5_128($text)
{
    for ($i = 0; $i < 128; ++$i) {
        $text = md5($text);
    }

    return $text;
}

$username = $_POST['name'];
$password = $_POST['password'];
$res = login($username, $password);
switch ($res) {
    case 0:
        echo 1;
    break;

    case 1:
        $_SESSION['login'] = true;
        $_SESSION['username'] = htmlspecialchars($username);
        $_SESSION['password'] = md5_128($password);
        echo 2;
    break;

    default:
        echo 0;
    break;
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
session_name($_COOKIE['session_name']);
session_start();
session_destroy();
header('Location: login.php');
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
if (!session_id()) {
    session_start();
}
if (!$_SESSION['login']) {
    exit();
}
$re = 0;
if (isset($_POST['name']) && $_POST['name'] != null) {
    $name = str_replace('/', '', $_POST['name']);
    $dircheck = $db->select('dir', array('owner' => $_SESSION['username'], 'name' => $name, 'parent' => $_SESSION['dir']));
    if ($dircheck[0]['id'] != null) {
        $re = 1;
    } else {
        $db->insert(array('id' => sha1(md5(mt_rand().uniqid())), 'name' => $name, 'owner' => $_SESSION['username'], 'parent' => $_SESSION['dir'], 'recycle' => '0'), 'dir');
        $re = 2;
        $token = @touch(dirname(__FILE__).'/updatetoken/'.md5($_SESSION['username']).'.token');
    }
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="js/bootstrap.min.js"></script>
</head>
<body>
    <div class="repsd">
    <?php if ($re == 1) {
    echo '<div class="alert alert-warning" role="alert">此目錄下有重複名稱的資料夾</div>';
} elseif ($re == 2) {
    echo '<div class="alert alert-success" role="alert">新增完成</div>';
}
    ?>
        <form action="mkdir.php" method="post" role="form">
            <div class="form-group">
                <input type="text" name="name" id="name" placeholder="資料夾名稱" class="form-control" required />
            </div>
            <input type="submit" value="送出" class="btn btn-info"/>
        </form>
    </div>
</body>
</html>
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/

include 'config.php';
if (!session_id()) {
    session_start();
}
header('Cache-Control: no-store, no-cache, must-revalidate');
function decode_file($id)
{
    $res = $GLOBALS['db']->select('file', array('id' => $id));
    $passphrase = decrypt_code($res[0]['secret']);
    $iv = md5("\x1B\x3C\x58".$passphrase, true).md5("\x1B\x3C\x58".$passphrase, true);
    $key = substr(md5("\x2D\xFC\xD8".$passphrase, true).md5("\x2D\xFC\xD9".$passphrase, true), 0, 24);
    $opts = array('iv' => $iv, 'key' => $key);
    $fp = fopen('./file/'.$res[0]['realname'].'.data', 'rb');
    stream_filter_append($fp, 'mdecrypt.rijndael-256', STREAM_FILTER_READ, $opts);
    $blocksize = mcrypt_get_block_size(MCRYPT_RIJNDAEL_256, 'cbc');
    echo @substr(stream_get_contents($fp), 0, -($blocksize - ($res[0]['size'] % $blocksize)));
}
function decrypt_code($code)
{
    $passphrase['b'] = $_SESSION['password'];
    $passphrase['c'] = $code;
    $iv = md5("\x1B\x3C\x58".$passphrase['b'], true).md5("\x1B\x3C\x58".$passphrase['b'], true);
    $key = substr(md5("\x2D\xFC\xD8".$passphrase['b'], true).md5("\x2D\xFC\xD9".$passphrase['b'], true), 0, 24);

    return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($passphrase['c']), MCRYPT_MODE_CBC, $iv), "\0\3");
}
if (isset($_GET['id']) && $_GET['id'] != null) {
    $res = $db->select('file', array('id' => $_GET['id']));
    if ($res[0]['owner'] != $_SESSION['username']) {
        header('Location:index.php');
        exit();
    }
    if (preg_match("/image\/(.*)/i", $res[0]['type'])) {
        echo '<img src="readfile.php?id='.$res[0]['id'].'&password='.decrypt_code($res[0]['secret']).'" style="max-width:90%; max-height:90%; width:auto; height:auto;" />';
    } elseif (preg_match("/audio\/(.*)/i", $res[0]['type'])) {
        echo '<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
        <script src="js/audio.min.js"></script>
        <script>
            $(document).ready(function(){
                audiojs.events.ready(function() {
                    var as = audiojs.createAll();
                });
            });
        </script>
        <audio preload="auto" style="width:100%;">
            <source src="readfile.php?id='.$res[0]['id'].'&password='.decrypt_code($res[0]['secret']).'" />
        </audio>';
    } elseif (preg_match("/video\/(.*)/i", $res[0]['type'])) {
        echo '<video style="width:100%;height:90%;" controls><source src="readfile.php?id='.$res[0]['id'].'&password='.decrypt_code($res[0]['secret']).'" type="'.$res[0]['type'].'">很抱歉，您的瀏覽器暫時無法預覽影片</video>';
    } elseif ($res[0]['type'] == 'text/html') {
        header('Content-Type: text/html');
        echo decode_file($_GET['id']);
    } elseif (preg_match("/text\/(.*)/i", $res[0]['type'])) {
        header('Content-Type: text/html');
        header('Content-Disposition: inline; filename="'.$res[0]['name'].'"');
        echo htmlspecialchars((decode_file($_GET['id'])));
    } elseif ($res[0]['type'] == 'application/msword' || $res[0]['type'] == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' || $res[0]['type'] == 'application/vnd.ms-excel' || $res[0]['type'] == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || $res[0]['type'] == 'application/vnd.ms-powerpoint' || $res[0]['type'] == 'application/vnd.openxmlformats-officedocument.presentationml.presentation') {
        $token = base64_encode(json_encode(array(array('id' => $_GET['id'], 'time' => time(), 'dir' => $res[0]['dir']))));
        $url = $config['url'].'readfile.php?id='.$_GET['id'].'&pretoken='.$token.'&password='.decrypt_code($res[0]['secret']);
        //header("Location: https://view.officeapps.live.com/op/view.aspx?src=".urlencode($url));
        echo '
        <!DOCTYPE html>
            <html lang="en">
            <head>
                <meta charset="UTF-8">
                
                <script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
                <script src="//netdna.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
                <link href="css/bootstrap.min.css" rel="stylesheet">
                <title>Document</title>
                <script>
                    $(function(){
                        $("#link").on("click", function(){
                            parent.$("#preview-file").modal("hide");
                        });

                    });
                </script>
         </head>
         <body>
             <base target="_blank">
             <a id="link" target="_blank" class="btn btn-primary" href="https://view.officeapps.live.com/op/view.aspx?src='.urlencode($url).'">在新的分頁開啟</a>
             
         </body>
         </html>';
    }
}
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
if (!session_id()) {
    session_start();
}
$res = $db->select('file', array('id' => $_GET['id'], 'recycle' => '0'));
if (!$_SESSION['login'] || $_SESSION['username'] != $res[0]['owner']) {
    if ($_SERVER['HTTP_REFERER'] != $config['url'].'downfile.php?id='.$_GET['id'].'&password='.$_GET['password']) {
        header('Location: '.$config['url'].'downfile.php?id='.$_GET['id'].'&password='.$_GET['password']);
        exit();
    }
    if (isset($_GET['download']) && $_GET['download'] == 'true') {
        exit();
    }
}

/* Decode Phrase */
if ($_GET['download'] == 'true') {
    $passphrase['b'] = $_SESSION['password'];
    $passphrase['c'] = $res[0]['secret'];
    $iv = md5("\x1B\x3C\x58".$passphrase['b'], true).md5("\x1B\x3C\x58".$passphrase['b'], true);
    $key = substr(md5("\x2D\xFC\xD8".$passphrase['b'], true).md5("\x2D\xFC\xD9".$passphrase['b'], true), 0, 24);
    $passphrase['a'] = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($passphrase['c']), MCRYPT_MODE_CBC, $iv), "\0\3");
} else {
    $passphrase['a'] = $_GET['password'];
}
$iv = md5("\x1B\x3C\x58".$passphrase['a'], true).md5("\x1B\x3C\x58".$passphrase['a'], true);
$key = substr(md5("\x2D\xFC\xD8".$passphrase['a'], true).md5("\x2D\xFC\xD9".$passphrase['a'], true), 0, 24);
$opts = array('iv' => $iv, 'key' => $key);
$fp = fopen('./file/'.$res[0]['realname'].'.data', 'rb');
stream_filter_append($fp, 'mdecrypt.rijndael-256', STREAM_FILTER_READ, $opts);

header('Content-Type: application/octet-stream');
header('Content-Transfer-Encoding: binary');
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="'.$res[0]['name'].'"');
$blocksize = mcrypt_get_block_size(MCRYPT_RIJNDAEL_256, 'cbc');
echo @substr(stream_get_contents($fp), 0, -($blocksize - ($res[0]['size'] % $blocksize)));
<?php

/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
if (!session_id()) {
    session_start();
}

$data = $_SESSION;
session_write_close();

ob_clean();
//ini_set('error_reporting', E_ALL);
ini_set('zlib.output_compression', 'Off');
if (function_exists('apache_setenv')) {
    @apache_setenv('no-gzip', 1);
}

$res = $db->select('file', array('id' => $_GET['id'], 'recycle' => '0'));
if (isset($_GET['pretoken'])) {
    $pretoken = base64_decode($_GET['pretoken']);
    $pretoken = json_decode($pretoken, 1);
    $token = $pretoken[0];
} else {
    $token['id'] = '';
    $token['time'] = 0;
    $token['dir'] = '123';
}

if ($res[0]['owner'] == $data['username'] || $res[0]['share'] == '1' || ($token['id'] == $_GET['id'] && time() - $token['time'] < 15 && $token['dir'] == $res[0]['dir'])) {
    $size = intval($res[0]['size']);
    if (isset($_SERVER['HTTP_RANGE'])) {
        $ranges = array_map(
            'intval',
            explode(
                '-',
                substr($_SERVER['HTTP_RANGE'], 6)
            )
        );

        if (!$ranges[1]) {
            $ranges[1] = $size - 1;
        }
    }

    $passphrase = $_GET['password'];

    $iv = md5("\x1B\x3C\x58".$passphrase, true).md5("\x1B\x3C\x58".$passphrase, true);
    $key = substr(md5("\x2D\xFC\xD8".$passphrase, true).md5("\x2D\xFC\xD9".$passphrase, true), 0, 24);
    $opts = array('iv' => $iv, 'key' => $key);

    $fp = fopen('./file/'.$res[0]['realname'].'.data', 'rb');
    stream_filter_append($fp, 'mdecrypt.rijndael-256', STREAM_FILTER_READ, $opts);

    if (isset($ranges)) {
        header('HTTP/1.1 206 Partial Content');
        header('Accept-Ranges: bytes');
        header('Content-Length: '.($ranges[1] - $ranges[0]));
        header(
            sprintf(
                'Content-Range: bytes %d-%d/%d', // The header format
                $ranges[0], // The start range
                $ranges[1], // The end range
                $size // Total size of the file
            )
        );
    } else {
        header('HTTP/1.1 200 OK');
        header('Content-Length: '.$size);
    }

    header('Content-type: '.$res[0]['type']);

    if (isset($ranges)) {
        fseek($fp, $ranges[0]);

        while (ftell($fp) <= $ranges[1]) {
            if ($ranges[1] - ftell($fp) < 4096) {
                $chunk = $ranges - ftell($fp);
            } else {
                $chunk = 4096;
            }

            echo fread($fp, $chunk);

            flush();
            @ob_flush();
        }
    } else {
        $blocksize = mcrypt_get_block_size(MCRYPT_RIJNDAEL_256, 'cbc');
        echo @substr(stream_get_contents($fp), 0, -($blocksize - ($res[0]['size'] % $blocksize)));
    }
} else {
    header('HTTP/1.1 403 Unauthorized');
    echo 'Permission Denied';
}
<?php
/* Allen Disk 1.4
Copyright (C) 2012~2014 Allen Chou 
Author: Allen Chou ( http://allenchou.cc ) 
License: MIT License */
include 'config.php';
include 'captcha/simple-php-captcha.php';
include 'class/password_compat.php';
if (!session_id()) {
    session_start();
}
if (isset($_POST[ 'name']) && isset($_POST[ 'password2']) && isset($_POST[ 'password']) && $config[ 'reg'] == 'true') {
    $username = $_POST[ 'name'];
    $email = $_POST[ 'email'];
    $password = $_POST[ 'password'];
    $password2 = $_POST[ 'password2'];
    $namecheck = $db->ExecuteSQL(sprintf("SELECT count(*) AS `count` FROM `user` WHERE `name` = '%s'", $db->SecureData($username)));
    if ($namecheck[0]['count'] > 0) {
        $err = 2;
    } elseif ($username == '') {
        $err = 0;
    } elseif ($email == '') {
        $err = 0;
    } elseif ($password == '') {
        $err = 0;
    } elseif ($password != $password2) {
        $err = 1;
    } elseif (strtolower($_POST['captcha']) != strtolower($_SESSION['captcha']['code'])) {
        $err = 4;
    } else {
        $db->insert(array('name' => $username, 'pass' => password_hash($password, PASSWORD_DEFAULT), 'email' => $email), 'user');
        $err = 3;
    }
}
$_SESSION['captcha'] = simple_php_captcha();
?>
<!DOCTYPE html>
<html>

<head>
	<title>註冊 -
		<?php echo $config[ 'sitename'];?>
	</title>
	<meta charset="utf-8" />
	<link href="css/bootstrap.min.css" rel="stylesheet">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<style>
		body {
			background-color: #F8F8F8;
		}
	</style>
	<script src="js/bootstrap.min.js"></script>
</head>

<body>
	<div class="container">
		<h1 class="text-center">Allen Disk</h1>
		<div class="col-md-6 col-md-offset-3">
			<?php if ($_SESSION[ 'login']) {
    ?>
			<ul class="nav nav-tabs">
				<li><a href="index.php">首頁</a>
				</li>
				<li><a href="logout.php">登出</a>
				</li>
			</ul>
			<?php 
} else {
    ?>
			<ul class="nav nav-tabs">
				<li><a href="index.php">首頁</a>
				</li>
				<?php if ($config[ 'why']) {
    ?>
				<li>
					<a href="why.php">
						<?php echo $config[ 'sitename'];
    ?>的好處</a>
				</li>
				<?php 
}
    ?>
				<li><a href="login.php">登入</a>
				</li>
				<?php if ($config[ 'reg']) {
    ?>
				<li class="active"><a href="reg.php">註冊</a>
				</li>
				<?php 
}
    ?>
				<?php if ($config[ 'tos']) {
    ?>
				<li><a href="tos.php">使用條款</a>
				</li>
				<?php 
}
    ?>
			</ul>
			<?php 
} ?>
			<?php if ($config[ 'reg']) {
    ?>
			<?php if ($err == '1') {
    	echo '<div class="alert alert-danger">兩次輸入的密碼必須相同</div>';
	} elseif (isset($err) && $err == '0') {
        echo '<div class="alert alert-danger">不能有任何欄位是空白的</div>';
    } elseif (isset($err) && $err == '2') {
        echo '<div class="alert alert-danger">已經有重複的帳號</div>';
    } elseif (isset($err) && $err == '3') {
        echo '<div class="alert alert-success">註冊完成</div>';
    } elseif (isset($err) && $err == '4') {
        echo '<div class="alert alert-danger">驗證碼錯誤</div>';
    }
    ?>
			<br/>
			<div class="panel panel-default">
				<div class="panel-body">
					<form action="reg.php" method="post" role="form">
						<div class="row">
							<div class="col-sm-6">
								<div class="form-group">
									<label class="control-label" for="name">帳號</label>
									<div class="controls">
										<input type="text" id="name" class="form-control" placeholder="Username" name="name">
									</div>
								</div>
							</div>
							<div class="col-sm-6">
								<div class="form-group">
									<label class="control-label" for="email">電子郵件</label>
									<div class="controls">
										<input type="text" id="email" placeholder="Email" name="email" class="form-control">
									</div>
								</div>
							</div>
							<div class="col-sm-6">
								<div class="form-group">
									<label class="control-label" for="password">密碼</label>
									<div class="controls">
										<input type="password" id="password" placeholder="Password" name="password" class="form-control">
									</div>
								</div>
							</div>
							<div class="col-sm-6">
								<div class="form-group">
									<label class="control-label" for="password2">重新輸入密碼</label>
									<div class="controls">
										<input type="password" id="password2" placeholder="Password again" name="password2" class="form-control">
									</div>
								</div>
							</div>
							<div class="col-sm-6">
								<div class="form-group">
									<label class="control-label" for="captcha">驗證碼（不分大小寫）</label>
									<div class="controls">
										<input type="text" id="captcha" placeholder="Captcha" name="captcha" class="form-control">
									</div>
								</div>
							</div>
							<div class="col-sm-6">
								<img src="<?php echo $_SESSION['captcha']['image_src'] ?>" alt="captcha" />
							</div>
							<div class="col-sm-12">
								<br/>
								<p>註冊後代表您已經同意<a href="tos.php">使用條款</a>且如果有違反，
									<?php echo $config[ 'sitename'];
    ?>將不必負任何責任</p>
								<div class="form-group">
									<div class="controls">
										<button type="submit" class="btn btn-primary">註冊</button>
									</div>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
			<?php 
} else {
    echo '<div class="alert alert-warning" role="alert">很抱歉，'.$config['sitename'].'已經關閉註冊</div>';
} ?>
		</div>
		<p class="text-center text-info col-md-12">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a>
		</p>
	</div>
</body>

</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
if (!session_id()) {
    session_start();
}
if (!$_SESSION['login']) {
    exit();
}
@ignore_user_abort(true);
@set_time_limit(0);
function sizecount($size)
{
    if ($size < 0.001) {
        return round(($size * 1000 * 1000), 2).'B';
    } elseif ($size >= 0.001 && $size < 1) {
        return round(($size * 1000), 2).'KB';
    } elseif ($size >= 1 && $size < 1000) {
        return round($size, 2).'MB';
    } elseif ($size >= 1000) {
        return round(($size / 1000), 2).'GB';
    }
}
function getname($url)
{
    if (stripos(urldecode(basename($_POST['file'])), '?') === false) {
        return urldecode(basename($_POST['file']));
    } else {
        $string = quotemeta('/'.urldecode(basename($url)));
        if (preg_match_all("/\/(.+)\?/i", $string, $matches)) {
            return stripslashes($matches[1][0]);
        }
    }
}

if (isset($_POST['file'])) {
    $result = '';
    if ($config['total'] != 0) {
        $used = $db->ExecuteSQL(sprintf('SELECT SUM(`size`) AS `sum` FROM `file` WHERE `owner` = \'%s\' AND `recycle` = \'0\'', $db->SecureData($_SESSION['username'])));
        if ($used[0]['sum'] >= ($config['total'] * 1000 * 1000)) {
            $result = 'totalout';
        }
    }
    $file = @file_get_contents($_POST['file']);
    $header = @get_headers($_POST['file'], 1);
    if ($file !== false && stripos($header[0], '200') !== false) {
        $name = getname($_POST['file']);
        if (strlen($file) == 0) { // 只有當無法正常偵測大小時才使用 header ，因為header可能被偽造
            $size = $header['Content-Length'];
        } else {
            $size = strlen($file);
        }
        if ($config['size'] != 0) {
            if ($size > ($config['size'] * 1000 * 1000)) {
                $result = 'sizeout';
            }
        }
        /* Create Key */
        $passphrase['a'] = sha1(md5(mt_rand().uniqid()));
        $passphrase['b'] = $_SESSION['password'];
        $iv = md5("\x1B\x3C\x58".$passphrase['b'], true).md5("\x1B\x3C\x58".$passphrase['b'], true);
        $key = substr(md5("\x2D\xFC\xD8".$passphrase['b'], true).md5("\x2D\xFC\xD9".$passphrase['b'], true), 0, 24);
        $passphrase['c'] = rtrim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $passphrase['a'], MCRYPT_MODE_CBC, $iv)), "\0\3");
        unset($key);
        unset($iv);

        $filename = sha1(md5(mt_rand().uniqid()));
        if ($result == '') {
            $iv = md5("\x1B\x3C\x58".$passphrase['a'], true).md5("\x1B\x3C\x58".$passphrase['a'], true);
            $key = substr(md5("\x2D\xFC\xD8".$passphrase['a'], true).md5("\x2D\xFC\xD9".$passphrase['a'], true), 0, 24);
            $opts = array('iv' => $iv, 'key' => $key);
            $fp = fopen($_POST['file'], 'rb');
            $dest = fopen('./file/'.$filename.'.data', 'wb');
            stream_filter_append($dest, 'mcrypt.rijndael-256', STREAM_FILTER_WRITE, $opts);
            stream_copy_to_stream($fp, $dest);
            fclose($fp);
            fclose($dest);
            $mkid = sha1(mt_rand().uniqid());
            $db->insert(array('name' => $name, 'size' => $size, 'owner' => $_SESSION['username'], 'id' => $mkid, 'secret' => $passphrase['c'], 'realname' => $filename, 'type' => $header['Content-Type'], 'dir' => $_SESSION['dir'], 'recycle' => '0'), 'file');
            $result = 'success';
        }
    } else {
        $result = 'nofile';
    }
    if ($result == 'success') {
        $data = '<tr><td>'.$name.'</td><td>'.sizecount($size / 1000 / 1000).'</td><td>上傳成功</td></tr>';
        $token = @touch(dirname(__FILE__).'/updatetoken/'.md5($_SESSION['username']).'.token');
    } else {
        if ($result == 'sizeout') {
            $sta = '檔案太大';
        } elseif ($result == 'totalout') {
            $sta = '帳戶空間不足';
        } elseif ($result == 'nofile') {
            $sta = '沒有選取的檔案';
        } else {
            $sta = '發生未知得錯誤';
        }

        $data = '<tr><td>Unknow</td><td>Unknow</td><td>'.$sta.'</td></tr>';
    }
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
</head>
<body>
    <form action="remotedownload.php" method="post">
        <input id="file" name="file" type="text" required class="form-control" placeholder="請輸入網址"></br>
        <input id="submit" name="submit" type="submit" class="btn btn-primary" value="開始上傳">
    </form>
    <br />
    <table class="table">
    <tr>
        <td>檔案名稱</td>
        <td>檔案大小</td>
        <td>上傳結果</td>
    </tr>
    <?php if (isset($_POST['file'])) {
    echo $data;
} ?>
    </table>
</body>
</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
include dirname(__FILE__).'/class/password_compat.php';
if (!session_id()) {
    session_start();
}
if (!$_SESSION['login']) {
    exit();
}

function md5_128($text)
{
    for ($i = 0; $i < 128; ++$i) {
        $text = md5($text);
    }

    return $text;
}

$re = 0;
if (isset($_POST['pass']) && isset($_POST['pass2'])) {
    if ($_POST['pass'] != $_POST['pass2']) {
        $re = 1;
    } else {
        if ($_POST['pass'] != null) {
            $db->update('user', array('pass' => password_hash($_POST['pass'], PASSWORD_DEFAULT)), array('name' => $_SESSION['username']));
            $new_password = md5_128($_POST['pass']);
            foreach ($db->select('file', array('owner' => $_SESSION['username'])) as $value) {
                /* Change Key */
                /* Get original key */
                $passphrase['b'] = $_SESSION['password'];
                $passphrase['c'] = $value['secret'];
                $iv = md5("\x1B\x3C\x58".$passphrase['b'], true).md5("\x1B\x3C\x58".$passphrase['b'], true);
                $key = substr(md5("\x2D\xFC\xD8".$passphrase['b'], true).md5("\x2D\xFC\xD9".$passphrase['b'], true), 0, 24);
                $passphrase['a'] = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($passphrase['c']), MCRYPT_MODE_CBC, $iv), "\0\3");

                /* Update new key */
                $passphrase['b'] = $new_password;
                $iv = md5("\x1B\x3C\x58".$passphrase['b'], true).md5("\x1B\x3C\x58".$passphrase['b'], true);
                $key = substr(md5("\x2D\xFC\xD8".$passphrase['b'], true).md5("\x2D\xFC\xD9".$passphrase['b'], true), 0, 24);
                $passphrase['c'] = rtrim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $passphrase['a'], MCRYPT_MODE_CBC, $iv)), "\0\3");
                $db->update('file', array('secret' => $passphrase['c']), array('id' => $value['id']));
            }
            $re = 2;
        }
    }
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="js/bootstrap.min.js"></script>
    <script>
        function redirection(){
            setTimeout(function(){
                window.parent.location.href = "logout.php";
            }, 3000);   
        }
    </script>
</head>
<body>
    <div class="repsd">
    <?php if ($re == 1) {
    echo '<div class="alert alert-warning" role="alert">兩次密碼不相同，請重新輸入</div>';
} elseif ($re == 2) {
    echo '<div class="alert alert-success" role="alert">變更完成，三秒後自動登出，請重新登入</div><script>redirection();</script>';
}
    ?>
        <form action="setpass.php" method="post" role="form">
            <div class="form-group">
                <input type="password" name="pass" id="pass" placeholder="密碼" class="form-control" required/>
            </div>
            <div class="form-group">
                <input type="password" name="pass2" id="pass2" placeholder="確認密碼" class="form-control" required/>
            </div>
            <input type="submit" value="送出" class="btn btn-info"/>
        </form>
    </div>
</body>
</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
function check_dir($id)
{
    $dir = $GLOBALS['db']->select('dir', array('id' => $id));
    if ($dir[0]['recycle'] == '1' || $dir[0]['share'] == '0') {
        return false;
    }
    if ($dir[0]['parent'] != '0') {
        $updir = $GLOBALS['db']->select('dir', array('id' => $dir[0]['parent']));
        if ($updir[0]['recycle'] == '1' || $updir[0]['share'] == '0') {
            return false;
        } else {
            return check_dir($updir[0]['id']);
        }
    } else {
        return true;
    }
}
function fileformat($type, $name)
{
    if (preg_match("/image\/(.*)/i", $type)) {
        echo strtoupper(str_replace('image/', '', $type)).' 圖檔';
    } elseif (preg_match("/audio\/(.*)/i", $type)) {
        echo strtoupper(str_replace('audio/', '', $type)).' 音樂檔';
    } elseif (preg_match("/video\/(.*)/i", $type)) {
        echo strtoupper(str_replace('video/', '', $type)).' 影片檔';
    } elseif (preg_match("/text\/(.*)/i", $type)) {
        echo '純文字檔';
    } elseif ($type == 'application/msword' || $type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
        echo 'MS Office Word';
    } elseif ($type == 'application/vnd.ms-excel' || $type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
        echo 'MS Office Excel';
    } elseif ($type == 'application/vnd.ms-powerpoint' || $type == 'application/vnd.openxmlformats-officedocument.presentationml.presentation') {
        echo 'MS Office Powerpoint';
    } elseif ($type == 'application/x-bzip2' || $type == 'application/x-gzip' || $type == 'application/x-7z-compressed' || $type == 'application/x-rar-compressed' || $type == 'application/zip' || $type == 'application/x-apple-diskimage' || $type == 'application/x-tar') {
        echo '壓縮檔';
    } else {
        echo strtoupper(substr($name, -(strlen($name) - strrpos($name, '.') - 1))).'檔';
    }
}
if (!session_id()) {
    session_start();
}
$dir = $db->select('dir', array('id' => $_GET['id']));
$dircheck = $db->select('dir', array('owner' => $dir[0]['owner'], 'parent' => $_GET['id'], 'recycle' => '0', 'share' => '1'));
$filecheck = $db->select('file', array('owner' => $dir[0]['owner'], 'dir' => $_GET['id'], 'recycle' => '0', 'share' => '1'));
if (!check_dir($_GET['id'])) {
    $alert = "<div class='alert alert-warning'>此資料夾不存在或是被設定為不公開</div>";
    $dir[0]['name'] = '空白資料夾';
} else {
    $alert = '';
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="js/bootstrap.min.js"></script>
    <title><?php echo $dir[0]['name'] ?> - <?php echo $config['sitename'] ?></title>
</head>
<body>
    <div class="container">
        <h1 class="text-center"><?php echo $config['sitetitle']; ?></h1>
        <?php
        if ($_SESSION['login']) {
            ?>
            <ul class="nav nav-tabs">
                <li><a href="index.php">首頁</a></li>
                <li><a href="logout.php">登出</a></li>
            </ul>
        <?php 
        } else {
            ?>
            <ul class="nav nav-tabs">
                <li><a href="index.php">首頁</a></li>
                <?php if ($config['why']) {
    ?><li><a href="why.php"><?php echo $config['sitename'];
    ?>的好處</a></li><?php 
}
            ?>
                <li><a href="login.php">登入</a></li>
                <?php if ($config['reg']) {
    ?><li><a href="reg.php">註冊</a></li><?php 
}
            ?>
                <?php if ($config['tos']) {
    ?><li><a href="tos.php">使用條款</a></li><?php 
}
            ?>
            </ul>
        <?php 
        } ?>
        <h2>檢視<?php echo $dir[0]['name'] ?></h2>
        <?php echo $alert; ?>
        <table class="table">
            <thead>
                <tr>
                    <td>檔名</td>
                    <td>檔案類型</td>
                    <td>動作</td>
                </tr>
            </thead>
            <tbody>
            <?php
            if ($alert == '') {
                if ($dircheck[0]['id'] != null) {
                    foreach ($dircheck as $d) {
                        ?>
                        <tr>
                            <td><?php echo $d['name'];
                        ?></td>
                            <td>資料夾</td>
                            <td><a href="share_dir.php?id=<?php echo $d['id'];
                        ?>" class="btn btn-default">開啟</a></td>
                        </tr>
            <?php 
                    }
                }
                if ($filecheck[0]['id'] != null) {
                    foreach ($filecheck as $d) {
                        ?>
                        <tr>
                            <td><?php echo $d['name'];
                        ?></td>
                            <td><?php fileformat($d['type'], $d['name']);
                        ?></td>
                            <td><a href="downfile.php?id=<?php echo $d['id'];
                        ?>" target="_blank" class="btn btn-default">下載</a></td>
                        </tr>
            <?php 
                    }
                }
            } ?>
            </tbody>
        </table>
        <p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
    </div>
</body>
</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
if (!session_id()) {
    session_start();
}
if (!$config['tos']) {
    header('Location: index.php');
}
?>
<!DOCTYPE html>
<html>
<head>
<title>使用者條款 - <?php echo $config['sitename'];?></title>
<meta charset="utf-8" />
<link href="css/bootstrap.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>body{ background-color: #F8F8F8; }</style>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
    <div class="container">
    	<h1 class="text-center"><?php echo $config['sitetitle']; ?></h1>
        <?php
        if (isset($_SESSION['login']) && $_SESSION['login'] === true) {
            ?>
            <ul class="nav nav-tabs">
                <li><a href="index.php">首頁</a></li>
                <li><a href="logout.php">登出</a></li>
            </ul>
        <?php 
        } else {
            ?>
            <ul class="nav nav-tabs">
                <li><a href="index.php">首頁</a></li>
                <?php if ($config['why']) {
    ?><li><a href="why.php"><?php echo $config['sitename'];
    ?>的好處</a></li><?php 
}
            ?>
                <li><a href="login.php">登入</a></li>
                <?php if ($config['reg']) {
    ?><li><a href="reg.php">註冊</a></li><?php 
}
            ?>
                <?php if ($config['tos']) {
    ?><li class="active"><a href="tos.php">使用條款</a></li><?php 
}
            ?>
            </ul>
        <?php 
        } ?>
        <div class="well">
            <h2><?php echo $config['sitename'];?>使用條款</h2>
            <ol>
                <li>您所上傳到<?php echo $config['sitename'];?>的所有檔案、文件、資料等（以下簡稱「檔案」），不能違反中華民國、美國之法律，若違反了中華民國或美國法律，<?php echo $config['sitename'];?>會無條件將檔案提供給「可靠」的第三方供調查或進行法律裁定，且<?php echo $config['sitename'];?>不負任何責任。</li>
                <li>您的檔案，<?php echo $config['sitename'];?>有義務幫您備份，但若發生檔案遺失損毀或其他狀況，<?php echo $config['sitename'];?>會盡力幫您恢復，若無法取回檔案，<?php echo $config['sitename'];?>不負任何責任。</li>
                <li>您的檔案，<?php echo $config['sitename'];?>保證不會主動提供給第三方，但如果遇到特殊狀況，如違反第一項，<?php echo $config['sitename'];?>會主動或被動且無條件提供給「可靠」的第三方（如政府機構），若遇到特殊狀況，如主機遭到入侵、破壞、竊聽，或<?php echo $config['sitename'];?>系統有漏洞，導致您的個人資料外露，<?php echo $config['sitename'];?>僅能盡力封鎖該問題或漏洞，對於已外洩的個資，<?php echo $config['sitename'];?>不負任何責任。</li>
                 <li>您的個人資料，<?php echo $config['sitename'];?>保證不會主動或被動提供給第三方，但如果遇到特殊狀況，如違反第一項，<?php echo $config['sitename'];?>會主動或被動且無條件提供給「可靠」的第三方（如政府機構），若遇到特殊狀況，如主機遭到入侵、破壞、竊聽，或<?php echo $config['sitename'];?>系統有漏洞，導致您的個人資料外露，<?php echo $config['sitename'];?>僅會盡力封鎖該問題或漏洞，對於已遺失或外露的檔案，<?php echo $config['sitename'];?>不負任何責任。</li>
                <li>您的檔案不可包含有色情、猥褻、暴力、血腥、政治偏見、種族歧視、盜版內容、駭客/黑客軟體、破解軟體、非法活動資訊等內容，如果被檢舉或遭<?php echo $config['sitename'];?>發現，該檔案將被刪除，並將您的帳戶列入觀察名單，屢次發現違反規定，您的帳戶將被無條件且無通知移除。若因此違反第一條規定，<?php echo $config['sitename'];?>將主動或被動且無條件把資訊提供給第三方。</li>
                <li><?php echo $config['sitename'];?>有權將檔案及帳戶有條件或無條件刪除（但通常不會這麼做），且不必告知，不一定要有理由（通常<?php echo $config['sitename'];?>不會無理由且無通知主動刪除帳號）</li>
                <li><?php echo $config['sitename'];?>有權更動此條款，且不必向使用者通知。</li>
                <li><?php echo $config['sitename'];?>若因財務、資安、法律等，及其他特殊理由，可關閉此服務，您可以要求在關閉後將檔案歸還給您，但<?php echo $config['sitename'];?>不保證若因為特殊原因，導致檔案「全數」遺失的問題不會發生，一旦發生，<?php echo $config['sitename'];?>會「無法」將檔案還給您。</li>
                <li><?php echo $config['sitename'];?>不強迫您在設定您的Email，不過如果您疑似違規了，而您有填寫Email，<?php echo $config['sitename'];?>可以先透過Email請您解釋或提出您沒有違規的證明，否則我們將直接將檔案刪除</li>
                <li>若您註冊了本服務，代表您已經「完全同意」以上條款，且願意遵守。</li>
            </ol>
        </div>
        <p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
    </div>
</body>
</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
if (!session_id()) {
    session_start();
}
if (!$_SESSION['login']) {
    exit();
}
@ignore_user_abort(true);
@set_time_limit(0);
function sizecount($size)
{
    if ($size < 0.001) {
        echo round(($size * 1000 * 1000), 2).'B';
    } elseif ($size >= 0.001 && $size < 1) {
        echo round(($size * 1000), 2).'KB';
    } elseif ($size >= 1 && $size < 1000) {
        echo round($size, 2).'MB';
    } elseif ($size >= 1000) {
        echo round(($size / 1000), 2).'GB';
    }
}
?>
<?php
if (!isset($_FILES['file'])) {
    exit();
}
for ($j = 0; $j < count($_FILES['file']['name']); ++$j) {
    $result = '';
    if ($_FILES['file']['error'][$j] > 0) {
        $result = 'unknow';
        if ($_FILES['file']['error'][$j] == 1 || $_FILES['file']['error'][$j] == 2) {
            $result = 'inierr';
        }
        if ($_FILES['file']['error'][$j] == 3) {
            $result = 'par';
        }
        if ($_FILES['file']['error'][$j] == 4) {
            $result = 'nofile';
        }
    }
    if ($_FILES['file']['name'][$j] == null) {
        $result = 'nofile';
    }
    if ($config['size'] != 0) {
        if ($_FILES['file']['size'][$j] > ($config['size'] * 1000 * 1000)) {
            $result = 'sizeout';
        }
    }
    if ($config['total'] != 0) {
        $used = $db->ExecuteSQL(sprintf('SELECT SUM(`size`) AS `sum` FROM `file` WHERE `owner` = \'%s\' AND `recycle` = \'0\'', $db->SecureData($_SESSION['username'])));
        if ($used[0]['sum'] >= ($config['total'] * 1000 * 1000)) {
            $result = 'totalout';
        }
    }

    /* Create Key */
    /*
        $passphrase['a'] 是檔案加密用的 Key
        $passphrase['b'] 是位檔案加密的 Key 作加密所使用的密碼，來自使用者的密碼
        $passphrase['c'] 由 a, b 算出，儲存在資料庫
    */
    $passphrase['a'] = sha1(md5(mt_rand().uniqid()));
    $passphrase['b'] = $_SESSION['password'];
    $iv = md5("\x1B\x3C\x58".$passphrase['b'], true).md5("\x1B\x3C\x58".$passphrase['b'], true);
    $key = substr(md5("\x2D\xFC\xD8".$passphrase['b'], true).md5("\x2D\xFC\xD9".$passphrase['b'], true), 0, 24);
    $passphrase['c'] = rtrim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $passphrase['a'], MCRYPT_MODE_CBC, $iv)), "\0\3");
    unset($key);
    unset($iv);

    $filename = sha1(md5(mt_rand().uniqid()));
    if ($result == '') {
        $iv = md5("\x1B\x3C\x58".$passphrase['a'], true).md5("\x1B\x3C\x58".$passphrase['a'], true);
        $key = substr(md5("\x2D\xFC\xD8".$passphrase['a'], true).md5("\x2D\xFC\xD9".$passphrase['a'], true), 0, 24);
        $opts = array('iv' => $iv, 'key' => $key);
        $fp = fopen($_FILES['file']['tmp_name'][$j], 'rb');
        $dest = fopen('./file/'.$filename.'.data', 'wb');
        stream_filter_append($dest, 'mcrypt.rijndael-256', STREAM_FILTER_WRITE, $opts);
        stream_copy_to_stream($fp, $dest);
        fclose($fp);
        fclose($dest);
        $mkid = sha1(mt_rand().uniqid());
        $db->insert(array('name' => $_FILES['file']['name'][$j], 'size' => $_FILES['file']['size'][$j], 'owner' => $_SESSION['username'], 'id' => $mkid, 'realname' => $filename, 'secret' => $passphrase['c'], 'type' => $_FILES['file']['type'][$j], 'dir' => $_SESSION['dir'], 'recycle' => '0'), 'file');
        $result = 'success';
    }
    $token = @touch(dirname(__FILE__).'/updatetoken/'.md5($_SESSION['username']).'.token');
    if ($result == 'success') {
        ?>
        <tr>
            <td><?php echo $_FILES['file']['name'][$j];
        ?></td>
            <td><?php sizecount($_FILES['file']['size'][$j] / 1000 / 1000);
        ?></td>
            <td>上傳成功</td>
        </tr>
    <?php 
    } else {
        ?>
        <tr class="error">
            <td>Unknow</td>
            <td>Unknow</td>
            <td><?php if ($result == 'sizeout') {
    echo '檔案太大';
} elseif ($result == 'unknow') {
    echo '找不到該檔案，或是發生未知得錯誤';
} elseif ($result == 'totalout') {
    echo '帳戶空間不足';
} elseif ($result == 'inierr') {
    echo '檔案超過 POST 或是伺服器設定限制';
} elseif ($result == 'par') {
    echo '系統錯誤，檔案上傳不完全';
} elseif ($result == 'nofile') {
    echo '沒有選取的檔案';
} else {
    echo '發生未知得錯誤';
}
        ?></td>
        </tr>
<?php 
    }
}
header('Connection: close'); //解決Upload Error Code 3
?>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
if (!session_id()) {
    session_start();
}
if (!$_SESSION['login']) {
    exit();
}
@ignore_user_abort(true);
@set_time_limit(0);
function sizecount($size)
{
    if ($size < 0.001) {
        echo round(($size * 1000 * 1000), 2).'B';
    } elseif ($size >= 0.001 && $size < 1) {
        echo round(($size * 1000), 2).'KB';
    } elseif ($size >= 1 && $size < 1000) {
        echo round($size, 2).'MB';
    } elseif ($size >= 1000) {
        echo round(($size / 1000), 2).'GB';
    }
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<table class="table">
    <tr>
        <td>檔案名稱</td>
        <td>檔案大小</td>
        <td>上傳結果</td>
    </tr>
<?php
if (!isset($_FILES['file'])) {
    exit();
}
for ($j = 0; $j < count($_FILES['file']['name']); ++$j) {
    $result = '';
    if ($_FILES['file']['error'][$j] > 0) {
        $result = 'unknow';
        if ($_FILES['file']['error'][$j] == 1 || $_FILES['file']['error'][$j] == 2) {
            $result = 'inierr';
        }
        if ($_FILES['file']['error'][$j] == 3) {
            $result = 'par';
        }
        if ($_FILES['file']['error'][$j] == 4) {
            $result = 'nofile';
        }
    }
    if ($_FILES['file']['name'][$j] == null) {
        $result = 'nofile';
    }
    if ($config['size'] != 0) {
        if ($_FILES['file']['size'][$j] > ($config['size'] * 1000 * 1000)) {
            $result = 'sizeout';
        }
    }
    if ($config['total'] != 0) {
        $used = $db->ExecuteSQL(sprintf('SELECT SUM(`size`) AS `sum` FROM `file` WHERE `owner` = \'%s\' AND `recycle` = \'0\'', $db->SecureData($_SESSION['username'])));
        if ($used[0]['sum'] >= ($config['total'] * 1000 * 1000)) {
            $result = 'totalout';
        }
    }

    /* Create Key */
    $passphrase['a'] = sha1(md5(mt_rand().uniqid()));
    $passphrase['b'] = $_SESSION['password'];
    $iv = md5("\x1B\x3C\x58".$passphrase['b'], true).md5("\x1B\x3C\x58".$passphrase['b'], true);
    $key = substr(md5("\x2D\xFC\xD8".$passphrase['b'], true).md5("\x2D\xFC\xD9".$passphrase['b'], true), 0, 24);
    $passphrase['c'] = rtrim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $passphrase['a'], MCRYPT_MODE_CBC, $iv)), "\0\3");
    unset($key);
    unset($iv);

    $filename = sha1(md5(mt_rand().uniqid()));
    if ($result == '') {
        $iv = md5("\x1B\x3C\x58".$passphrase['a'], true).md5("\x1B\x3C\x58".$passphrase['a'], true);
        $key = substr(md5("\x2D\xFC\xD8".$passphrase['a'], true).md5("\x2D\xFC\xD9".$passphrase['a'], true), 0, 24);
        $opts = array('iv' => $iv, 'key' => $key);
        $fp = fopen($_FILES['file']['tmp_name'][$j], 'rb');
        $dest = fopen('./file/'.$filename.'.data', 'wb');
        stream_filter_append($dest, 'mcrypt.rijndael-256', STREAM_FILTER_WRITE, $opts);
        stream_copy_to_stream($fp, $dest);
        fclose($fp);
        fclose($dest);
        $mkid = sha1(mt_rand().uniqid());
        $db->insert(array('name' => $_FILES['file']['name'][$j], 'size' => $_FILES['file']['size'][$j], 'owner' => $_SESSION['username'], 'id' => $mkid, 'realname' => $filename, 'secret' => $passphrase['c'], 'type' => $_FILES['file']['type'][$j], 'dir' => $_SESSION['dir'], 'recycle' => '0'), 'file');
        $result = 'success';
    }
    $token = @touch(dirname(__FILE__).'/updatetoken/'.md5($_SESSION['username']).'.token');
    if ($result == 'success') {
        ?>
        <tr>
            <td><?php echo $_FILES['file']['name'][$j];
        ?></td>
            <td><?php sizecount($_FILES['file']['size'][$j] / 1000 / 1000);
        ?></td>
            <td>上傳成功</td>
        </tr>
    <?php 
    } else {
        ?>
        <tr class="error">
            <td>Unknow</td>
            <td>Unknow</td>
            <td><?php if ($result == 'sizeout') {
    echo '檔案太大';
} elseif ($result == 'unknow') {
    echo '找不到該檔案，或是發生未知得錯誤';
} elseif ($result == 'totalout') {
    echo '帳戶空間不足';
} elseif ($result == 'inierr') {
    echo '檔案超過 POST 或是伺服器設定限制';
} elseif ($result == 'par') {
    echo '系統錯誤，檔案上傳不完全';
} elseif ($result == 'nofile') {
    echo '沒有選取的檔案';
} else {
    echo '發生未知得錯誤';
}
    }
    ?></td>
        </tr>
<?php 
}
header('Connection: close'); //解決Upload Error Code 3
 ?>

</table>
<a href="uploadiframe.php" class="btn btn-primary">上傳更多</a>
</body>
</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
</head>
<body>
    <form action="uploadfileiframe.php" enctype="multipart/form-data" method="post">
        <input id="file" name="file[]" type="file" multiple required></br>
        <input id="submit" name="submit" type="submit" class="btn btn-primary" value="開始上傳">
        <a href="diruploadiframe.php" class="btn btn-link">上傳資料夾</a>
    </form>
</body>
</html>
<?php
/*
Allen Disk 1.6
Copyright (C) 2012~2016 Allen Chou
Author: Allen Chou ( http://allenchou.cc )
License: MIT License
*/
include 'config.php';
if (!session_id()) {
    session_start();
}
function sizecount($size)
{
    if ($size < 0.001) {
        return round(($size * 1000 * 1000), 2).'B';
    } elseif ($size >= 0.001 && $size < 1) {
        return round(($size * 1000), 2).'KB';
    } elseif ($size >= 1 && $size < 1000) {
        return round($size, 2).'MB';
    } elseif ($size >= 1000) {
        return round(($size / 1000), 2).'GB';
    }
}
if (!$config['why']) {
    header('Location: index.php');
}
?>
<!DOCTYPE html>
<html>
<head>
<title>為何選用<?php echo $config['sitename'];?></title>
<meta charset="utf-8" />
<link href="css/bootstrap.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>body{ background-color: #F8F8F8; }</style>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
    <h1 class="text-center"><?php echo $config['sitetitle']; ?></h1>
        <?php
        if (isset($_SESSION['login']) && $_SESSION['login'] === true) {
            ?>
            <ul class="nav nav-tabs">
                <li><a href="index.php">首頁</a></li>
                <li><a href="logout.php">登出</a></li>
            </ul>
        <?php 
        } else {
            ?>
            <ul class="nav nav-tabs">
                <li><a href="index.php">首頁</a></li>
                <?php if ($config['why']) {
    ?><li class="active"><a href="why.php"><?php echo $config['sitename'];
    ?>的好處</a></li><?php 
}
            ?>
                <li><a href="login.php">登入</a></li>
                <?php if ($config['reg']) {
    ?><li><a href="reg.php">註冊</a></li><?php 
}
            ?>
                <?php if ($config['tos']) {
    ?><li><a href="tos.php">使用條款</a></li><?php 
}
            ?>
            </ul>
        <?php 
        } ?>
    <div class="well">
        <h2>為何選用<?php echo $config['sitename'];?></h2>
        <ul>
            <li>檔案加密：所有在<?php echo $config['sitename'];?>的檔案都會加密儲存，且每個檔案的密碼皆不一樣，即使伺服器被攻破，也無法解開加密過的檔案</li>
            <li>安全性：<?php echo $config['sitename'];?>內不只是檔案，任何機密資料都會加密儲存，且有對各種方式的攻擊做出防護，可以避免機密外流</li>
            <li>快速：<?php echo $config['sitename'];?>的下載速度是非常快的，相較於中國的免空，<?php echo $config['sitename'];?>的速度快了許多</li>
            <li>不砍檔：要分享檔案還要三不五時補檔嗎？<?php echo $config['sitename'];?>有絕對不砍檔保證（如果違反法律則除外），您的檔案即使不多人下載，也絕對不會被刪除</li>
            <li>支援外連：什麼？免空檔案支援外連是多麼稀少的事情啊！可是，<?php echo $config['sitename'];?>就可以，您的檔案都可以外連，不論音樂影片圖片，甚至HTML,CSS,JS檔案，全部都可以外連，把<?php echo $config['sitename'];?>當作檔案庫也無妨</li>
            <li>下載免等待：幾乎所有免空要下載都要等很久，短至15秒，長至5分鐘，可是<?php echo $config['sitename'];?>完全不用，不論是否為會員，都可以享有直接下載的權利！</li>
            <li>空間：<?php echo $config['sitename'];?>提供<?php echo ($config['total'] != 0) ? '高達'.sizecount($config['total']) : '無限制' ?>的空間，且單檔可以<?php echo ($config['size'] != 0) ? '高達'.sizecount($config['size']) : '無限制大小' ?></p></li>
        </ul>
    </div>
<p class="text-center text-info">Proudly Powered by <a href="http://ad.allenchou.cc/">Allen Disk</a></p>
</div>
</body>
</html>