// begin absolutely positioned scrollable area object scripts 
/*
Extension developed by David G. Miles (www.z3roadster.net/dreamweaver)
Original Scrollable Area code developed by Thomas Brattli 
To add more shock to your site, visit www.DHTML Shock.com
*/

function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
bw=new verifyCompatibleBrowser() 
 
 
var speed=100 
 
var loop, timer 
 
function ConstructObject(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp;this.down=MoveAreaDown; 
    this.MoveArea=MoveArea; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
} 
 
function MoveAreaDown(move){ 
	if(this.y>-this.scrollHeight+objContainer.clipHeight){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+")",speed) 
	} 
} 
function MoveAreaUp(move){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",speed) 
	} 
} 
 
function PerformScroll(speed){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller.down(speed) 
		else objScroller.up(speed) 
	} 
} 
 
function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 
var initialised; 
function InitialiseScrollableArea(){ 
    objContainer=new ConstructObject('divContainer') 
    objScroller=new ConstructObject('divContent','divContainer') 
    objScroller.MoveArea(0,0) 
    objContainer.css.visibility='visible' 
    initialised=true; 
} 
// end absolutely positioned scrollable area object scripts 

function popJumpSW(selOBJ)
{top.z2.location.href = selOBJ.options[selOBJ.selectedIndex].value;}

function opwin(url,name){window.open(url,name,'width=300px,height=380px,scrollbars=no,location=no,menubar=no,toolbar=no');
}
function opwin0(url,name){window.open(url,name,'width=365px,height=350px,scrollbars=no,location=no,menubar=no,toolbar=no');
}
function selLink(form,sel){selurl=sel.options[sel.selectedIndex].value;
    if (selurl != "" )parent.z_2.location.href=selurl;
}
function about(){window.open('ura.html','about','status=yes,scrollbars=no,toolbar=no,width=750px,height=480px');}
function op2(url,name,w,h){window.open(url,name,'width='+w+',height='+h+',scrollbars=no,location=no,menubar=no,toolbar=no');
}
function op3(url,name,w,h){window.open(url,name,'width='+w+',height='+h+',scrollbars=yes,location=no,menubar=no,toolbar=no');
}
function tw(){window.open("tw/tw.html","","width=400,height=320,scrollbars=no");}
function spn(){window.open("saipan/spn.html","","width=540,height=360,scrollbars=yes");}
function m_w(url){window.open(url,'main','width=750px,height=480px,scrollbars=yes,location=no,menubar=no,toolbar=no');
}
function bbs(){window.open("http://rgb-cats.com/bbs_m/bbs200.cgi","","scrollbars=1,width=800px,height=400px");}
function htpk(){window.open("http://rgb-cats.com/bbs_p/clever.cgi","htkt","scrollbars=0,width=800px,height=480px");}
function pbbs(){window.open("http://rgb-cats.com/pbbs/clever.cgi","05pbs","scrollbars=0,width=500px,height=500px");}

function changeIFrame(jumpURL)
{
	mainFrm.location.href = jumpURL;
}



  /*/////////////////////  レイヤ−位置固定用関数  UseFree
  ========================================================
  

  Support http://game.gr.jp/js/
  ======================================================*/

  function startFixed(){

    /*このstartFixed()関数内へ固定したいレイヤー名などを
      引数へ書いたfixedLAYER()関数をならべてください。  */

      fixedLAYER('fixedLay0','leftTop','100','50')

 }


  /* -- ここから下はさわらなくてもOK -- */

  var ie= !!document.all
  var n4= !!document.layers
  var w3c=!!document.getElementById
  var mac45 
    = navigator.userAgent.indexOf('MSIE 4.5; Mac_PowerPC')

  if(document.layers)window.onresize=resizeFunc
  function resizeFunc(e){location.reload()}

  function iniFunc(){
    if(ie&&!(mac45!=-1))window.onscroll = startFixed
   
  }

  var tid=new Array()

  function fixedLAYER(layName,posString,offSetX,offSetY){

    offSetX = parseInt(offSetX,10)
    offSetY = parseInt(offSetY,10)

    if( posString == 'rightTop' ){
     
      if(ie) offLeft = document.body.clientWidth   + offSetX
      else   offLeft = window.innerWidth           + offSetX
      if(ie) offTop  =                               offSetY
      else   offTop  =                               offSetY

    }
    else if( posString == 'rightBottom' ){

      if(ie) offLeft = document.body.clientWidth   + offSetX
      else   offLeft = window.innerWidth           + offSetX
      if(ie) offTop  = document.body.clientHeight  + offSetY
      else   offTop  = window.innerHeight          + offSetY

    }
    else if( posString == 'leftBottom' ){

      if(ie) offLeft =                               offSetX
      else   offLeft =                               offSetX
      if(ie) offTop  = document.body.clientHeight  + offSetY
      else   offTop  = window.innerHeight          + offSetY

    }
    else if( posString == 'center' ){

      if(ie) offLeft = document.body.clientWidth/2 + offSetX
      else   offLeft = window.innerWidth/2         + offSetX
      if(ie) offTop  = document.body.clientHeight/2+ offSetY
      else   offTop  = window.innerHeight/2        + offSetY

    }
    else {

      if(ie) offLeft =                               offSetX
      else   offLeft =                               offSetX
      if(ie) offTop  =                               offSetY
      else   offTop  =                               offSetY

    }

    offLeft = parseInt(offLeft)
    offTop  = parseInt(offTop)

    if(document.all){
      var mx = parseInt(document.body.scrollLeft +offLeft)
      var my = parseInt(document.body.scrollTop  +offTop)
    } else {
      var mx = parseInt(self.pageXOffset+offLeft)
      var my = parseInt(self.pageYOffset+offTop)

    }

    moveLAYER(layName,mx,my)

    //WinIE以外 opera n4用
    if(!(ie&&!mac45) || opr){
      clearTimeout(fixedLAYER[layName])
      fixedLAYER[layName]=setTimeout("fixedLAYER('"+layName+"','"+posString
                   +"','" +offSetX+"','"+offSetY+"')",100)
    }
  }

  function moveLAYER(layName,x,y){
      
      if(document.getElementById){         //Moz,NN6,IE5用
        document.getElementById(layName).style.left=x
        document.getElementById(layName).style.top=y
      }
      else if(document.all){
        document.all(layName).style.pixelLeft=x    //IE4用
        document.all(layName).style.pixelTop=y
      }
      else if(document.layers)
        document.layers[layName].moveTo(x,y)
                                                   //NN4用
  }

  /*////////////// レイヤ−位置固定用指定用関数ここまで */
  function showLAYERoj(oj){
    if(!!oj) oj.visibility='visible'   //e4,e5,e6,n4,n6,n7,m1,o6,o7,s1用
  }
//--layNameで指定したオブジェクトを返す(必ずonload後に実行すること)
  function getLayStyleOj(layName){  
    if(document.getElementById)         //e5,e6,n6,n7,m1,o6,o7,s1用
      return document.getElementById(layName).style
    else if(document.all)               //e4用
      return document.all(layName).style
    else if(document.layers)            //n4用
      return document.layers[layName]
  }
