$(function () { $(window).bind('resize', boxSize).resize(boxSize); jQuery(".tianqxx_gd").slide({ mainCell: ".bd ul", autoPlay: true, effect: "topMarquee", interTime: 80, trigger: "click" }); xstq(); war(); dsyb(); artYubao(); day10(); day15(); jiaotong(); IndexNewImg(); Index(); hdjlVldForm(); }); var tmax_9 = new Array(); var tmin_9 = new Array(); var time_9 = new Array(); var tmax_15 = new Array(); var tmin_15 = new Array(); var time_15 = new Array(); function day10() { $.getJSON("weather/data/10day.js?t=" + Math.random(), function (json) { if (json) { var strbtit = new Array(); var datetime = new Date(json[0]["datetime"].replace(/-/g, "/")); var datehour = datetime.getHours(); var create_date = json[0]["create_date"].substring(0, (json[0]["create_date"].length - 10)); var create_datetime = new Date(create_date.replace(/-/g, "/")); if (datehour >= 6 && datehour <= 11) { if ($("#date_fb").length > 0) { $("#date_fb").append(create_datetime.Format('yyyy-MM-dd hh:mm')) }; datetime.setDate(datetime.getDate()); } else { if ($("#date_fb").length > 0) { $("#date_fb").append(create_datetime.Format('yyyy-MM-dd hh:mm')) }; datetime.setDate(datetime.getDate() + 1); } var dayNames = new Array("周日", "周一", "周二", "周三", "周四", "周五", "周六"); for (var i = 1; i <= 10; i++) { var _tmax = json[0]["tmax" + i + ""]; var _tmin = json[0]["tmin" + i + ""]; var _week = dayNames[datetime.getDay()]; strbtit.push("" + datetime.Format('MM/dd') + "
" + _week + "

\""
"); time_9.push(datetime.Format('MM/dd')); tmax_9.push(_tmax); tmin_9.push(_tmin); datetime.setDate(datetime.getDate() + 1) }; $("#littit_10").append(strbtit.join("")); $("#littit_10 span:last").css("background", "none"); //line_10day(); tenday(); } }) }; function day15() { $.getJSON("weather/data/15day.js?t=" + Math.random(), function (json) { if (json) { var strbtit = new Array(); var datetime = new Date(json[0]["valid_datetime"].replace(/-/g, "/")); var datehour = datetime.getHours(); //var create_date = json[0]["create_date"].substring(0, (json[0]["create_date"].length - 6)); if (datehour >= 6 && datehour <= 11) { //if ($("#date_fb").length > 0) { $("#date_fb").append(datetime.Format('yyyy-MM-dd 6:00')) }; datetime.setDate(datetime.getDate()); }else{ //if ($("#date_fb").length > 0) { $("#date_fb").append(datetime.Format('yyyy-MM-dd 17:00')) }; datetime.setDate(datetime.getDate()+1); } var dayNames = new Array("周日", "周一", "周二", "周三", "周四", "周五", "周六"); for (var i = 1; i <= 15; i++) { var _tmax = json[0]["tmax" + i + ""]; var _tmin = json[0]["tmin" + i + ""]; var _week = dayNames[datetime.getDay()]; strbtit.push("" + datetime.Format('MM/dd') + "
" + _week + "

\""
"); time_15.push(datetime.Format('MM/dd')); tmax_15.push(_tmax); tmin_15.push(_tmin); datetime.setDate(datetime.getDate() + 1) }; $("#littit_15").append(strbtit.join("")); $("#littit_15 span:last").css("background", "none"); //line_10day(); fifday(); } }) }; var _StationName = { "59828": ["禅城", 0], "59288": ["南海", 1], "59480": ["顺德", 2], "59829": ["高明", 3], "59279": ["三水", 4] }; var _shikuangStation = {"G6808": ["禅城", "59828", "59828"], "G2288": ["南海", "59288", "59288"], "G2284": ["顺德", "59480", "59480"], "G7045": ["高明", "59829", "V7045"], "G2289": ["三水", "59279", "59279"]}; function dsyb() { $.getJSON("weather/data/foshorttime.js?t=" + Math.random(), function (json) { $("#duanshi_s_cc").empty(); if (json) { $.each(_StationName, function (key, value) { var foshorHtml_am = ""; var foshorHtml_am_time = ""; var foshorHtml_pm = ""; var foshorHtml_pm_time = ""; var issue_datetime_html = ""; $.each(json, function (index, content) { var sid = content.stationid; if (key == sid) { var valid_datetime = new Date(content.valid_datetime.replace(/-/g, "/")); if (foshorHtml_am == "") { foshorHtml_am_time = valid_datetime; foshorHtml_am = "

" + content.efdate + ":" + content.ws + "," + content.wind + ",气温:" + Math.floor(content.tmin) + "-" + Math.floor(content.tmax) + "℃,相对湿度:" + Math.floor(content.hmin) + "%-" + Math.ceil(content.hmax) + "%"; } else { foshorHtml_pm_time = valid_datetime; foshorHtml_pm = "

" + content.efdate + ":" + content.ws + "," + content.wind + ",气温:" + Math.floor(content.tmin) + "-" + Math.floor(content.tmax) + "℃,相对湿度:" + Math.floor(content.hmin) + "%-" + Math.ceil(content.hmax) + "%"; var issue_datetime = new Date(content.issue_datetime.replace(/-/g, "/")); issue_datetime_html += "" + issue_datetime.Format("MM月dd日hh时mm") + "分发布"; } } }); if (foshorHtml_pm_time < foshorHtml_am_time) { var pm_t = foshorHtml_am; foshorHtml_am = foshorHtml_pm; foshorHtml_pm = pm_t; }; foshorHtml_am += ";

"; foshorHtml_pm += "。

" + issue_datetime_html + "
"; $("#duanshi_s_cc").append(foshorHtml_am + foshorHtml_pm) }) } }); $.getJSON("weather/data/fodaily.js?t=" + Math.random(), function (json) { if (json) { var datetime = new Date(json[0].datetime.replace(/-/g, "/")); $("#duanshi_o_cc").append("

" + json[0]["summary"].replace("。", ";") + "

" + json[0]["outlook"] + "" + datetime.Format("MM月dd日hh时mm") + "分发布

") } }) }; function artYubao() { $.ajax({ type: "POST", dataType: "jsonp", url: "http://219.130.221.166:8080/huanbao/newaoybData.action", timeout: 6000, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log("数据获取失败!" + "XMLHttpRequest.status:" + XMLHttpRequest.status + " XMLHttpRequest.readyState:" + XMLHttpRequest.readyState + " textStatus:" + textStatus) }, success: function (json) { var date1 = $("#airdate1"); var date2 = $("#airdate2"); var date3 = $("#airdate3"); var acontent1 = $("#acontent1"); var bcontent1 = $("#bcontent1"); var ccontent1 = $("#ccontent1"); var acontent2 = $("#acontent2"); var bcontent2 = $("#bcontent2"); var ccontent2 = $("#ccontent2"); var airtime = $("#airtime"); date1.html(json[0].H24.substring(5, 10).replace("-", "/")); date2.html(json[0].H48.substring(5, 10).replace("-", "/")); date3.html(json[0].H72.substring(5, 10).replace("-", "/")); acontent1.html(json[0].AUTO_COM24); bcontent1.html(json[0].AUTO_COM48); ccontent1.html(json[0].AUTO_COM72); acontent2.html(json[0].MANAUAL_COM24); bcontent2.html(json[0].MANAUAL_COM48); ccontent2.html(json[0].MANAUAL_COM72); var airupdate = new Date(Date.parse(json[0].RESULT_TIME.replace(/-/g, "/"))); airtime.html(airupdate.format("yyyy年MM月dd日hh时")); } }) }; function xstq() { $('.ybpic .skNext').live('click', function () { var sk_zxs = $('div.sk_zxs').hide(); $(".sxsfont ul").hide(); var curr_sk_zxs = $(this).parents('div.sk_zxs').next('div.sk_zxs'); var bgImg = curr_sk_zxs.find("div.bg img").attr("src"); var index = curr_sk_zxs.index(); if (index == -1) { sk_zxs.stop(true, true).eq(0).fadeIn(); $(".sxs_" + sk_zxs.eq(0).attr("rel")).stop(true, true).fadeIn(); bgImg = sk_zxs.eq(0).find("div.bg img").attr("src") } else { curr_sk_zxs.stop(true, true).fadeIn(); $(".sxs_" + curr_sk_zxs.attr("rel")).stop(true, true).fadeIn() }; $(".ybpic:first").css("background", "url(" + bgImg + ") no-repeat") }); var vis_lastJson = null; $.ajaxSettings.async= false; $.getJSON("weather/data/vis_last.js?t=" + Math.random(), function (json) { vis_lastJson = json }); $.each(_shikuangStation, function (key, value) { $.getJSON("weather/data/aws_inst_fo_" + key + ".js?t=" + Math.random(), function (json) { if (json) { $.getJSON("weather/data/fohours_" + value[1] + ".js?t=" + Math.random(), function (content) { var newJson = json[json.length - 1]; var firstJson = json[0]; var t = parseFloat(newJson.t).toFixed(1); var calT = parseFloat(t - firstJson.t).toFixed(1); var p = newJson.p; var u = newJson.u; var wd2 = newJson.wd2; var wf2 = newJson.wf2; var r1h = newJson.r1h; var r3h = newJson.r3h; var newdatetime = new Date(newJson.datetime.replace(/-/g, "/")); var datetime = new Date(json[0].datetime.replace(/-/g, "/")); var yubao_day1 = new Array(); var showrval = ""; var r1hInt = r1h != "" ? r1h : 0; var r3hInt = r3h != "" ? r3h : 0; if (r1hInt > 0) { showrval = newdatetime.Format('dd日hh时') + "至今" + r1hInt + "(mm)"; } else if (r3hInt > 0) { showrval = newdatetime.Format('dd日hh时') + "至今" + r1hInt + "(mm)" } else { var r24h = 0; $.each(json, function (k, content) { var r = content.r1h; if (r != "") r24h += parseFloat(r); }); r24h = r24h.toFixed(1); showrval = datetime.Format('dd日hh时') + "至今" + (r24h == 0 ? "无雨量记录" : r24h + "(mm)"); }; var vis_lastVis = 0; $.each(vis_lastJson, function ( k, vis_lastcontent) { if (vis_lastcontent.stationid == value[2]) { vis_lastVis = vis_lastcontent.vis; return false; } }); vis_lastVis = vis_lastVis > 0 ? (vis_lastVis / 1000).toFixed(1) + "公里" : "无数据"; yubao_day1.push("
"); yubao_day1.push("

现在 · " + value[0] + "

"); yubao_day1.push("
" + t + "℃
"); yubao_day1.push("
较昨日:" + (calT >= 0 ? "上升" : "下降") + Math.abs(calT) + "℃
"); yubao_day1.push("
风向:" + wd8[wd2][0] + "
"); yubao_day1.push("
风速:" + wf2 + " m/s
"); yubao_day1.push("
能见度:" + vis_lastVis + "
"); yubao_day1.push("
"); yubao_day1.push("
本站气压:" + (p != "" ? p + "hPa" : "") + "
相对湿度:" + u + "%
" + showrval + "
"); yubao_day1.push("
" + newdatetime.Format("yyyy年MM月dd日hh时mm分") + "
"); var curr_datetime = new Date(); var PeriodPath = "day"; if (curr_datetime.getHours() >= 19 || curr_datetime.getHours() < 7) PeriodPath = "night"; var w_code = content[3].w; w_code = ShikuanType(w_code); yubao_day1.push("
"); var ybpic_bg = "images/weather/index/bg/" + PeriodPath + "/" + w_code + ".jpg"; if (key == "G6808") { $(".ybpic:first").css("background", "url(" + ybpic_bg + ") no-repeat"); $("#yubao_day1").empty() }; yubao_day1.push("
"); yubao_day1.push("
"); $("#yubao_day1").append(yubao_day1.join('')); $('div.sk_zxs:first').show() }) } }); var yubao_sxs = new Array(); $.getJSON("weather/data/fohours_" + value[1] + ".js?t=" + Math.random(), function (json) { yubao_sxs.push(""); $(".sxsfont").append(yubao_sxs.join('')); $(".sxsfont ul:first").show() }) }) $.ajaxSettings.async= true; }; function myWeather() { $.getJSON("weather/data/10day.js?t=" + Math.random(), function (json) { var datetime = new Date(json[0]["datetime"].replace(/-/g, "/")); var wb2 = ''; var wb3 = ''; var wb4 = ''; var wb5 = ''; $.getJSON("weather/data/foId_wea.js?t=" + Math.random(), function (jsonf) { if (jsonf) { $.each(jsonf, function (key, value) { if (json[0]["wb1"] == value.id) wb2 = value.w; if (json[0]["wb2"] == value.id) wb3 = value.w; if (json[0]["wb3"] == value.id) wb4 = value.w; if (json[0]["wb4"] == value.id) wb5 = value.w }); var sbweilai = new Array(); datetime.setDate(datetime.getDate() + 1); sbweilai.push("
  • " + (datetime.getMonth() + 1) + "月" + datetime.getDate() + " \""" + wb2 + "" + json[0]["tmin1"] + "°C~" + json[0]["tmax1"] + "°C" + "
  • "); datetime.setDate(datetime.getDate() + 1); sbweilai.push("
  • " + (datetime.getMonth() + 1) + "月" + datetime.getDate() + " \""" + wb3 + "" + json[0]["tmin2"] + "°C~" + json[0]["tmax2"] + "°C" + "
  • "); datetime.setDate(datetime.getDate() + 1); sbweilai.push("
  • " + (datetime.getMonth() + 1) + "月" + datetime.getDate() + " \""" + wb4 + "" + json[0]["tmin3"] + "°C~" + json[0]["tmax3"] + "°C" + "
  • "); datetime.setDate(datetime.getDate() + 1); sbweilai.push("
  • " + (datetime.getMonth() + 1) + "月" + datetime.getDate() + " \""" + wb5 + "" + json[0]["tmin4"] + "°C~" + json[0]["tmax4"] + "°C" + "
  • "); datetime.setDate(datetime.getDate() + 1); $("#litweilai01").append(sbweilai.join("")) } }) }) }; function war() { var sContent01 = new Array(); $.getJSON("/weather/data/wa_fo_inforce.js?t=" + Math.random(), function (json) { if (json == "null") { $(".load").hide(); $(".yjqy").show(); return }; if (json) { $(".load").hide(); $(".warnInfo").show(); var wa_fo_area = { "BFFO": "禅城", "GDNH": "南海", "GDSD": "顺德", "GDGM": "高明", "GDSS": "三水" }; var wa_fo_type = { "A": ["台风", ""], "B": ["暴雨", ""], "C": ["高温", ""], "D": ["寒冷", ""], "E": ["大雾", ""], "F": ["灰霾", ""], "G": ["雷雨大风", "max"], "I": ["冰雹", ""], "J": ["森林火险", "max"] }; $.each(wa_fo_type, function (type_key, type_val) { var ddHead_html = "
    "; sContent01.push(ddHead_html) } }); $(".tqyj dl").append(sContent01.join('')) } }) }; function line_10day() { require.config({ paths: { echarts: '/Echarts/asset/js/echarts', 'echarts/chart/line': '/Echarts/asset/js/echarts-map' } }); option = { title: { text: '', subtext: '' }, tooltip: { trigger: 'axis', axisPointer: { type: 'none' } }, legend: { selectedMode: false, data: ['', ''] }, toolbox: { show: false }, calculable: false, color: ['#f9a700', '#6196ff'], grid: { x: 40, y: 30, x2: 40, y2: 5, borderWidth: 0 }, xAxis: [{ type: 'category', boundaryGap: false, axisTick: { show: false }, axisLine: false, splitArea: { show: false }, splitLine: { show: false }, axisLabel: { textStyle: { color: '#fff' } }, data: time_9 }], yAxis: [{ type: 'value', axisLabel: { show: false, formatter: '{value} °C' }, scale: true, axisLine: false, splitArea: { show: false }, splitLine: { show: false } }], series: [{ name: '最高气温', type: 'line', itemStyle: { normal: { lineStyle: { shadowColor: 'rgba(0,0,0,0.0)' } } }, symbol: "circle", symbolSize: "2", itemStyle: { normal: { label: { show: true, textStyle: { fontSize: '16', fontFamily: '微软雅黑', color: '#7b7b7b', fontWeight: 'bold' } } } }, data: tmax_9, tooltip: { trigger: 'item', formatter: "最高气温:{c} ℃" } }, { name: '最低气温', type: 'line', itemStyle: { normal: { lineStyle: { shadowColor: 'rgba(0,0,0,0.0)' } } }, symbol: "circle", symbolSize: "2", itemStyle: { normal: { label: { show: true, textStyle: { fontSize: '16', fontFamily: '微软雅黑', color: '#7b7b7b', fontWeight: 'bold' } } } }, data: tmin_9, tooltip: { trigger: 'item', formatter: "最低气温:{c} ℃" } }] }; require(['echarts', 'echarts/chart/line'], function (ec) { var myChart = ec.init(document.getElementById('weather_10')); myChart.setOption(option) }) }; //add by terry 20160106 //10天曲线 function tenday() { var ten1 = []; var ten2 = []; for (var i = 0; i < tmax_9.length; i++) { ten1[i] = parseFloat(tmax_9[i]); ten2[i] = parseFloat(tmin_9[i]); } var chart1; chart1 = new Highcharts.Chart({ chart: { renderTo: 'weather_10', //图表放置的容器,DIV defaultSeriesType: 'line', //图表类型line(折线图), zoomType: '', //x轴方向可以缩放 backgroundColor: 'rgba(0,0,0,0)' }, credits: { enabled: false //右下角不显示LOGO }, title: { text: '' //图表标题 }, tooltip: { //enabled: false, formatter: function () { return '' + this.series.name + '
    ' + this.y + '°C'; } }, subtitle: { text: '' //副标题 }, xAxis: { //x轴 title: { text: '' }, //标题 gridLineWidth: 0, //设置网格宽度为0 lineColor: 'rgba(0,0,0,0)', tickWidth: 0, labels: { enabled: false } }, yAxis: { //y轴 title: { text: '' }, //标题 gridLineWidth: 0, //设置网格宽度为0 labels: { enabled: false } }, colors: ['#f9a700'], plotOptions: { //设置数据点 line: { dataLabels: { enabled: true, //在数据点上显示对应的数据值 formatter: function () { return '' + this.y + ''; } } //enableMouseTracking: false //取消鼠标滑向触发提示框 } }, legend: { //图例 enabled: false }, exporting: { enabled: false //设置导出按钮不可用 }, series: [ { //数据列 name: '最高气温', data: ten1 } ] }); chart1 = new Highcharts.Chart({ chart: { renderTo: 'weather_101', //图表放置的容器,DIV defaultSeriesType: 'line', //图表类型line(折线图), zoomType: '', //x轴方向可以缩放 backgroundColor: 'rgba(0,0,0,0)' }, credits: { enabled: false //右下角不显示LOGO }, title: { text: '' //图表标题 }, tooltip: { //enabled: false, formatter: function () { return '' + this.series.name + '
    ' + this.y + '°C'; } }, subtitle: { text: '' //副标题 }, xAxis: { //x轴 title: { text: '' }, //标题 gridLineWidth: 0, //设置网格宽度为0 lineColor: 'rgba(0,0,0,0)', tickWidth: 0, labels: { enabled: false } }, yAxis: { //y轴 title: { text: '' }, //标题 gridLineWidth: 0, //设置网格宽度为0 labels: { enabled: false } }, colors: ['#6196ff'], plotOptions: { //设置数据点 line: { dataLabels: { enabled: true, //在数据点上显示对应的数据值 formatter: function () { return '' + this.y + ''; } } //enableMouseTracking: false //取消鼠标滑向触发提示框 } }, legend: { //图例 enabled: false }, exporting: { enabled: false //设置导出按钮不可用 }, series: [ { name: '最低气温', data: ten2 }] }); } //15天曲线 function fifday() { var ten1 = []; var ten2 = []; for (var i = 0; i < tmax_15.length; i++) { ten1[i] = parseFloat(tmax_15[i]); ten2[i] = parseFloat(tmin_15[i]); } var chart; chart = new Highcharts.Chart({ chart: { renderTo: 'weather_15', //图表放置的容器,DIV defaultSeriesType: 'line', //图表类型line(折线图), zoomType: '', //x轴方向可以缩放 backgroundColor: 'rgba(0,0,0,0)' }, credits: { enabled: false //右下角不显示LOGO }, title: { text: '' //图表标题 }, tooltip: { //enabled: false, formatter: function () { return '' + this.series.name + '
    ' + this.y + '°C'; } }, subtitle: { text: '' //副标题 }, xAxis: { //x轴 title: { text: '' }, //标题 gridLineWidth: 0, //设置网格宽度为0 lineColor: 'rgba(0,0,0,0)', tickWidth: 0, labels: { enabled: false } }, yAxis: { //y轴 title: { text: '' }, //标题 gridLineWidth: 0, //设置网格宽度为0 labels: { enabled: false } }, colors: ['#f9a700'], plotOptions: { //设置数据点 line: { dataLabels: { enabled: true, //在数据点上显示对应的数据值 formatter: function () { return '' + this.y + ''; } } //enableMouseTracking: false //取消鼠标滑向触发提示框 } }, legend: { //图例 enabled: false }, exporting: { enabled: false //设置导出按钮不可用 }, series: [ { //数据列 name: '最高气温', data: ten1 } ] }); chart = new Highcharts.Chart({ chart: { renderTo: 'weather_151', //图表放置的容器,DIV defaultSeriesType: 'line', //图表类型line(折线图), zoomType: '', //x轴方向可以缩放 backgroundColor: 'rgba(0,0,0,0)' }, credits: { enabled: false //右下角不显示LOGO }, title: { text: '' //图表标题 }, tooltip: { //enabled: false, formatter: function () { return '' + this.series.name + '
    ' + this.y + '°C'; } }, subtitle: { text: '' //副标题 }, xAxis: { //x轴 title: { text: '' }, //标题 gridLineWidth: 0, //设置网格宽度为0 lineColor: 'rgba(0,0,0,0)', tickWidth: 0, labels: { enabled: false } }, yAxis: { //y轴 title: { text: '' }, //标题 gridLineWidth: 0, //设置网格宽度为0 labels: { enabled: false } }, colors: ['#6196ff'], plotOptions: { //设置数据点 line: { dataLabels: { enabled: true, //在数据点上显示对应的数据值 formatter: function () { return '' + this.y + ''; } } //enableMouseTracking: false //取消鼠标滑向触发提示框 } }, legend: { //图例 enabled: false }, exporting: { enabled: false //设置导出按钮不可用 }, series: [ { name: '最低气温', data: ten2 }] }); } function jiaotong() { $.getJSON("weather/data/foroad.js?t=" + Math.random(), function (json) { if (json) { var jt_right01 = new Array(); var jt_right02 = new Array(); jt_right01.push("

    " + json[0]["s_time"] + "

    "); jt_right01.push("

    " + json[0]["situation"] + "

    "); jt_right01.push("更多"); jt_right02.push("

    " + json[0]["f_time"] + "

    "); jt_right02.push("

    " + json[0]["forecast_content"] + "

    "); jt_right02.push("更多"); $("#jt_right01").append(jt_right01.join('')); $("#jt_right02").append(jt_right02.join('')) } }) }; function Index() { $(".tqzs ul li").hover(function () { $(this).find(".nav_5").show() }, function () { $(this).find(".nav_5").hide() }); $(".link_ti li.title:last").css("marginRight", 0); var sk_time = null; $(".nav_1 ul li").hover(function () { var curr = $(this); sk_time = setTimeout(function () { $(".nav_1 ul li").removeClass("hover"); curr.addClass("hover"); var index = $(".nav_1 ul li").index(curr); if (!$(".ybpic").eq(index).is(":visible")) { $(".ybpic").stop(true, true).fadeOut(); $(".ybpic").stop(true, true).eq(index).fadeIn() } }, 500) }, function () { clearTimeout(sk_time) }); $(".local_scenery ul li").mouseover(function () { $(".local_scenery ul li").removeClass("hover"); $(this).addClass("hover"); var index = $(".local_scenery ul li").index(this); $(".local_scenery_con .cxyb_con").stop(true, true).fadeOut(); $(".local_scenery_con .cxyb_con").stop(true, true).eq(index).fadeIn() }); $(".nav_6 ul li").click(function () { $(this).siblings().removeClass("hover"); $(this).addClass("hover"); var index = $(this).index(); $(".daytq0,.daytq1").stop(true, true).hide(); $(".daytq" + index + "").stop(true, true).fadeIn() }); $(".nav_7 ul li").mouseover(function () { $(".nav_7 ul li").removeClass("hover"); $(this).addClass("hover"); var index = $(".nav_7 ul li").index(this); $(".tfmap").stop(true, true).fadeOut(); $(".tfmap").stop(true, true).eq(index).fadeIn() }); $(".nav_8 ul li").mouseover(function () { $(".nav_8 ul li").removeClass("hover"); $(this).addClass("hover"); var index = $(".nav_8 ul li").index(this); $(".qhpg ul.u1").stop(true, true).fadeOut(); $(".qhpg ul.u1").stop(true, true).eq(index).fadeIn() }); $(".dsfont_area li").hover(function () { $(this).siblings().removeClass("hover"); $(this).addClass("hover"); var index = $(this).index(); $(".dsfont div").stop(true, true).hide(); $(".dsfont div.shtime_" + index + "").stop(true, true).fadeIn() }, function () { }); $(".linknav").click(function () { var childrenUl = $(this).children("ul"); var li_count = childrenUl.children("li").size(); var ultop = li_count * -39; childrenUl.css("top", ultop + (li_count - 1)); childrenUl.show() }); $(".linknav .list li").click(function () { window.open($(this).attr("rel")) }); $(".linknav").hover(function () { }, function () { $(this).find("ul").hide() }); $(".nav_ygzw ul li").mouseover(function () { $(".nav_ygzw ul li").removeClass("hover"); $(this).addClass("hover"); var index = $(".nav_ygzw ul li").index(this); $(".con_ygzw").stop(true, true).fadeOut(); $(".con_ygzw").stop(true, true).eq(index).fadeIn() }); $(".nav_ggda ul li").mouseover(function () { $(".nav_ggda ul li").removeClass("hover"); $(this).addClass("hover"); var index = $(".nav_ggda ul li").index(this); $(".con_ggda").stop(true, true).fadeOut(); $(".con_ggda").stop(true, true).eq(index).fadeIn() }) }; function hdjlVldForm() { $(".hdjl_form").Validform({ tiptype: function (msg, o, cssctl) { var objtip = $("#errcc"); cssctl(objtip, o.type); objtip.text(msg) }, ajaxPost: true, callback: function (data) { if (data.status == "y") { $("#errcc").html(data.info); $("#uname").val(""); $("#umail").val(""); $("#content").val(""); $("#txtCode").val("") } } }) }; function IndexNewImg() { $.ajax({ url: "Radar/RadarList.js?t=" + Math.random(), success: function (imgList) { $(".index_radar").attr("src", "/tools/Http_ImgLoad.ashx?w=352&h=211&m=Cut&gurl=/" + eval(imgList)[0]); } }); $.ajax({ url: "Cloud/CloudList-fy2e.js?t=" + Math.random(), success: function (imgList) { if (imgList == "[]") { $.ajax({ type: "GET", url: "/Cloud/CloudList-fy2d.js?t=" + Math.random(), success: function (imgList) { var img = eval(imgList)[0]; var imgsavrPath = img.substr(0, 12); var imgName = img.substr(12); var year = img.substr(17, 4); var month = img.substr(22, 2); var day = img.substr(25, 2); var cloudImg = imgsavrPath + year + "/" + month + "/" + day + "/" + imgName; $(".index_cloud").attr("src", "/tools/Http_ImgLoad.ashx?w=352&h=211&m=Cut&gurl=" + img) } }) } else { var img = eval(imgList)[0]; var imgsavrPath = img.substr(0, 12); var imgName = img.substr(12); var year = img.substr(17, 4); var month = img.substr(22, 2); var day = img.substr(25, 2); var cloudImg = imgsavrPath + year + "/" + month + "/" + day + "/" + imgName; $(".index_cloud").attr("src", "/tools/Http_ImgLoad.ashx?w=352&h=211&m=Cut&gurl=" + img) } } }); $.ajax({ url: "Virtual/VirtualList.js?t=" + Math.random(), success: function (imgList) { var img = eval(imgList)[0]; $(".index_virtual").attr("src", "/tools/Http_ImgLoad.ashx?w=352&h=264&m=Cut&gurl=/pub/picture/rpt/sj/" + img.pic) } }); $(".index_dz").attr("src", "/tools/Http_ImgLoad.ashx?w=352&h=211&m=Cut&gurl=" + pic) };Date.prototype.Format = function (fmt) { var o = { "M+": this.getMonth() + 1, "d+": this.getDate(), "h+": this.getHours(), "m+": this.getMinutes(), "s+": this.getSeconds(), "q+": Math.floor((this.getMonth() + 3) / 3), "S": this.getMilliseconds() }; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); return fmt }; function ShikuanType(code) { var type = ""; switch (code) { case "0": type = "sunny"; break; case "1": case "53": type = "partly-cloudy"; break; case "2": case "18": type = "cloudy"; break; case "3": case "4": type = "shower"; break; case "5": case "6": case "7": case "8": case "9": case "10": case "11": case "12": case "21": case "22": case "23": case "24": case "25": type = "rainy"; break }; return type; }