/* ======================================================================== << Library for cross browser >> JavaScript Library for Netscape Navigator 4.0+ and Internet Explorer 4.0+ Author : Shinichi Hagiwara Type : library - free software History: 1.0 : 10/18/1998 original 1.1 : 08/15/2000 remake for my book 2.0 : 05/13/2001 add procedure for NN6 2.1 : 05/20/2001 add the functions getLeftFromEvent,getTopFromEvent 2.2 : 05/27/2001 update the functions getLeftFromEvent,getTopFromEvent 2.3 : 06/03/2001 update the functions initDivPos,initDivSize 2.4 : 07/08/2001 update the functions external sourced layer for NN6( buggy :-D ) update the function createLayer, add the function getDivForm 2.5 : 07/15/2001 add the function setDivVisibilities 2.6 : 08/26/2001 add the function setDivStyleAttribute 2.7 : 10/21/2001 update the functions. setDivBackgroundColor,setDivBackgroundImage 2.8 : 03/24/2002 support IE5.12(on mac OSX. but, buggy) Copyright(C) 1998 - 2002 ShinSoft. All rights reserved. ________________________________________________________________________ */ /* ===================================================================== * 以下の変数はブラウザの識別及び関数の互換をとるためのものです。 * もし、このファイルを外部ソース( SCRIPT タグ内の src属性 )で使用する * 場合は、以下の変数を HTML 本体の SCRIPT タグ内に移動して使用してください。 * ( 外部ソース内で直接定義した変数値は NN4 では実行されない場合があります ) ________________________________________________________________________ */ // variables // version of library LCB_version = 2.8; // _mac : true = macintosh, false = other os _mac=navigator.userAgent.indexOf('Mac')!=-1; // _ie512 : true = MSIE 5.12(mac), false = others _ie512=navigator.userAgent.indexOf('MSIE 5.12')!=-1; // _dom : kind of DOM. // IE4 = 1, IE5+ = 2, NN4 = 3, NN6+ = 4, others = 0 _dom = document.all?(document.getElementById?2:1) :(document.getElementById?4:(document.layers?3:0)); _createLayerNo = 0; // layer no. /* ====================================================================== *このスクリプトを外部ソースとして使用する場合は以下の関数を有効にして * 使用する最初に onLoad イベントでこの関数を呼び出して初期化して下さい */ function initCrossBrowserLib(){ _mac=navigator.userAgent.indexOf('Mac')!=-1; _ie512=navigator.userAgent.indexOf('MSIE 5.12')!=-1; _dom=document.all?(document.getElementById?2:1) :(document.getElementById?4:(document.layers?3:0)); _createLayerNo=0; } initCrossBrowserLib(); /* _____________________________________________________________________ */ function getWindowWidth (){ if(_dom==4 || _dom==3) return window.innerWidth; if(_dom==2 || _dom==1) return document.body.clientWidth; return 0; } function getWindowHeight(){ if(_dom==4 || _dom==3) return window.innerHeight; if(_dom==2 || _dom==1) return document.body.clientHeight; return 0; } function getWinXOffset(){ if(_dom==4) return window.scrollX; if(_dom==2 || _dom==1) return document.body.scrollLeft; if(_dom==3) return window.pageXOffset; return 0; } function getWinYOffset(){ if(_dom==4) return window.scrollY; if(_dom==2 || _dom==1) return document.body.scrollTop; if(_dom==3) return window.pageYOffset; return 0; } function getDivFromName(nm){ if(_dom==4 || _dom==2) return document.getElementById(nm); if(_dom==1) return document.all(nm); if(_dom==3){ var s=''; for(var i=1; i5){ for(var i=5; i0?(';width:' +width ):'') +(height>0?(';height:'+height):'') +';visibility:hidden'); var range=document.createRange(); range.selectNodeContents(div); range.collapse(true); var cf=range.createContextualFragment(s); div.appendChild(cf); pDiv.appendChild(div); return div; } if(_dom==2 || _dom==1){ var adj =(_mac&&!_ie512)?' ':''; var divName= '_js_layer_'+_createLayerNo; _createLayerNo++; var ha =(height>0)?(';height:'+height):''; var pDiv =parentDiv?parentDiv:document.body; pDiv.insertAdjacentHTML('BeforeEnd', '