<?php
    include_once 'download_lang.php';
    $contentJson = json_encode($langDesc);
    var_dump($contentJson);exit;
?>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=0.66"/>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">  
    <meta name="Keywords"   content="" />
    <meta name="description"  content="" />

    <title></title>
    <style>
    /* CSS Document */
    .menu {
        margin:0 auto;
        border:1pt solid #999999;
        border-radius:5px;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
    }
    .menu a {
        text-decoration:none; 
        height:100%; 
        display:block;
        border-radius:5px;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px; color:#333;
    }
    .menu a:visited {
        text-decoration:none; 
        color:#000000;
    }
    .menu a:active {
        text-decoration:none;
    }
    .link-web{
        width:210px;
        height:40px;
        margin:0 auto;
        border-radius:4px;
        -webkit-border-radius: 4px;
        -moz-border-radius: 4px;
        /*text-shadow:0 2px 0 #FFF;*/
        font-family: "", "";
        font-size:18px;
    }
    .link-web a{ 
        text-decoration:none; 
        width:210px; 
        height:40px; 
        display:block;
        border-radius:4px;
        -webkit-border-radius: 4px;
        -moz-border-radius: 4px; 
        background-color: #F5F5F5;
        border:1px dashed #cccccc;
        color:#333;
    }
    .link-web a:visited{
        text-decoration:none; 
        color:#333;
    }
    .link-web a:active{ 
        text-decoration:none; 
        color:#333;
    }
    .font-arial{
        font-family: "微软雅黑", "", Arial, "Arial Black";
    }
    .font-italic{
        font-style:italic;
    }
    .font-blod{
        font-weight:bold;
    }
    .font-app{
        text-align:left;
        font-size:25px;
        color: #666666;
    }
    .font-app-display{
        text-align:left;
        font-size:20px;
        color:#999999;
        text-shadow:0 2px 0 #FFF;
    }
    .font02{ 
        font-size:18px; color:#999999;
        text-align:left;
    }
    .dp_copy{ 
        margin-top:10px; 
        text-align:center; 
        color:#919090; 
        font-size:22px; 
    }
    </style>
</head>
<body style="margin:0; padding:0; background:#EFEFEF;text-align:center">
    <div id="page-android" style="width:400px; height:800px; margin:0 auto; display:;">
        <div style="padding:50px 0 0px 0">
            <img src="http://superpoker.vip/img/icon144.jpg" alt="superpoker" />
        </div>
        <div class="font-arial" id="appname" style="font-size:20px; line-height:34px; height:45px; text-shadow:0 2px 0 #FFF; color:#999999; text-shadow: white 2px 2px; font-weight: bold; letter-spacing:2px;"></div>
        <p class="dp_copy" id="description"></p>
        <br/>
		<div class="font-arial" id="select-device" style=" width:400px; font-size:20px; line-height:30px; height:50px; color:#999999; letter-spacing:2px; text-align:left; margin: 0 auto;"></div>
        <br/>
		
		<div  style="width:400px; height:100px;">
            <a href="https://itunes.apple.com/th/app/ไพ-เท-กซ-สซ-เปอร/id1267293867" target="superpoker">
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" height="100px">
                    <tr>
                        <td width="100" align="center" valign="middle" >
                            <img src="http://superpoker.vip/img/ios.jpg" alt="" border="0"  />
                        </td>
                 
                       
                    </tr>
                </table>
            </a>
        </div>
        <div style="height:60px;"></div>
        <div style="width:400px; height:100px;">
<!--            <a href="market://details?id=com.superant.superpoker">-->
            <a href="http://superpoker.vip/m/SuperPoker-release-1.3.0_onLine.apk">
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" height="100px">
                    <tr>
                        <td width="100" align="center" valign="middle">
                            <img src="http://superpoker.vip/img/android.jpg" alt="" border="0" />
                        </td>

                    </tr>
                </table>
            </a>
        </div>
        <br/>
        <br/>
		 <br/>
        <br/>
        <a id="fans" style="height:20px; font-size:22px;font-family: 微软雅黑; text-shadow:0 2px 0 #FFF; text-align:center; margin:0px" href="https://www.facebook.com/superpoker.th"></a>
         <br/>
        <br/>
		 <br/>
		<div id="copyright" style="height:18px; color:#999999; font-size:15px;font-family: 微软雅黑; text-shadow:0 2px 0 #FFF; text-align:center; margin:0px">Copyright © 2017 SuperAnt Technology Co., Ltd..All Rights Reserved.</div>
    </div>
    <script type="text/javascript">
        // 获取终端的相关信息
      var lang = getLang();
        var langDesc = '<?php echo $contentJson;?>';//语言配置信息
        langDesc = JSON.parse( langDesc );
        var info = langDesc[lang];
        if(info == undefined || info == '' || info == null) {
            info = langDesc['en'];
        }

        //设置页面值
        document.title = info['appname'];//title
        document.getElementById('appname').innerHTML = info['appname'];
        document.getElementById('description').innerHTML = info['description'];
        document.getElementById('select-device').innerHTML = info['selectdevice'];
        document.getElementById('fans').innerHTML = info['fans'];
        var meta = document.getElementsByTagName('meta');
        meta["Keywords"].setAttribute('content',info['keywords']);
        meta["description"].setAttribute('content',info['description']);

        // Android
        var URL = "superant://superpoker-th";
        var MARKET = "market://details?id=com.superant.superpoker";

        // IOS
        var IOS = "superpoker-th://";
        var ITUNES = "https://itunes.apple.com/th/app/ไพ-เท-กซ-สซ-เปอร/id1267293867";//appstore

        // PC
        var PCURL  = "https://apps.facebook.com/superpoker_th/";

        //获取移动端的语言
        function getLang() {
            var Terminal = {
                // 辨别移动终端的语言：zh-cn、en-us、ko-kr、ja-jp...
                language : (navigator.browserLanguage || navigator.language).toLowerCase()
            }
            // 还可以通过language，区分开多国语言版
            switch(Terminal.language){
                case 'zh-cn':
                    lang = "cn";
                    break;
                case 'th':
                    lang = "th";
                    break;
                case 'zh-tw':
                    lang = "tw";
                    break;
                default:
                    lang = "en";
            }
            return lang;
        }


        function onLoad() {
            if (navigator.userAgent.match(/Android/)) {
//                var iframe = document.createElement("iframe");
//                iframe.style.visibility = 'hidden';
//                iframe.style.border = "none";
//                iframe.style.width = "1px";
//                iframe.style.height = "1px";
//                iframe.src = URL;
//                iframe.onload = function () { window.location = MARKET; };
//                document.body.appendChild(iframe);
                window.location.href = 'http://superpoker.vip/m/SuperPoker-release-1.3.0_onLine.apk';
            } else if (navigator.userAgent.match(/(iPhone|iPad|iPod)/i)) {
                // IOS
                setTimeout(function() {
                        window.location = ITUNES;
                }, 500);
                window.location = IOS;
            } else {
                 window.location.href = PCURL;
            }
        }
        onLoad();

    </script>
</body>
</html>