﻿/***************************
*********导航背景***********
***************************/
$(function() {
    var url = document.location.href;
    //$(".idhz ul li:even").removeClass("idhbj").removeClass("threewords").removeClass("fourwords").removeClass("fivewords").find("a").css("color","#FFFFFF");
    var index = /^http:\/\/www.askci.com\/newss\/.{0,}|http:\/\/big5.askci.com\/newss\/.{0,}$/g;
    var index_zssd = /^http:\/\/www.askci.com\/news\/zssd\/.{0,}|http:\/\/big5.askci.com\/news\/zssd\/.{0,}$/g;
    var reg_ipo = /^http:\/\/ipo.askci.com\/.{0,}|http:\/\/big5.askci.com\/ipo\/.{0,}$/g;
    var reg_syjhs = /^http:\/\/syjhs.askci.com\/.{0,}|http:\/\/big5.askci.com\/syjhs\/.{0,}$/g;
    var reg_kybg = /^http:\/\/kybg.askci.com\/.{0,}|http:\/\/big5.askci.com\/kybg\/.{0,}$/g;
    var reg_xmk = /^http:\/\/xmk.askci.com\/.{0,}|http:\/\/big5.askci.com\/xmk\/.{0,}$/g;
    var reg_qypx = /^http:\/\/qypx.askci.com\/.{0,}|http:\/\/big5.askci.com\/qypx\/.{0,}$/g;
    var reg_reports = /^http:\/\/www.askci.com\/reports\/.{0,}|http:\/\/big5.askci.com\/reports\/.{0,}$/g;
    var reg_research = /^http:\/\/www.askci.com\/research\/.{0,}|http:\/\/big5.askci.com\/research\/.{0,}$/g;
    var reg_enreports = /^http:\/\/www.askci.com\/enreports\/.{0,}|http:\/\/big5.askci.com\/enreports\/.{0,}$/g;
    var reg_ci = /^http:\/\/www.askci.com\/news\/.{0,}|http:\/\/big5.askci.com\/news\/.{0,}$/g;
    var reg_data = /^http:\/\/www.askci.com\/data\/.{0,}|http:\/\/big5.askci.com\/data\/.{0,}$/g;
    var reg_freereports = /^http:\/\/www.askci.com\/freereports\/.{0,}|http:\/\/big5.askci.com\/freereports\/.{0,}$/g;

    var sel_color = "#000099";
    var sel_write = "#ffffff";
    if (index.exec(url) != null)
        $(".idhz ul li:even").eq(0).addClass("idhbj").find("a").css("color", sel_color);
    if (reg_ipo.exec(url) != null)
        $(".idhz ul li:even").eq(11).addClass("fourwords").find("a").css("color", sel_color);
    else if (reg_syjhs.exec(url) != null)
        $(".idhz ul li:even").eq(9).addClass("fivewords").find("a").css("color", sel_color);
    else if (reg_kybg.exec(url) != null)
        $(".idhz ul li:even").eq(10).addClass("fivewords").find("a").css("color", sel_color);
    else if (reg_xmk.exec(url) != null) {
        $(".idhz ul li:even").eq(8).addClass("threewords").find("a").css("color", sel_color);
        $(".idhz ul li:even").eq(0).removeClass("idhbj").find("a").css("color", sel_write);
    }
    else if (reg_reports.exec(url) != null)
        $(".idhz ul li:even").eq(1).addClass("fourwords").find("a").css("color", sel_color);
    else if (reg_research.exec(url) != null)
        $(".idhz ul li:even").eq(3).addClass("fourwords").find("a").css("color", sel_color);
    else if (reg_enreports.exec(url) != null)
        $(".idhz ul li:even").eq(4).addClass("fourwords").find("a").css("color", sel_color);
    else if (reg_qypx.exec(url) != null)
        $(".idhz ul li:even").eq(7).addClass("fourwords").find("a").css("color", sel_color);
    else if (reg_ci.exec(url) != null) {
        $(".idhz ul li:even").eq(2).addClass("fourwords").find("a").css("color", sel_color);
        $(".idhz ul li:even").eq(0).removeClass("idhyx");
        $(".idhz ul li:even").eq(0).addClass("addClass");
    }
    else if (reg_data.exec(url) != null)
        $(".idhz ul li:even").eq(5).addClass("fourwords").find("a").css("color", sel_color);
    else if (reg_freereports.exec(url) != null)
        $(".idhz ul li:even").eq(6).addClass("fourwords").find("a").css("color", sel_color);
    else
        $(".idhz ul li:even").eq(0).addClass("idhbj").find("a").css("color", sel_color);
    if (index_zssd.exec(url) != null) {
        $(".idhz ul li:even").eq(0).addClass("idhbj").find("a").css("color", sel_color);
        $(".idhz ul li:even").eq(2).removeClass("fourwords").find("a").css("color", "#ffffff");
    }
    //繁体路径
    var ftUrl = "";
    if (url.indexOf("http://big5") < 0)//简体转繁体
    {
        if (url.indexOf("http://www.askci.com") > -1) {
            ftUrl = url.replace("http://www", "http://big5");
        }
        else if (url.indexOf("http://xmk.askci.com/") > -1)
            ftUrl = url.replace("http://xmk.askci.com/", "http://big5.askci.com/xmk/");
        else if (url.indexOf("http://syjhs.askci.com/") > -1)
            ftUrl = url.replace("http://syjhs.askci.com/", "http://big5.askci.com/syjhs/");
        else if (url.indexOf("http://ipo.askci.com/") > -1)
            ftUrl = url.replace("http://ipo.askci.com/", "http://big5.askci.com/ipo/");
        else if (url.indexOf("http://kybg.askci.com/") > -1)
            ftUrl = url.replace("http://kybg.askci.com/", "http://big5.askci.com/kybg/");
        else if (url.indexOf("http://qypx.askci.com/") > -1)
            ftUrl = url.replace("http://qypx.askci.com/", "http://big5.askci.com/qypx/");
    }
    else if (url.indexOf("http://big5") > -1)//繁体转简体
    {
        if (url.indexOf("http://big5.askci.com/xmk/") > -1)
            ftUrl = url.replace("http://big5.askci.com/xmk/", "http://xmk.askci.com/");
        else if (url.indexOf("http://big5.askci.com/syjhs/") > -1)
            ftUrl = url.replace("http://big5.askci.com/syjhs/", "http://syjhs.askci.com/");
        else if (url.indexOf("http://big5.askci.com/kybg/") > -1)
            ftUrl = url.replace("http://big5.askci.com/kybg/", "http://kybg.askci.com/");
        else if (url.indexOf("http://big5.askci.com/ipo/") > -1)
            ftUrl = url.replace("http://big5.askci.com/ipo/", "http://ipo.askci.com/");
        else if (url.indexOf("http://big5.askci.com/qypx/") > -1)
            ftUrl = url.replace("http://big5.askci.com/qypx/", "http://qypx.askci.com/");
        else
            ftUrl = url.replace("http://big5", "http://www");
        $("a[tag='fanti']").html("简体");
    }
    $("a[tag='fanti']").attr("href", ftUrl);
})
/***************************
*********头部搜索***********
***************************/
$(document).ready(function() {
    $(".intop2_s ul li").click(function() {
        $(".intop2_s ul li").removeClass("sya").addClass("syb");
        $(this).removeClass("syb").addClass("sya");
    });
    //按回车搜索
    $("#keyWord").keydown(function(event){
        if(event.keyCode == 13){            
            $("#button").click();//激发搜索
        }
    });
    $("#keys").keydown(function(event) {
        if (event.keyCode == 13) {
            $("#btnxmk").click(); //激发搜索
        }
    });
    //失去焦点而且关键字为空时,赋予提示
    $("#keyWord").blur(function(){
        if($.trim($(this).val()).length < 1)
		{
			if(document.location.href.indexOf("http://big5") > -1)
				$(this).val("請輸入關鍵字");
			else
				$(this).val("请输入关键字");
		}
    });
    //搜索框取得焦点
    $("#keyWord").focus(function(){
        if($.trim($(this).val()) == "请输入关键字" || $.trim($(this).val()) == "請輸入關鍵字")
            $(this).val("");
    });
})
function SerachValues() {
    var keyWrods = $.trim($("#keyWord").val());
    var typtStrs = $(".intop2_s ul li:not(.syb) a").attr("title");
    var filterKeys = "报告|報告|数据|數據|公司|项目|項目|企业|企業|咨询|咨詢|新闻|新聞|行业|行業|分类|分類|市场|市場|资讯|資訊|关键字|關鍵字|研究报告|研究報告|英文报告|英文報告|企业研究|企業研究";//过滤的搜索关键字,以"|"分隔
    if (keyWrods == "")
        alert("请输入关键字");
    else if(keyWrods.length < 2)
        alert("输入字数至少两个");
    else if(IsFilterKey(keyWrods,filterKeys))//过滤搜索
        alert("请输入其他关键字");    
    else {
        var S_Url = "http://www.askci.com/search/1/" + encodeURI(typtStrs) + "/" + encodeURI(keyWrods) + "/";
        if(document.location.href.indexOf("big5.askci.com") > -1)//繁体
            S_Url = S_Url.replace("www.askci.com","big5.askci.com");
        window.open(S_Url);
    }
}
//判断某字符串是否存在于集合中
var IsFilterKey = function(KeyStr,FilterKeys){
    var _array = FilterKeys.split("|");
    for(var i = 0; i < _array.length; i++){
        if(KeyStr == _array[i])
            return true;
    }
    return false;
}

//字符串拼接方法
StringBuffer = function() {
    this._strings_ = new Array();
    if (typeof StringBuffer._initialized == "undefined") {
        StringBuffer.prototype.append = function(str) {
            if (typeof str == 'string')
                this._strings_.push(str);
        }
        StringBuffer.prototype.appendFormat = function(str) {
            var args = arguments;
            str = str.replace(/\{(\d+)\}/g, function(m, i) {
                return args[++i];
            })
            this._strings_.push(str);
        }
        StringBuffer.prototype.toString = function() {
            if (typeof arguments[0] == 'string')
                return this._strings_.join(arguments[0]);
            return this._strings_.join("");
        }
        StringBuffer.prototype.clear = function() {
            this._strings_ = [];
        }
        StringBuffer._initialized = true;
    }
};

/***************************
**********复制方法**********
***************************/
function copyUrl() {
    var _url = window.location.href;
    copyToClipboard(_url);
}
function copyToClipboard(txt) {
    if (window.clipboardData) {
        window.clipboardData.clearData();
        window.clipboardData.setData("Text", txt);
        alert("复制成功！")
    }
    else if (navigator.userAgent.indexOf("Opera") != -1) {
        window.location = txt;
    }
    else if (window.netscape) {
        try {
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
        }
        catch (e) {
            alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");
        }
        var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
        if (!clip) {
            return;
        }
        var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
        if (!trans) {
            return;
        }
        trans.addDataFlavor('text/unicode');
        var str = new Object();
        var len = new Object();
        var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
        var copytext = txt;
        str.data = copytext;
        trans.setTransferData("text/unicode", str, copytext.length * 2);
        var clipid = Components.interfaces.nsIClipboard;
        if (!clip) {
            return false;
        }
        clip.setData(trans, null, clipid.kGlobalClipboard);
        alert("复制成功！")
    }
}
//加入收藏
function addfavorite() {
 if (document.all) {
     window.external.addFavorite(location.href, document.title);
 }
 else if (window.sidebar) {
     window.sidebar.addPanel(document.title, location.href, "");
 }
}
//设置为主页 调用<a href="javascript:void(0)" onclick="javascript:SetHome(this,window.location)">设为首页</a>
function SetHome(obj, vrl) {   
    try {   
        obj.style.behavior = 'url(#default#homepage)';   
        obj.setHomePage(vrl);   
    } catch (e) {   
        if (window.netscape) {   
            try {   
                netscape.security.PrivilegeManager   
                        .enablePrivilege("UniversalXPConnect");   
            } catch (e) {   
                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");   
            }   
            var prefs = Components.classes['@mozilla.org/preferences-service;1']   
                    .getService(Components.interfaces.nsIPrefBranch);   
            prefs.setCharPref('browser.startup.homepage', vrl);   
        }   
    }
}
/**************************分享**************************/
/*QQ微博 | 新浪微博客 | 网易博客 | 搜狐博客*/
function postToWb(obj_id) {

    var _t = encodeURI(document.title);

    var _url = encodeURI(document.location);

    var _appkey = encodeURI("appkey"); //你从腾讯获得的appkey

    var _pic = encodeURI(''); //（列如：var _pic='图片url1|图片url2|图片url3....）

    var _site = ''; //你的网站地址

    if (obj_id == "tencent") {
        var _u = 'http://v.t.qq.com/share/share.php?title=' + _t + '&url=' + _url + '&appkey=' + _appkey + '&site=' + _site + '&pic=' + _pic;
        window.open(_u, '转播到腾讯微博', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');
    }
    else if (obj_id == "sina") {
        var _u = 'http://service.weibo.com/share/share.php?title=' + _t + '&url=' + _url;
        window.open(_u, '转播到新浪微博', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');
    }
    else if (obj_id == "wy") {
        var url = 'link=http://news.163.com/&amp;source=' + _t + '&amp;info=' + _t + '' + _url;
        var _url = "http://t.163.com/article/user/checkLogin.do?" + url + "&amp;" + new Date().getTime();
        window.open(_url + url, '转播到网易微博', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');
    }
    else if (obj_id = "sohu") {
        var url = "http://t.sohu.com/third/post.jsp?url=" + _url + "&title=" + _t + "&pic=" + _pic + "&content=utf-8";
        window.open(url, '转播到搜狐微博', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');
    }
    else {

    }
}
/*收藏*/
var showHtml = "分享文本至：<a href=\"javascript:void(0);\" onclick=\"postToWb('tencent');\" title=\"分享到腾讯微博\"><img src=\"http://www.askci.com/images/qqweibo.png\" width=\"32\" border=\"0\" align=\"absMiddle\" height=\"32\"></a> <a href=\"javascript:void(0);\" onclick=\"postToWb('sina');\" title=\"分享到新浪微博\"><img src=\"http://www.askci.com/images/sina.jpg\" width=\"32\" border=\"0\" align=\"absMiddle\" height=\"32\"></a> <a onclick=\"postToWb('wy')\" href=\"javascript:void(0);\"><img height=\"32\" width=\"32\" border=\"0\" align=\"absMiddle\" src=\"http://www.askci.com/images/wangyi.jpg\" alt=\"分享到网易微博\" title=\"分享到网易微博\" /></a> <a onclick=\"postToWb('sohu')\" href=\"javascript:void(0);\"><img height=\"32\" width=\"32\" border=\"0\" align=\"absMiddle\" src=\"http://www.askci.com/images/souhu.jpg\" alt=\"分享到网易微博\" title=\"分享到网易微博\" /></a> <a href=\"javascript:u=location.href;t=document.title;c = %22%22 + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text);var url=%22http:\/\/cang.baidu.com\/do\/add?it=%22+encodeURIComponent(t)+%22&iu=%22+encodeURIComponent(u)+%22&dc=%22+encodeURIComponent(c)+%22&fr=ien#nw=1%22;window.open(url,%22_blank%22,%22scrollbars=no,width=440,height=440,left=80,top=80,status=no,resizable=yes%22); void 0\"><img src='http://www.askci.com/images/baidu.jpg' title=\'分享到百度搜藏\' align=\"absMiddle\" alt='百度收藏' border=\'0\'><\/a> <a href=\"javascript:void((function(s,d,e){if(/xiaonei\.com/.test(d.location))return;var%20f='http://share.xiaonei.com/share/buttonshare.do?link=',u=d.location,l=d.title,p=[e(u),'&amp;title=',e(l)].join('');function%20a(){if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent));\"><img src='http://www.askci.com/images/renren.jpg' alt='人人网' align=\"absMiddle\" title='分享到人人网'  border='0' height='32' width='32'></a> <a href=\"javascript:t=document.title;u=location.href;e=document.selection?(document.selection.type!='None'?document.selection.createRange().text:''):(document.getSelection?document.getSelection():'');void(open('http://bookmark.hexun.com/post.aspx?title='+escape(t)+'&url='+escape(u)+'&excerpt='+escape(e),'HexunBookmark','scrollbars=no,width=600,height=450,left=80,top=80,status=no,resizable=yes'));\"><img src='http://www.askci.com/images/hexun.gif' align=\"absMiddle\"  title='分享到和讯网摘' border='0'></a> <a href=\"javascript:void(0);\" onclick=\"window.open('http://myweb.cn.yahoo.com/popadd.html?url='+encodeURIComponent(document.location.href)+'&title='+encodeURIComponent(document.title), 'Yahoo','scrollbars=yes,width=780,height=550,left=80,top=80,status=yes,resizable=yes');\"><img alt=\"yahoo\" src=\"http://www.askci.com/images/yahoo.jpg\" alt=\"雅虎收藏\" border=\"0\" align=\"absMiddle\"><\/a> <a href=javascript:window.external.AddFavorite(location.href+'#sc','★'+document.title)><img src=http://www.askci.com/images/ie.gif align=\"absMiddle\" border=0></a>";

var showHtml1 = "<ul><span class=\"fxf\">分享到：</span><li class=\"tx\"><a href=\"javascript:void(0);\" onclick=\"postToWb('tencent');\" title=\"分享到腾讯微博\">腾讯</a></li><li class=\"wy\"><a onclick=\"postToWb('wy')\" href=\"javascript:void(0);\">网易</a></li><li class=\"xr\"><a href=\"javascript:void(0);\" onclick=\"postToWb('sina');\" title=\"分享到新浪微博\">新浪</a></li><li class=\"sh\"> <a onclick=\"postToWb('sohu')\" href=\"javascript:void(0);\">搜狐</a></li><li class=\"kj\"><a href=\"javascript:void(0);\" onclick=\"window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(document.location.href));return false;\" title=\"分享到QQ空间\">空间</a></li><li class=\"kx\"> <a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None'\?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(kaixin=window.open(\'http:\/\/www.kaixin001.com\/~repaste\/repaste.php?&amp;rurl=\'+escape(d.location.href)+\'&amp;rtitle=\'+escape(d.title)+\'&amp;rcontent=\'+escape(d.title),\'kaixin\'),'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');kaixin.focus();\">开心网</a></li><li class=\"tb\"><a href=\"javascript:void(0);\" title=\"百度i贴吧\" onclick=\"void(function(){var d=document,e=encodeURIComponent,u='http://tieba.baidu.com/i/app/open_share_api?link='+e(d.location.href),o=function(){if(!window.open(u))location.href=u};if(/Firefox/.test(navigator.userAgent)){setTimeout(o,0)}else{o()};return false;})();\">百度贴吧</a></li><li class=\"rr\"> <a href=\"javascript:void((function(s,d,e){if(/xiaonei\.com/.test(d.location))return;var%20f='http://share.xiaonei.com/share/buttonshare.do?link=',u=d.location,l=d.title,p=[e(u),'&amp;title=',e(l)].join('');function%20a(){if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent));\">人人网</a></li><li class=\"msns\"> <a href=\"http://profile.live.com/badge/?url=http%3A%2Fwww.contoso.com%2Farticle.htm&title=Article%20title&description=Article%20description&screenshot=http:%2F%2Fwww.contoso.com%2Fimg%2Fimage1.jpg\">MSN</a></li></ul><div class=\"clear\"></div>";

var showHtml2 = "分享到：<a class=\"tx\" href=\"javascript:void(0);\" onclick=\"postToWb('tencent');\" title=\"分享到腾讯微博\">腾讯</a> <a class=\"wy\" onclick=\"postToWb('wy')\" href=\"javascript:void(0);\">网易</a> <a class=\"xr\" href=\"javascript:void(0);\" onclick=\"postToWb('sina');\" title=\"分享到新浪微博\">新浪</a> <a class=\"sh\" onclick=\"postToWb('sohu')\" href=\"javascript:void(0);\">搜狐</a> <a class=\"kj\" href=\"javascript:void(0);\" onclick=\"window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(document.location.href));return false;\" title=\"分享到QQ空间\">空间</a> <a class=\"kx\" href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None'\?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(kaixin=window.open(\'http:\/\/www.kaixin001.com\/~repaste\/repaste.php?&amp;rurl=\'+escape(d.location.href)+\'&amp;rtitle=\'+escape(d.title)+\'&amp;rcontent=\'+escape(d.title),\'kaixin\'),'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');kaixin.focus();\">开心网</a> <a class=\"tb\" href=\"javascript:void(0);\" title=\"百度i贴吧\" onclick=\"void(function(){var d=document,e=encodeURIComponent,u='http://tieba.baidu.com/i/app/open_share_api?link='+e(d.location.href),o=function(){if(!window.open(u))location.href=u};if(/Firefox/.test(navigator.userAgent)){setTimeout(o,0)}else{o()};return false;})();\">百度贴吧</a> <a class=\"rr\" href=\"javascript:void((function(s,d,e){if(/xiaonei\.com/.test(d.location))return;var%20f='http://share.xiaonei.com/share/buttonshare.do?link=',u=d.location,l=d.title,p=[e(u),'&amp;title=',e(l)].join('');function%20a(){if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent));\">人人网</a> <a class=\"msns\" href=\"http://profile.live.com/badge/?url=http%3A%2Fwww.contoso.com%2Farticle.htm&title=Article%20title&description=Article%20description&screenshot=http:%2F%2Fwww.contoso.com%2Fimg%2Fimage1.jpg\">MSN</a>";

function showTime(str) {
    var str = new StringBuffer();
    str.append('<div id="bdshare" class="bdshare_b" style="line-height: 12px;">');
    str.append('<img src="http://bdimg.share.baidu.com/static/images/type-button-1.jpg" />');
    str.append('<a class="shareCount"></a>');
    str.append('</div>');
    str.append('<');
    str.append('script type="text/javascript" id="bdshare_js" data="type=button&amp;uid=499696"></');
    str.append('script>');
    str.append('<script type="text/javascript" id="bdshell_js"></');
    str.append('script>');
    str.append('<');
    str.append('script type="text/javascript"');
    str.append('>');
    str.append('    document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?t=" + new Date().getHours();');
    str.append('</');
    str.append('script>');

    $(str).html(str.toString());
}

$(function() {
    $("#show_Html").html(showHtml);
    //showTime("#show_Html");
})
$(function() {
    $("#show_Html1").html(showHtml1);
    //showTime("#show_Html1");
})

$(function() {
    $("#showHtml2").html(showHtml2);
    //showTime("#showHtml2");
})


/*判断cookies*/
function GetCookieVal(offset)
//获得Cookie解码后的值 
{
    var endstr = document.cookie.indexOf(";", offset);
    if (endstr == -1)
        endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie(name)
//获得Cookie的原始值 
{
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg)
            return GetCookieVal(j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
    }
    return null;
}

$(function() {
    if (GetCookie('loginUser') != null) {
        //document.getElementById("top1").innerHTML = "您好,<span style=\"color:red;\">" + GetCookie('loginUser') + "</span>,欢迎来到中商情报网!";
        document.getElementById("xianshi_lian").innerHTML = "<div><br/><br/><center>您好,<span style=\"color:red;\">" + GetCookie('loginUser') + "</span><br/><br/><a href=\"http://www.askci.com/users/default.aspx\">个人中心</a>&nbsp;&nbsp;<a href=\"http://www.askci.com/LogOut.aspx\">退出</a></center></div>";
        //document.getElementById("top3").style.display = "none";
    }
});
/*项目库登陆*/
function LoginSys() {
    var userName = document.getElementById("textfield2").value;
    var userPass = document.getElementById("textfield3").value;
    if (userName == "") {
        alert("请输入用户名");
        return;
    }
    else if (userPass == "") {
        alert("请输入密码");
        return;
    }
    else {
        var a = encodeURI(userName);
        var b = encodeURI(userPass);
        location.href = "http://www.askci.com/Ajax/ajax_login.aspx?userName=" + a + "&userPass=" + encodeURIComponent(b) + "";
    }
}
function reg() {
    location.href = "http://www.askci.com/users/Register.aspx";
}
