
if(!CONFIG_PARAM['weather_grp'])CONFIG_PARAM['weather_grp']='';if(!CONFIG_PARAM['weather_pos'])CONFIG_PARAM['weather_pos']='TOP_RIGHT';if(!CONFIG_PARAM['weather_url'])CONFIG_PARAM['weather_url']='/mxasp/weatherInfo';if(!CONFIG_PARAM['CONFIG_WEATHER_PATH'])CONFIG_PARAM['CONFIG_WEATHER_PATH']='/mcms/image';var arimg={"upleft":"upleft.gif","downleft":"downleft.gif","upright":"upright.gif","downright":"downright.gif"};var wopenimg;var wcloseimg;var WeatherObject
var WeatherCode="";var WeatherOpen=false;var WeatherFlag=false;function MWeather(mmap){this.mdiv=mmap;};MWeather.prototype.show=function(){wea=document.createElement("div");wea.style.background="#ffffff none repeat scroll 0%";wea.style.border="1px solid #7B7B7B";wea.id="weathercontrol";wea.style.width="132px";wea.style.height="60px";wea.style.position='absolute';wea.style.overflow="hidden";wea.style.zIndex=10001;we=document.createElement("div");we.id="weatherdiv";we.style.width="132px";we.style.height="60px";we.style.position='absolute';we.style.left='0px';we.style.top='0px';we.style.zIndex=10002;wib=document.createElement("div");wib.style.background="#7B7B7B none repeat scroll 0%";wib.style.width="16px";wib.style.height="16px";wib.style.position='absolute';wib.style.zIndex=10003;wimg=document.createElement("img");wimg.style.width="15px";wimg.style.height="15px";wimg.style.position='absolute';wimg.style.right='0px';wimg.style.top='0px';wimg.style.zIndex=10004;wimg.onclick=function(){if(WeatherOpen){we.style.display="block";wea.style.width="132px";wea.style.height="60px";WeatherOpen=false;this.src=wcloseimg;}else{we.style.display="none";if(MBrowser.ie5up){wea.style.width="16px";wea.style.height="16px";}else{wea.style.width="15px";wea.style.height="15px";}
WeatherOpen=true;this.src=wopenimg;}};var mapdiv=this.mdiv.mapdiv;wib.appendChild(wimg);wea.appendChild(we);wea.appendChild(wib);this.mdiv.div.appendChild(wea);this.weadiv=wea;this.wibdiv=wib;this.wediv=we;this.wimgdiv=wimg;this.setPosition(CONFIG_PARAM['weather_pos']);}
MWeather.prototype.setPosition=function(p){if(this.wediv==null)return;if(p=="TOP_LEFT"){this.weadiv.style.top="0px";this.weadiv.style.left="0px";this.wibdiv.style.top="0px";this.wibdiv.style.left="0px";wopenimg=CONFIG_PARAM['CONFIG_WEATHER_PATH']+"/"+arimg.downright;wcloseimg=CONFIG_PARAM['CONFIG_WEATHER_PATH']+"/"+arimg.upleft;wimg.style.top='0px';wimg.style.left='0px';wimg.src=wcloseimg;}
else if(p=="TOP_RIGHT"){this.weadiv.style.top="0px";this.weadiv.style.right="0px";this.wibdiv.style.top="0px";this.wibdiv.style.right="0px";wopenimg=CONFIG_PARAM['CONFIG_WEATHER_PATH']+"/"+arimg.downleft;wcloseimg=CONFIG_PARAM['CONFIG_WEATHER_PATH']+"/"+arimg.upright;wimg.style.top='0px';wimg.style.right='0px';wimg.src=wcloseimg;}
else if(p=="BOTTOM_LEFT"){this.weadiv.style.bottom="0px";this.weadiv.style.left="0px";this.wibdiv.style.bottom="0px";this.wibdiv.style.left="0px";wopenimg=CONFIG_PARAM['CONFIG_WEATHER_PATH']+"/"+arimg.upright;wcloseimg=CONFIG_PARAM['CONFIG_WEATHER_PATH']+"/"+arimg.downleft;wimg.style.top='1px';wimg.style.left='0px';wimg.src=wcloseimg;}
else if(p=="BOTTOM_RIGHT"){this.weadiv.style.bottom="0px";this.weadiv.style.right="0px";this.wibdiv.style.bottom="0px";this.wibdiv.style.right="0px";wopenimg=CONFIG_PARAM['CONFIG_WEATHER_PATH']+"/"+arimg.upleft;wcloseimg=CONFIG_PARAM['CONFIG_WEATHER_PATH']+"/"+arimg.downright;wimg.style.top='1px';wimg.style.right='0px';wimg.src=wcloseimg;}
else{this.weadiv.style.top="0px";this.weadiv.style.right="0px";this.wibdiv.style.top="0px";this.wibdiv.style.right="0px";wopenimg=CONFIG_PARAM['CONFIG_WEATHER_PATH']+"/"+arimg.downleft;wcloseimg=CONFIG_PARAM['CONFIG_WEATHER_PATH']+"/"+arimg.upright;wimg.style.top='0px';wimg.style.right='0px';wimg.src=wcloseimg;}};MWeather.prototype.update=function(){wurl=CONFIG_PARAM['weather_url'];wurl+="?grp="+CONFIG_PARAM['weather_grp'];wurl+="&admi3="+WeatherCode;wurl+="&xtype=json";wurl+="&callback=dumpjson_weather";var httpobj=CMSCommon.createHttpRequest();httpobj.open("GET",wurl,false);httpobj.send(null);if(httpobj.readyState==4||httpobj.state==200||httpobj.state==304){eval(httpobj.responseText);if(typeof(_json_dom)=='undefined')return;}else{return;}}
function dumpjson_weather(_json_dom){wdiv=document.getElementById("weatherdiv");wdata="";if(_json_dom.weather!=null||typeof(_json_dom.weather)!="undefined"){if(typeof(_json_dom.weather.point[0].day.basetime.yoho[0])!="undefined"){wdata=_json_dom.weather.point[0].day.basetime.yoho[0].property;}
wdata.admi=_json_dom.weather.point[0].admi3;}
if(wdata!=""){wdiv.innerHTML=MCMS_WeatherTemplete(wdata);if(MBrowser.ie5up){setIEStyleWeather();}
if(MBrowser.gecko){setFFStyleWeather();}
if(MBrowser.opera){setOPStyleWeather();}
if(MBrowser.safari){setSAStyleWeather();}
var ua=navigator.userAgent;if(ua.indexOf("Netscape")!=-1){setNNStyleWeather();}}else{wdiv.innerHTML='<table align="center" valign="middle" border="0" width="132" height="60" style="font-size:10px;"><tr><td><center><br>天気を表示できません<br><br></center></td></tr></table>';}}
function putWeather(wcode){if(CONFIG_PARAM['weather_grp']==''){CONFIG_PARAM['weather_grp']=CONFIG_PARAM['grp']}
if(CONFIG_PARAM['weather_grp']!=''){if(WeatherCode==""&&WeatherFlag==false){WeatherObject=new MWeather(mm);WeatherObject.show();WeatherFlag=true;}
if(wcode!=WeatherCode){WeatherCode=wcode;WeatherObject.update();}}}
