// イベントハンドラ:onMouseover // 外部関数:addAnchor,getDTfromAnc // 特徴:DIV#popupBase下に「フラットでリニア」にDL#p\dを作成する。 //==========CSSの出力 var nCSS='' nCSS+='#popupBase{font-size:90%;}'; //フォントサイズの指定 nCSS+='#popupBase{position:absolute;width:100%;height:100%;z-index:7}'; nCSS+='#popupBase dl{position:absolute; background-color:window; border:outset 1px infobackground; overflow-y:auto; z-index:5; border-top:none;}'; nCSS+='#popupBase dt span{float:none; margin-left:1em;}'; nCSS+='#popupBase dd{margin:auto 1em}'; document.write('\n'); //=========グローバル変数 var pb; //=========ナンバーな名前のポップアップ function namePopup(e,before,num,after){ var hnum=tohan(num); //3周年、4周年、Socket774、774KB、21禁、[1-30]、などに対応 if(before){if(hnum==5 || hnum==774 || hnum==4 || hnum==21 || hnum==1 || hnum==30){return}} e.outerHTML = ""+before+""+addAnchor(hnum,num)+""+after+""; } //=========弱あぼ〜んのポップアップ function abonePopup(e){ var hnum=e.parentElement.previousSibling.innerText; e.outerHTML = ""+addAnchor(hnum,'あぼ〜ん')+""; } //=========多段ポップアップ //・ポップアップの作成 var startRes; function makePopContent(obj){ //事前準備 var num=obj.innerText.replace(/[>>]/g,""); var number=tohan(num); if(!obj.rel){obj.rel=obj.href;} obj.href="decoy:"; //調査 if(document.anchors.length==1){return} //レス数が1なら終了 if(!startRes){startRes=parseInt(document.anchors[1].name.replace(/\D/g,""))} if(number.match(/(\d*)\D+(\d*)/)){var start=parseInt(RegExp.$1); var end=parseInt(RegExp.$2);} else {var start=end=parseInt(number);} // alert(startRes+">"+end+" && "+end+"!=1") if(startRes>end && end!=1){obj.href=obj.rel;return}//存在していなければ終了 //中身の切り出し var targetString=""; if(end-start>100){end=start+100} if(start==end){targetString=returnString(start)} else {for(var i=0;i<=end-start;i++){targetString+=returnString(start+i)}} //対象が存在したらrelに退避してポップアップ if(targetString){popup(targetString);}else{obj.href=obj.rel;} } //・中身の切り出し function returnString(num){ var obj=getDTfromAnc(num); if(!obj){return("")} //対象が透明あぼ〜んなら終了 var dt,dd,dtOuter,ddOuter; dt=obj.cloneNode(true); dtOuter=dt.outerHTML.replace(/name=.*?>/,">"); // LABELNUMBER対応のものに係るリンクアンカーの除去 dd=obj.nextSibling.cloneNode(true); if(dd.hasChildNodes()){ while(dd.lastChild.name){dd.lastChild.removeNode(true)} // LABELNUMBER非対応のものに係るリンクアンカーの除去 if(dd.lastChild.tagName=="DL"){dd.lastChild.removeNode(true)} // 逆参照の除去 } ddOuter=dd.outerHTML; return(dtOuter+ddOuter); } //・ポップアップ function popup(inner){ if(!pb){document.body.insertAdjacentHTML('afterBegin','
');pb=document.getElementById("popupBase")} //要素の作成 var aNum,parent=event.srcElement.parentElement; if(parent.tagName!="DD"){aNum=parent.sourceIndex;} else{aNum=parent.previousSibling.firstChild.innerText;} if(document.getElementById('p'+aNum)){return} // ポップアップしてたら終了 pb.insertAdjacentHTML("beforeEnd",'
'+inner+'
'); //要素の配置 var p=document.getElementById('p'+aNum); // y軸調整 var pos=Math.min(event.y,document.body.clientHeight-event.y); var scTop=document.body.scrollTop+event.y; if(pos==event.y){var y=scTop-30;} // 下 else {var y=scTop+10-p.clientHeight;} // 上 if(y<0){y=0} if(event.srcElement.parentElement.id=="foundResult"){y+=30} p.style.pixelTop=y-6; // x軸調整 var pos=Math.min(event.x,document.body.clientWidth-event.x); var scLeft=document.body.scrollLeft+event.x; if(pos==event.x){var x=scLeft-2} // 右 else {var x=scLeft-4-p.clientWidth;} // 左 if(x<0){x=0} p.style.pixelLeft=x-6; // 高さ調整(scrollBarを要す場合と要しない場合がある)→y軸調整 if(p.clientHeight>Math.max(event.y,document.body.clientHeight-event.y)){ if(p.clientHeight>document.body.clientHeight){p.style.pixelHeight=document.body.clientHeight-2;} p.style.pixelTop=document.body.scrollTop; } } //・ポップアップ消去 function removePopup(popid){ if(pb){while(pb.lastChild){pb.lastChild.removeNode(true)}} } //数値変換(to半角) function tohan(num){ var zen="0123456789"; var han="0123456789"; var hnum=""; if(zen.indexOf(num.charAt(0))!=-1){ for(var i=0;i