// (･ｘ･)
Scroller={speed:10,gy:function(d){gy=d.offsetTop;if(d.offsetParent){while(d=d.offsetParent){gy+=d.offsetTop}}return gy},scrollTop:function(){body=document.body;d=document.documentElement;if(body&&body.scrollTop){return body.scrollTop}if(d&&d.scrollTop){return d.scrollTop}if(window.pageYOffset){return window.pageYOffset}return 0},add:function(event,body,d){if(event.addEventListener){return event.addEventListener(body,d,false)}if(event.attachEvent){return event.attachEvent('on'+body,d)}},end:function(e){if(window.event){window.event.cancelBubble=true;window.event.returnValue=false;return}if(e.preventDefault&&e.stopPropagation){e.preventDefault();e.stopPropagation()}},scroll:function(d){i=window.innerHeight||document.documentElement.clientHeight;h=document.body.scrollHeight;a=Scroller.scrollTop();if(d>a){if(d>h-i){d=h-i}a+=Math.ceil((d-a)/Scroller.speed)}else a=a+(d-a)/Scroller.speed;window.scrollTo(0,a);if(a==d||Scroller.offsetTop==a){clearInterval(Scroller.interval)}Scroller.offsetTop=a},init:function(){Scroller.add(window,'load',Scroller.render)},render:function(){a=document.getElementsByTagName('a');Scroller.end(this);window.onscroll;for(i=0;i<a.length;i++){l=a[i];p1=l.href.replace(/#.*/,"");p2=location.href.replace(/#.*/,"");if(l.href&&l.href.indexOf('#')!=-1&&((p1==p2)||('/'+p1==p2))){Scroller.add(l,'click',Scroller.end);l.onclick=function(){Scroller.end(this);l=this.hash.substr(1);a=document.getElementById(l);if(a){clearInterval(Scroller.interval);Scroller.interval=setInterval('Scroller.scroll('+Scroller.gy(a)+')',10)}}}}}};Scroller.init();
function HZMintFormat(num,cnt){var ans=''+num;for(var i=cnt-ans.length;i>0;i--){ans='0'+ans}return ans};
function HZMgetElementsByClassName(wantClass){var elements=new Array();var i,j,tmpClass,allTagLength,tmpClassLength;var allTag=document.getElementsByTagName('*');allTagLength=allTag.length;for(i=0;i<allTagLength;i++){tmpClass=allTag[i].className.split(/\s+/);tmpClassLength=tmpClass.length;for(j=0;j<tmpClassLength;j++){if(tmpClass[j]==wantClass){elements.push(allTag[i]);break}}}return elements};
function HZMclassSetByID(ini_id,ini_class){var element=document.getElementById(ini_id);if(element){element.className=ini_class}};
function HZMpopup(){var backNode=document.createElement('div');var windowNode=document.createElement('div');backNode.id='popBack';windowNode.id='popWindow';document.body.appendChild(backNode);document.body.appendChild(windowNode);var obj=HZMgetElementsByClassName('popup');for(var i=0;i<obj.length;i++){obj[i].onclick=function(){if(typeof document.body.style.maxHeight=="undefined"){location.href=this.getAttribute('href');return false}document.getElementById('popBack').style.display='block';document.getElementById('popWindow').style.display='block';document.getElementById('popWindow').className='loading';document.getElementById('popWindow').innerHTML='<a href="javascript:HZMpopClose();" id="popA">&nbsp;</a>';var url=this.getAttribute('href');var img=new Image();img.onload=function(){document.getElementById('popWindow').className='';var scrollLeft=document.body.scrollLeft||document.documentElement.scrollLeft;var scrollTop=document.body.scrollTop||document.documentElement.scrollTop;document.getElementById('popWindow').style.left=scrollLeft+'px';document.getElementById('popWindow').style.top=scrollTop+'px';document.getElementById('popWindow').innerHTML='<table><tr><td><div id="popPic"><a href="javascript:HZMpopClose();" id="popClose">閉じる</a><a href="javascript:HZMpopClose();"><img src="'+img.src+'" alt="閉じる"></a></div></td></tr></table>';img.onload=function(){}};img.src=url;return false}}};
function HZMpopClose(){document.getElementById('popBack').style.display='none';document.getElementById('popWindow').style.display='none';document.getElementById('popWindow').innerHTML='';return};
function HZMopener(ini_id){if(document.getElementById(ini_id).style.display=='none'){document.getElementById(ini_id).style.display='block'}else{document.getElementById(ini_id).style.display='none'}};
window.onload=function(){HZMpopup()};
