!function(a, b, c) {
    a.fn.basicShare = function() {
        this.insertCss = function(a) {
            var b = c.createElement("style");
            b.type = "text/css",
            b.styleSheet ? b.styleSheet.cssText = a : b.innerHTML = a,
            c.getElementsByTagName("head")[0].appendChild(b)
        }
        ,
        this.insertCss("   .basicShareClearFix {box-sizing:border-box;}   .basicShareClearFix:before,   .basicShareClearFix:after { display:table;content:' '; }     .basicShareClearFix:after { clear:both !important; }     .basicShareZoomIn {    -webkit-transform:scale(1.06);    -moz-transform:scale(1.06);    transform:scale(1.06);    -moz-opacity:1;    -webkit-opacity:1;    opacity:1;    filter:alpha(opacity=100);  }  .basicShareZoomOut {    -webkit-transform:scale(1);    -moz-transform:scale(1);    transform:scale(1);    -moz-opacity:0.76;    -webkit-opacity:0.76;    opacity:0.76;    filter:alpha(opacity=76);  }    #basicShareBg {box-sizing:border-box;position: fixed;left:0;top:0;bottom:0;right:0;z-index:9999999999;background:rgba(0,0,0,0.7)}   #basicShareWrap {box-sizing:border-box;display:table;position:relative;margin-left:auto;margin-right:auto;background:#ffffff;overflow:auto;border:4px solid #333;}  #basicShareCloseBox {box-sizing:border-box;position:absolute; width:50px;height:50px;right:5px;top:5px;}  #basicShareCloseBox > a {box-sizing:border-box;width:50px;height:50px;padding:0;text-align:center;display:block}  #basicShareCloseBox > a > img {width:32px;height:32px; margin-top:9px;margin-left:7px;}  #basicShareGoBack {box-sizing:border-box;position:absolute;width:50px;height:50px;left:5px;top:5px;}  #basicShareGoBackBtn {width:50px;height:50px;padding:0;text-align:center;background:#f6f6f6;display:none;}  #basicShareGoBackBtn > img {width:32px;height:32px; float:left;margin-top:9px;margin-left:7px;}    #basicSharOutter {box-sizing:border-box;display:table;width:100%; padding:80px 0;}  #basicSharInner {box-sizing:border-box;margin:auto;height:100%;}  #basicSharContainer {box-sizing:border-box;display:table-cell;vertical-align:middle;height:100%;}  .basicShareElement {float: left; display:block; background:#f9f9f9; text-decoration:none!important; border:none!important;margin:1px; box-sizing: border-box;text-align:center;padding:30px 10px 20px 10px;} .basicShareElement > p {color:#999; text-decoration:none!important;border:none!important;}    .cssTransition {-ms-transition-duration: .5s;-moz-transition-duration: .5s;-webkit-transition-duration: .5s;transition-duration: .5s;-ms-transition-property: all;-moz-transition-property: all;-webkit-transition-property: all;transition-property: all;}  .cssOpacity {-moz-opacity:0.76;-webkit-opacity:0.76;filter:alpha(opacity=76);opacity:0.76;}    img.basicShareImgRes {     display:block;     max-width:100%;     width:100%;     height:auto;   } ");
        var e = b.innerWidth || c.documentElement.clientWidth || c.body.clientWidth
          , f = b.innerHeight || c.documentElement.clientHeight || c.body.clientHeight
          , g = !1
          , h = "49%"
          , j = "400px"
          , k = "2em";
        e < 500 && (h = "99%",
        g = !0,
        j = "260px",
        k = "4em");
        var l = "https://cdn.qinco.net/basicShare/img"
          , m = [l + "/weibo-dark.png", l + "/weixin-dark.png"]
          , n = new Array;
        for (i = 0; i < m.length; i++)
            n[i] = new Image,
            n[i].src = m[i];
        return a("body").on("click", ".basicShareCloseBtn", function() {
            a("#basicShareBg").fadeOut("400").remove()
        }),
        a("body").on("click", "#basicShareWeixin", function() {
            a("#basicShareGoBackBtn").fadeIn().css({
                display: "block"
            }),
            a("#basicSharContainer").hide().html(a("#basicShareWeixinShow").html()).fadeIn("1000")
        }),
        a("body").on("click", "#basicShareGoBackBtn", function() {
            a(this).fadeOut(),
            a("#basicSharContainer").html(a("#basicShareTemp").html())
        }),
        a("body").on("mouseenter", ".basicShareElement", function() {
            a(this).children("div").removeClass("basicShareZoomOut").addClass("basicShareZoomIn");
            var b = a(this).children("p");
            b.css({
                color: b.attr("data-color")
            })
        }),
        a("body").on("mouseleave", ".basicShareElement", function() {
            a(this).children("div").removeClass("basicShareZoomIn").addClass("basicShareZoomOut"),
            a(this).children("p").css({
                color: "#999"
            })
        }),
        this.each(function() {
            var d = a(this)
              , i = d.attr("data-shareUrl")
              , m = d.attr("data-shareTitle")
              , n = d.attr("data-sharePic");
            "undefined" == typeof i && (i = b.location.href),
            "undefined" == typeof m && (m = c.title),
            "undefined" == typeof n && (n = ""),
            d.on("click", function() {
                a("#basicShareBg").length > 0 && a("#basicShareBg").remove(),
                a("body").append("<div id='basicShareBg'><div id='basicShareWrap' ><div id='basicShareCloseBox'><a href='javascript:' class='basicShareCloseBtn'><img src='" + l + "/closeBtn.png' /></a></div><div id='basicShareGoBack'><a href='javascript:' id='basicShareGoBackBtn'><img src='" + l + "/backBtn.png' /></a></div><div id='basicSharOutter'><div id='basicSharInner' style='max-width:" + j + ";'><div id='basicSharContainer'><a target='_blank' class='basicShareCloseBtn basicShareElement' style='width:" + h + ";' href='http://v.t.sina.com.cn/share/share.php?title=" + encodeURIComponent(m) + "&url=" + encodeURIComponent(i) + "&pic=" + encodeURIComponent(n) + "'><div class='basicShareClearFix cssTransition cssOpacity' style='padding-left:" + k + ";padding-right:" + k + ";'><img src='" + l + "/weibo-dark.png' alt='Weibo' class='basicShareImgRes' /></div><p class='cssTransition' style='color:#999;' data-color='#e1b064'>分享到微博</p></a><a href='javascript:' id='basicShareWeixin' class='basicShareElement' style=' width:" + h + ";'><div class='basicShareClearFix cssTransition cssOpacity' style='padding-left:" + k + ";padding-right:" + k + ";'><img src='" + l + "/weixin-dark.png' alt='Weixin' class='basicShareImgRes'  /></div><p class='cssTransition' style='color:#999;' data-color='#a0d191'>分享到微信</p></a></div></div><div style='display:none;' id='basicShareTemp'></div><div style='display:none;' id='basicShareWeixinShow'><div style='display:table;width:100%;'><div style='float:left;width:100%;'><div style='margin:auto;width:50%;text-align:center;min-height:200px;'><img alt='二维码加载中...' src='https://api.qinco.net/api/qr?size=400&content=" + encodeURIComponent(i) + "' style='width:100%;max-width:300px;height: auto;' /></div><div style='display:table;width:100%;text-align:center;'><h5>打开微信“扫一扫”，扫描上面的二维码，打开网页后再点击微信右上角的菜单、即可分享到微信</h5></div></div></div></div></div></div></div>"),
                a("#basicShareBg").css({
                    height: a("body").height() + "px",
                    filter: "progid:DXImageTransform.Microsoft.gradient( startColorstr='#d1000000', endColorstr='#cf000000',GradientType=0 )"
                }),
                a("#basicShareWrap").css({
                    height: "auto",
                    maxHeight: g ? parseInt(.9 * f) + "px" : parseInt(.4 * f) + "px",
                    minHeight: "200px",
                    width: g ? "90%" : "70%",
                    minWidth: "300px",
                    maxWidth: g ? parseInt(.9 * e) + "px" : "600px"
                }),
                a("#basicSharOutter").children().height(a("#basicSharOutter").height() + "px"),
                a("#basicShareWrap").animate({
                    marginTop: parseInt((f - a("#basicShareWrap").height()) / 2.4) + "px"
                }, 100),
                a("#basicShareTemp").html(a("#basicSharContainer").html())
            })
        })
    }
}(jQuery, window, document),
$(".basicShareBtn").length > 0 && $(".basicShareBtn").basicShare();
