  function resizeToWIN(width,height,oj){

    if(!arguments[2])oj=self

    oj.resizeTo(width,height)

    //--内寸取得
    if(window.opera||document.layers){       //n4 o6用
      var w = oj.innerWidth  
      var h = oj.innerHeight  
    } else if(document.all){                 //e用
      var w = oj.document.body.clientWidth 
      var h = oj.document.body.clientHeight
    } else if(document.getElementById){      //n6,n7,m1用
      var w = oj.innerWidth   
      var h = oj.innerHeight 
    }

    //resizeToの結果内寸が 正しければ、そのまま。
    //                     違うなら、差分を加算。
    if(width!=w||height!=h){
      oj.resizeBy((width-w),(height-h))
      if(document.layers)
        oj.location.reload(0) //n4はreloadでresizeバグ回避 
    }
    oj.focus()               //フォーカスする
  }

  //サブウインドウ
  function popupCenter(url, name, width, height){

    //マウスの現在位置から何ピクセル離すかをセット
    var setx = (screen.width - width) / 2;
    var sety = (screen.height - height) / 2;

    //サブウインドウ開く(引数以外のパラメータも下記でセットできます)
    var para =""
             +" left="        +setx
             +",screenX="     +setx
             +",top="         +sety
             +",screenY="     +sety
             +",toolbar="     +0
             +",location="    +0
             +",directories=" +0
             +",status="      +0
             +",menubar="     +0
             +",scrollbars="  +0
             +",resizable="   +0
             +",innerWidth="  +width
             +",innerHeight=" +height
             +",width="       +width
             +",height="      +height

      helpwin=window.open(url, name, para)
      helpwin.focus()
  }

  //--ウインドウ有無確認関数
    function win_closed(winVar) {
 
      var ua = navigator.userAgent
      if( !!winVar )
          if( ( ua.indexOf('Gecko')!=-1 || ua.indexOf('MSIE 4')!=-1 )
               && ua.indexOf('Win')!=-1 ) 
               return winVar.closed
          else return typeof winVar.document  != 'object'
      else return true
    }