?/**************************************搜索部分***************************************************/ //新首的 function New_SearchValues() { var keyWrods = $.trim($("#keyWord").val()); var i = $(this).index(); //var typtStrs = $(".baogaoSearchUl li:not(.a_nn4_lian) 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"); var url = "http://so.askci.com/cse/search?q=" + encodeURIComponent(keyWrods) + "&s=1090085531342264480&stp=1&nsid=6"; window.location = url; //window.open(S_Url); } } function SerachValues_neiYe(obj) { var keyWrods; if (obj == 1) { keyWrods = $.trim($("#keyWord_neiye1").val()); } else if (obj == 2) { keyWrods = $.trim($("#keyWord_neiye2").val()); } else if (obj == 3) { keyWrods = $.trim($("#search").val()); } // else if (obj == 4) { // keyWrods = $.trim($("#keyword_lsit").val()); // } 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/baogao/" + 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); } } $(function() { $(".baogaoSearchUl li").click(function() { var i = $(this).index(); $(".baogaoSearchUl li").removeClass("y_nn4").addClass("a_nn4_lian"); $(this).removeClass("a_nn4_lian").addClass("y_nn4"); }) }) //判斷某字符串是否存在于集合中 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; } $(function() { //按回車搜索 $("#keyWord").keydown(function(event) { if (event.keyCode == 13) { $("#button").click(); //激發搜索 } }); $("#keys").keydown(function(event) { if (event.keyCode == 13) { $("#btnxmk").click(); //激發搜索 } }); $("#keyWord_neiye").keydown(function(event) { if (event.keyCode == 13) { $("#button_neiye").click(); //激發搜索 } }) $("#keyWord_neiye1").keydown(function(event) { if (event.keyCode == 13) { $("#button_neiye").click(); //激發搜索 } }) // $("#keyword_lsit").keydown(function(event) { // if (event.keyCode == 13) { // $("#button_neiye").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 rq_time_css() { //document.write("http://php.weather.sina.com.cn/xml.php?city=深圳&password=DJOYnieT8234jlsK&day=0"); var day = ""; var month = ""; var ampm = ""; var ampmhour = ""; var myweekday = ""; var year = ""; mydate = new Date(); myweekday = mydate.getDay(); mymonth = mydate.getMonth() + 1; myday = mydate.getDate(); myyear = mydate.getYear(); year = (myyear > 200) ? myyear : 1900 + myyear; if (myweekday == 0) { weekday = " 星期日 "; } else if (myweekday == 1) { weekday = " 星期一 "; } else if (myweekday == 2) { weekday = " 星期二 "; } else if (myweekday == 3) { weekday = " 星期三 "; } else if (myweekday == 4) { weekday = " 星期四 "; } else if (myweekday == 5) { weekday = " 星期五 "; } else if (myweekday == 6) { weekday = " 星期六 "; } //var ip = GetLocalIPAddress(); //alert(ip); if (exist("riqiS_time")) { $("#riqiS_time").html(year + "-" + mymonth + "-" + myday + " " + weekday + " "); $.ajax({ type: "get", url: "http://www.askci.com/Ajax/ajax_city_tianqi.aspx", data: "", dataType: "jsonp", jsonp: "callback", //傳遞給請求處理程序或頁面的,用以獲得jsonp回調函數名的參數名(一般默認為:callback) success: function(msg) { if (msg != "") { $("#riqiS_time").html(year + "-" + mymonth + "-" + myday + " " + weekday + "" + msg[0].msg); } } }); } } //JS獲取IP function GetLocalIPAddress() { var obj = null; var rslt = ""; try { obj = new ActiveXObject("rcbdyctl.Setting"); rslt = obj.GetIPAddress; obj = null; } catch (e) { // } return rslt; } /**************************************研究報告的推薦和熱門***************************************************/ $(function() { $(".rec_hot_bg li").hover(function() { var i = $(this).index(); $(".rec_hot_bg li").removeClass("boz_3"); $(this).addClass("boz_3"); $("#rec_bg_span_0").removeClass("isBlock").addClass("isNone"); $("#rec_bg_span_1").removeClass("isBlock").addClass("isNone"); $("#rec_bg_span_" + i).removeClass("isNone").addClass("isBlock"); }) }) /***********************************************購物車**********************************************************/ function ShopCartCount() { $.ajax({ type: "get", url: "http://www.askci.com/Ajax2013/ShopCartAction.aspx", data: "action=totalShopCart", dataType: "jsonp", jsonp: "callback", //傳遞給請求處理程序或頁面的,用以獲得jsonp回調函數名的參數名(一般默認為:callback) success: function(msg) { if (msg != "") { $(".shopCart_Count").html(msg[0].id); } } }) } function ShopCartJsonp(id, chid, type) { //alert("當前購物車正在開發中。。。!"); $.ajax({ type: "get", async: false, url: "http://www.askci.com/Ajax2013/ShopCart.aspx", dataType: "jsonp", jsonp: "callback", //傳遞給請求處理程序或頁面的,用以獲得jsonp回調函數名的參數名(一般默認為:callback) data: "id=" + id + "&chid=" + chid + "&callback=?", //jsonpCallback: "?", //自定義的jsonp回調函數名稱,默認為jQuery自動生成的隨機函數名,也可以寫"?",jQuery會自動為你處理數據 success: function(msg) { if (msg != "") { //alert(msg[0].id); ShopCartCount(); if (msg[0].id == "2") { alert("當前報告已在購物車,請勿重復添加"); } else { if (type == 1) { if (confirm("報告加入購物車成功,是否前往購物車?")) { location.href = "http://www.askci.com/user/shopCart/"; } } else if (type == 2) { alert("報告加入購物車成功!"); location.href = "http://www.askci.com/user/shopCart/"; } else { alert("報告加入成功,可前往購物車查看!"); } } } }, error: function() { } }); } function ShopCart(id, chid, type) { ShopCartJsonp(id, chid, type); // $.ajax({ // type: "post", // url: "/Ajax2013/ShopCart.aspx", // data: "id=" + id + "&chid=" + chid + "", // success: function(msg) { // if (msg != "") { // ShopCartCount(); // if (msg == "2") { // alert("當前報告已在購物車,請勿重復添加"); // } // else { // if (type == 1) { // if (confirm("報告加入購物車成功,是否前往購物車?")) { // location.href = "http://www.askci.com/user/shopCart/"; // } // } // else if (type == 2) { // alert("報告加入購物車成功!"); // location.href = "http://www.askci.com/user/shopCart/"; // } // else { // alert("報告加入成功,可前往購物車查看!"); // } // } // } // } // }); } $(function() { $(".free_xiangmu_ul li ").hover(function() { var idTabs = $(this).attr("id"); var strArr = idTabs.split('_'); //$("#" + strArr[0] + " .bg_ul_liebiao_tabs li ").removeClass("dd89_o").addClass("dd89_t"); //$("#" + strArr[0] + " .bg_ul_liebiao_tabs li ").eq(strArr[1]).removeClass("dd89_t").addClass("dd89_o"); $("#" + strArr[0] + " table ").removeClass("isBlock").addClass("isNone"); $("#" + strArr[0] + " table ").eq(strArr[1]).removeClass("isNone").addClass("isBlock"); }) }) //行業分析 $(function() { $(".bg_ul_liebiao_tabs li").hover(function() { var idTabs = $(this).attr("id"); var strArr = idTabs.split('_'); $("#" + strArr[0] + " .bg_ul_liebiao_tabs li ").removeClass("fx_24"); $("#" + strArr[0] + " .bg_ul_liebiao_tabs li ").eq(strArr[1]).addClass("fx_24"); $("#" + strArr[0] + " span").removeClass("isBlock").addClass("isNone"); $("#" + strArr[0] + " span").eq(strArr[1]).removeClass("isNone").addClass("isBlock"); }) }) //行業分析右邊tabs $(function() { //div_content_ul //content_ul_tabs $(".content_ul_tabs li ").hover(function() { var idTabs = $(this).attr("name"); var strArr = idTabs.split('_'); var ids = $(this).index(); //alert(strArr + "," + ids); $("#" + strArr[0] + " .content_ul_tabs li ").removeClass("ry27"); $("#" + strArr[0] + " .content_ul_tabs li ").eq(ids).addClass("ry27"); $("." + idTabs + " ul").hide(); $("." + idTabs + " ul").eq(ids).show(); }) }) //行業分析右邊tabs有圖片的 $(function() { $(".content_ul_tabs_pic li ").hover(function() { var idTabs = $(this).attr("name"); var strArr = idTabs.split('_'); var ids = $(this).index(); $("#" + strArr[0] + " .content_ul_tabs_pic li ").removeClass("ry27"); $("#" + strArr[0] + " .content_ul_tabs_pic li ").eq(ids).addClass("ry27"); $("#" + strArr[0] + "0").hide(); $("#" + strArr[0] + "1").hide(); $("#" + strArr[0] + "" + ids + "").show(); }) }) /* 圖片焦點輪轉 */ var msObj = null; // 全局鼠標移過變量 var msMiliSec = 200; // 鼠標響應毫秒數 //右上角新聞動態 var _qzysmsover = false; var _qzystimeout; function changePrev(obj) { var a = $('#ys-tabs').children('a.cur'); var aIdx = parseInt(a.html()); if (aIdx == 1) { aIdx = $('#ys-tabs').children('a').length; } else { aIdx = aIdx - 1; } return changeNext(obj, aIdx); } function changeNext(obj, _index) { if (obj) { obj.blur(); } window.clearTimeout(_qzystimeout); var a = $('#ys-tabs').children('a.cur'); var aNxt; if (_index) { aNxt = $('#ys-tabs').children("a:contains('" + _index + "')"); } else if (!_qzysmsover) { aNxt = a.next("a"); if (aNxt.length == 0) { aNxt = a.parent().children("a:first"); } } if (aNxt && aNxt.length > 0) { a.removeClass("cur"); aNxt.addClass("cur"); var img = $('#ys-ulimg').find("img"); img.attr("src", aNxt.attr("img")); img.attr("title", aNxt.attr("title")); var imgLnk = img.parent().next().find("a"); img.parent().attr("href", aNxt.attr("href")); imgLnk.attr("href", aNxt.attr("href")); imgLnk.html(aNxt.attr("title")); } if (!_qzysmsover) _qzystimeout = window.setTimeout("changeNext()", 5000); return false; } $().ready(function() { _qzystimeout = window.setTimeout("changeNext()", 5000); $('#ys-tabs').children('a').bind("mouseenter", function() { _qzysmsover = true; var liIdx = parseInt($(this).html()); changeNext(null, liIdx); }).bind("mouseleave", function() { _qzysmsover = false; _qzystimeout = window.setTimeout("changeNext()", 5000); }); }); /***************/ $(function() { if (exist('top_follow_id')) { //alert(""); var wscroll = function() { var winscroll = $(window).scrollTop(); var topHeight = parseInt($('#top_follow_id').height()); if (winscroll >= topHeight) { $('#asd_follow').addClass('scroll_follow_css'); } else if (winscroll < topHeight) { $('#asd_follow').removeClass('bq3_follow_css scroll_follow_css').addClass("bq3_follow_css"); } } } $(window).scroll(function() { if (exist('top_follow_id')) { wscroll(); } }) }) /* 手機訪問 */ function Phonebrowser(xurl) { var bs = { versions: function() { var u = navigator.userAgent, app = navigator.appVersion; return {//移動終端瀏覽器版本信息 trident: u.indexOf('Trident') > -1, //IE內核 presto: u.indexOf('Presto') > -1, //opera內核 webKit: u.indexOf('AppleWebKit') > -1, //蘋果、谷歌內核 gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐內核 mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), //是否為移動終端 ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios終端 android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android終端或者uc瀏覽器 iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否為iPhone或者QQHD瀏覽器 iPad: u.indexOf('iPad') > -1, //是否iPad webApp: u.indexOf('Safari') == -1 //是否web應該程序,沒有頭部與底部 }; } (), language: (navigator.browserLanguage || navigator.language).toLowerCase() } var xCookies = getCookie("xsite"); if (bs.versions.mobile) { if (bs.versions.android || bs.versions.iPhone || bs.versions.iPad || bs.versions.ios) { if (xCookies != "pc") { window.location.href = xurl; } } } } function setCookie(c_name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()) + ";path=/;domain=askci.com"; } function getCookie(c_name) { if (document.cookie.length > 0) { c_start = document.cookie.indexOf(c_name + "="); if (c_start != -1) { c_start = c_start + c_name.length + 1; c_end = document.cookie.indexOf(";", c_start); if (c_end == -1) c_end = document.cookie.length; return unescape(document.cookie.substring(c_start, c_end)); } } return ""; }