(function(){
    //只在IOS,safari下出现提示
    if(!navigator.userAgent.match(/iphone|ipod|ipad/ig) || navigator.userAgent.match(/micromessenger/ig)) {
        return;
    }

    if(document.cookie.indexOf('isBottomTipsShown') >= 0){
        return;
    }else{
        //设置cookie
        var date= new Date();           
        var nowTime = date.getTime();
        var expdate = new Date();

        var exptime = nowTime - (date.getHours()*3600+date.getMinutes()*60+date.getSeconds())*1000 + 86400*30000;
        expdate.setTime(exptime);

        document.cookie = 'isBottomTipsShown' + "=" + 1 + "; expires=" + expdate.toGMTString() + "; path=/; domain=duowan.com";
    }

    var _dom = String(function(){/*!
        <div id="addToHomeScreen" class="addToHomeIOS7 addToHomeWide">
            <span style="background-image:url(http://assets.dwstatic.com/project/dw_mobi/1.0.0/img/temp/app5.png)" class="addToHomeTouchIcon"></span>添加"多玩游戏手机版"快捷方式到桌面。请按 
            <span class="addToHomeShare"></span> 
            然后点选<strong>添加至主屏幕</strong>
            。<span class="addToHomeArrow"></span>
            <span class="addToHomeClose"></span>
        </div>
    */}).replace(/^[^\{]*\{\s*\/\*!?|\*\/[;|\s]*\}$/g, '');

    var _cssText = String(function(){/*!
        #addToHomeScreen {
            z-index: 99999;
            -webkit-user-select: none;
            user-select: none;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            -webkit-touch-callout: none;
            touch-callout: none;
            width: 240px;
            font-size: 15px;
            padding: 12px 14px;
            text-align: left;
            font-family: helvetica;
            background: rgba(0, 0, 0, 0.75);
            -webkit-border-radius: 8px;
            -webkit-background-clip: padding-box;
            color: #fff;
            line-height: 130%;
            left: 50%;
            -webkit-transition: -webkit-transform 0.2s;
            transition: -webkit-transform 0.2s;
            -webkit-transform: translate3d(0, 0, 0);
            position: fixed;
            margin-left: -148px;
            bottom: 14px;
            opacity: 1;
        }
        #addToHomeScreen.addToHomeIpad {
            width: 268px;
            font-size: 18px;
            padding: 14px
        }
        #addToHomeScreen strong {
            font-weight: normal
        }
        #addToHomeScreen.addToHomeWide {
            width: 296px
        }
        #addToHomeScreen.addToHomeIpad.addToHomeWide {
            width: 320px;
            font-size: 18px;
            padding: 14px
        }
        #addToHomeScreen .addToHomeArrow {
            position: absolute;
            width: 0;
            height: 0;
            overflow: hidden;
            border: 8px dashed transparent;
            border-top-style: solid;
            border-top-color: rgba(0, 0, 0, 0.75);
            bottom: -16px;
            left: 50%;
            margin-left: -8px
        }
        #addToHomeScreen.addToHomeIpad .addToHomeArrow {
            -webkit-transform: rotateZ(-135deg);
            background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(0, rgba(238, 238, 238, 0)), color-stop(0.4, rgba(238, 238, 238, 0)), color-stop(0.4, #eee));
            -webkit-box-shadow: inset -1px -1px 0 #fff;
            top: -9px;
            bottom: auto;
            left: 50%
        }
        #addToHomeScreen .addToHomeClose {
            -webkit-box-sizing: border-box;
            position: absolute;
            right: 4px;
            top: 4px;
            display: block;
            width: 18px;
            height: 18px;
            background: url("http://assets.dwstatic.com/project/dw_mobi/1.0.0/img/ico-close.png") no-repeat;
            background-size: 18px;
        }
        #addToHomeScreen .addToHomePlus {
            font-weight: bold;
            font-size: 1.3em
        }
        #addToHomeScreen.addToHomeIOS7 .addToHomeShare {
            display: inline-block;
            width: 11px;
            height: 15px;
            background-repeat: no-repeat;
            background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAA8CAYAAAAQTCjdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAASCQAAEgkB80sG3AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAKjSURBVGiB7dpPiFVVHMDxz7m9NCtMyI2bEJEC25WrEkzHUXCRraIwdNE8ZxfYIlcis1ZEbGEzT1QCF4XgH1CyWhUoJKIWNRGEiCNKmkSiYTzfcfGuOokx77x3ZlS8382959zfn+/invvn3RdijHIRBrwkOINCYXEcdjpb7VyiYdBsLScwt5y6IloYdzqXo36Ro0gY9IKWo+5JwmzBt2HQnBw9ehYNazyn5TBee8Dh+Vq+CWu92GufnkTDR6ab7gDeBNHouMM/l9tXTXM0fGBmL726Fg1Dam74EsvKqR8VNowL2Yzj5f7rnnE4DHq2235diYYhhTGfC94up35T0y+6di/ITU0rKVd+sEi0P7xr2pSJOu8zvF+OzqEv7vDH/WFxt7/cshy/ticsN8sXYUht0kXDOlsF9XJ4UaEvNoz9X3zc5bKaZThbyr5jzJ4wlNY7KTgM+ES0vhz+KeiPw36fKC/ucAF9uFBOrTZm26SJCtaV27+xIo7cXdkTEhvOoh+XyxprU1qnim7CQdGK2HAyKRexYVShT3RItDElN+mkjiP2Ym+S3f01hv2EVal5WW6hU0ElmptaqJuBpXg6MbeFH2LDpU6CQ93zWIKnEvs0cayGU3glMfkOo1jQYewZzOuyz7FC95Jwo5OgUFfgeg993hh/eTqCTxOSm/iuk8DY0Ap1b2GhtHXxsfZN4j/X0fOx4auEIknEhqv4OiUn1L13Z/+xWfWVaG4q0dxUormpRHNTieamEs1NJZqbJ1Q0jHvdiJo5S2cVjSNOCHZhn3/SnuYnIvl3yomIIz7MXZMn9hydRCrR3FSiualEc1OJ5qYSzU0lmptKNDePjWgwcPePT7/g+4cp8wCW4GXaryK3tL+mLdD5x62ppllgu7bso8q/2HIbzGWdNmWnSJwAAAAASUVORK5CYII=);
            background-size: 11px 15px;
            text-indent: -9999em;
            overflow: hidden;
        }
        #addToHomeScreen .addToHomeTouchIcon {
            display: block;
            float: left;
            -webkit-border-radius: 6px;
            border-radius: 6px;
            background-repeat: no-repeat;
            width: 57px;
            height: 57px;
            -webkit-background-size: 57px 57px;
            background-size: 57px 57px;
            margin: 0 12px 0 0;
            -webkit-background-clip: padding-box;
            background-clip: padding-box;
        }*/}).replace(/^[^\{]*\{\s*\/\*!?|\*\/[;|\s]*\}$/g, '');

    var style = document.createElement("style");
    style.type = "text/css";
    style.appendChild(document.createTextNode(_cssText));
    document.getElementsByTagName("head")[0].appendChild(style);
    
    var obj = document.createElement("div");
    obj.id = "tips-Container"
    obj.innerHTML = _dom;
    document.body.appendChild(obj);

    var _btnClose = document.getElementsByClassName("addToHomeClose");

    _btnClose[0].addEventListener("click", function(){
        document.getElementById("tips-Container").parentNode.removeChild(document.getElementById("tips-Container"));
    },false);
})();