var FC2CounterImgNode; FC2CounterHide(); function FC2CounterShow(e) { if (FC2CounterImgNode == null ) { FC2CounterImgNode = document.createElement('img'); FC2CounterImgNode.src = 'http://panel.counter1.fc2.com/popup.php?id=622731'; FC2CounterImgNode.style.position = 'absolute'; FC2CounterImgNode.style.margin = '0'; FC2CounterImgNode.style.padding = '0'; if ( document.body.firstChild ) document.body.insertBefore(FC2CounterImgNode, document.body.firstChild); else document.body.appendChild(FC2CounterImgNode); } FC2CounterImgNode.width = 260; FC2CounterImgNode.height = 130; FC2CounterImgNode.style.zIndex = 10000; var counterh=document.images.counter_image.height; //{$user['position']} var X,Y,L,T,W,H; if (document.all&&!window.opera) { // IE var csscompat=((document.compatMode||"").indexOf("CSS")!=-1); var b=(csscompat?document.documentElement:document.body); X = b.scrollLeft; Y = b.scrollTop; L = (e.clientX - e.offsetX - 2 + X); T = (e.clientY - e.offsetY - 2 + Y); W = b.clientWidth - 16; H = b.clientHeight - 16; } else { // NN, Firefox ,Opera X = window.pageXOffset; Y = window.pageYOffset; L = e.pageX; T = e.pageY; W = window.innerWidth - 16; H = window.innerHeight - 16; } T += counterh; if ( W > 0 && L + FC2CounterImgNode.width > X + W ) L = X + W - FC2CounterImgNode.width; if ( L < X ) L = X; if ( H > 0 && T + FC2CounterImgNode.height > Y + H ) T = Y + H - FC2CounterImgNode.height; if ( T < Y ) T = Y; FC2CounterImgNode.style.left = L + 'px'; FC2CounterImgNode.style.top = T + 'px'; } function FC2CounterHide(){ if (FC2CounterImgNode != null) { FC2CounterImgNode.width = 0; FC2CounterImgNode.height = 0; } } document.writeln('FC2無料カウンター');