$.getScript("http://61.4.185.48:81/g/",function(){var txtBox=$(".Arc_w");var dc=document.cookie;var a_w_dc=dc.indexOf("arc_weather_text=");if(a_w_dc!=-1 && txtBox.length){txtBox.html('<a href="#查看天气详情" title="查看天气详情" class="a_w_box" onclick="arc_weather.print(); return false;">'+unescape(dc.split("arc_weather_text=")[1].split(";")[0])+'</a>');}var a_w_s=1;a_w_s=document.cookie;if(a_w_s.length>0) a_w_s=a_w_s.indexOf("arc_weather=");else var a_w_s=-1;if(a_w_s!=-1) eval("arc_weather.w="+unescape('')+";");a_w_s=(a_w_s==-1)?1:0;if(a_w_s || 1) $.getJSON("/content/plugins/weather/get.php?url=true&wid="+id+"&t="+new Date(),function(w){if(!$.isPlainObject(w)) return false;document.cookie="arc_weather_json="+escape(JSON.stringify(w));$("body").append('<div class="arc_weather bqBox"></div>');$(".arc_weather").css({"position":0?"absolute":"fixed","margin-left":function(){return -($(this).width()/2)},"margin-top":function(){return -($(this).height()/2)}});arc_weather.w=w;arc_weather.go();});});var arc_weather={w:"",img:'<img class="arc_weather_img" src="/content/plugins/weather/images/..gif"/>',txt:'<div class="arc_weather_txt"></div>',
go:function(){if(!$.isPlainObject(this.w)) return false;window.a_w_s = this;this.ast(this.w.weatherinfo.weather1.split("转"));this.amdAuto();},
ast:function(ab){var add="";for(var i in ab) add+=this.img;$(".arc_weather").html(add+this.txt);var w_s=escape(this.w.weatherinfo.city+" "+this.w.weatherinfo.weather1+" "+this.w.weatherinfo.temp1+" "+this.w.weatherinfo.wind1);document.cookie="arc_weather_text="+w_s;for(var i in ab) $(".arc_weather_img").eq(i).addClass(ab[i]);$(".arc_weather_txt").html('<div class="bqTxt">今天是：2012年02月23日 <br>'+this.w.weatherinfo.city+' '+this.w.weatherinfo.weather1+" "+this.w.weatherinfo.temp1+"<br/>"+this.w.weatherinfo.wind1+"</div>");var txtBox=$(".Arc_w");if(txtBox.length) txtBox.html('<a href="#查看天气详情" title="查看天气详情" class="a_w_box" onclick="arc_weather.print(); return false;">'+unescape(w_s)+'</a>');},
amdAuto:function(){var w_win=$(".arc_weather");var w_img=$(".arc_weather_img");if(w_img.length>1)w_img.css({"left":function(){return ($(this).index())?0:(w_win.width()-$(this).width())/2;},"z-index":function(){return ($(this).index())?4:5},opacity:".4"});else w_img.css({"left":function(){return (w_win.width()-$(this).width())/2},"z-index":5,opacity:".4"});w_win.animate({top:"50%",left:"50%",opacity: 'show'},300,function(){var lj={"opacity":'hide'};var txtBox=$(".Arc_w");if(txtBox.length){var xy=txtBox.offset(),lj={left:xy.left,top:xy.top,"opacity": 'hide'};}var wh=[w_win.width(),w_win.height()];if(w_img.length>1)for(var i in w_img){var w=wh[0]-w_img.eq(i).width();var h=wh[1]-w_img.eq(i).height();if(i==1){w_img.eq(i).animate({left:w/2+w/6,opacity:"1"},2000);}else{w_img.eq(i).animate({left:w/2-w/6,opacity:"1"},2000,function(){setTimeout(function(){window.a_w_s.objCure(w_win);w_win.animate(lj,300);},2000);document.cookie="arc_weather="+escape(window.a_w_s.w.weatherinfo.weather1.split("转")[0]);});}}else{w_img.animate({opacity:"1"},1000,function(){setTimeout(function(){window.a_w_s.objCure(w_win);w_win.animate(lj,300);},2000);document.cookie="arc_weather="+escape(window.a_w_s.w.weatherinfo.weather1.split("转")[0]);});}});},objCure:function(o){var xy=o.offset();o.css({left:function(){return xy.left+$(this).width()/2;},top:function(){return xy.top+$(this).height()/2;}});},
print:function(){if(this.w=="") return false;var m=[$(".a_w_mb"),$("#a_w_more")];var s=["星期一","星期二","星期三","星期四","星期五","星期六","星期日"];for(var i in s){if(this.w.weatherinfo.week==s[i]){var str="",l=0,s_img="";for(var j=i;j<7+parseInt(i);j++){if(++l>6) break;if(j>6) k=j-7; else k=j;eval('var img="",smg=this.w.weatherinfo.weather'+l+'.split("转");');for(var _i in smg) img+='<img class="a_w_small '+smg[_i]+'"/>';s_img+='<td class="a_w_smg">'+img+'</td>';var cl=(3==k)?"a_w_me":"";str+='<td class="a_w_wt '+cl+'">'+s[k]+'</td>';}continue;}}var w_img=this.w.weatherinfo.weather1.split("转");var img="";for(var i in w_img) img+='<img class="a_w_big '+w_img[i]+'" src="/content/plugins/weather/images/..gif" />';var str='<fieldset><legend>天气详情</legend><table><tr><td colspan="6" class="a_w_b_img">'+img+'</td></tr><tr><td colspan="6"><b>'+this.w.weatherinfo.city+' '+this.w.weatherinfo.weather1+' '+this.w.weatherinfo.temp1+' '+this.w.weatherinfo.wind1+'</b></td></tr><tr><td colspan="6" class="a_w_list"><s>紫外线指数：'+this.w.weatherinfo.index_uv+'</s><s>舒适度：'+this.w.weatherinfo.index_co+'</s><s>过敏气象指数：'+this.w.weatherinfo.index_ag +'</s><s>穿衣指数：'+this.w.weatherinfo.index+'</s><s>晨练指数：'+this.w.weatherinfo.index_cl+'</s><s>旅游指数：'+this.w.weatherinfo.index_tr+'</s><s>洗车指数：'+this.w.weatherinfo.index_xc+'</s><s>晾晒指数：'+this.w.weatherinfo.index_ls+'</s></td></tr><tr>'+str+'</tr><tr>'+s_img+'</tr><tr><td height="30">'+this.w.weatherinfo.weather1+'<br/>'+this.w.weatherinfo.temp1+'</td><td>'+this.w.weatherinfo.weather2+'<br/>'+this.w.weatherinfo.temp2+'</td><td>'+this.w.weatherinfo.weather3+'<br/>'+this.w.weatherinfo.temp3+'</td><td>'+this.w.weatherinfo.weather4+'<br/>'+this.w.weatherinfo.temp4+'</td><td>'+this.w.weatherinfo.weather5+'<br/>'+this.w.weatherinfo.temp5+'</td><td>'+this.w.weatherinfo.weather6+'<br/>'+this.w.weatherinfo.temp6+'</td></tr></table></fieldset>';if(!m[0].length || !m[1].length){$("body").append('<div class="a_w_mb" style="display:none"></div><div id="a_w_more" style="display:none">'+str+'</div>');m=[$(".a_w_mb"),$("#a_w_more")];$("#a_w_more img").attr("src","/content/plugins/weather/images/..gif");}for(var i in m) m[i].css({"position":0?"absolute":"fixed","z-index":10000+i,"background":"white",opacity:"hide"});m[0].show();m[1].css({left:"50%",top:"45%",width:"600",height:"400",opacity:"1","margin-left":function(){return -($(this).width()/2)},"margin-top":function(){return -($(this).height()/2);}});m[0].animate({width:"100%",height:$(document).height(),opacity:".4",left:0,bottom:0},300,function(){m[1].animate({top:"50%",opacity:'show'},200);});m[0].click(function(){m[1].animate({top:"45%",opacity:"hide"},200,function(){m[0].animate({height:"0",opacity:"hide"},300);});});}};
