(function(w,d){var DEFAULT_PERIOD_MONTH=1,period_month=prompt('収集期間: n(ヶ月) (※nヶ月前~昨日までの測定データが対象)',DEFAULT_PERIOD_MONTH);if(period_month===null){return}period_month=parseInt(period_month,10);if(period_month<=0){period_month=DEFAULT_PERIOD_MONTH}var script=d.createElement('script');script.src='//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js';d.body.appendChild(script);function check(){if(!w.jQuery){setTimeout(check,100);return}var $=w.jQuery;function change_speed_to_Mbps(speed){if(!$.trim(speed).match(/([\d.]+)\s*(\w?)bps/i)){return speed}var value=RegExp.$1,unit=RegExp.$2;switch(unit.toUpperCase()){case'K':value/=1e3;break;case'M':break;case'G':value*=1e3;break;case'T':value*=1e6;break;default:value/=1e6;break}return value}function get_filter_info(){var option_text_list=[],filter_setting=$('div#filter_setting');filter_setting.find('select').each((function(){var select=$(this),value=select.val();select.find('option[value='+value+']').each((function(){var option=$(this),text=option.text().replace(/[─│┌┐┘└├┬┤┴┼]/g,'');option_text_list.push(text)}))}));var zipcode='';filter_setting.find('input').each((function(){var input=$(this),type=input.attr('type'),name=input.attr('name'),value=input.val();switch(type){case'checkbox':option_text_list.push(value+'='+(input.prop('checked')?'ON':'OFF'));break;case'text':if(name=='zipcode1'){zipcode+=value}else if(name=='zipcode2'){zipcode+='-'+value;option_text_list.push(zipcode)}break}}));return option_text_list.join('・')}function get_date_string(date){return date.getFullYear()+'/'+(parseInt(date.getMonth(),10)+1)+'/'+date.getDate()}function get_time_string(date){return date.getHours()+':'+date.getMinutes()}function get_date(speed_data){if(!speed_data.match(/(\d{4})\/(\d{1,2})\/(\d{1,2})[\s()a-zA-Z]+(\d{1,2}):(\d{1,2})/)){return null}return new Date(RegExp.$1,RegExp.$2-1,RegExp.$3,RegExp.$4,RegExp.$5)}function get_speed_info(table){var downlink_speed=change_speed_to_Mbps(table.find('span.graphmarker').first().text()),speed_data=table.find('div.speeddata').first().text(),date=get_date(speed_data),topic_id=$.trim(table.find('a[href *= "openresult.cgi?topic"]').first().text());if(table.find('nobr:contains(下り)').size()<1){downlink_speed=-1}return{downlink_speed:downlink_speed,speed_data:speed_data,date:date,topic_id:topic_id}}var get_page_info=function(){var next_url_dict={},topic_id_dict={};return function(page_root,since_date,until_date){var speed_info_list=[],next_url=null,first_date=new Date;page_root.find('table.graphscale').each((function(){var table=$(this).parents('table').eq(1),speed_info=get_speed_info(table),target_date=speed_info.date,topic_id=speed_info.topic_id;if(topic_id_dict[topic_id]){console.log('topic_id重複: '+topic_id);return}topic_id_dict[topic_id]=true;if(target_date