function init(){}
function moveup(){}
function movedown(){}
function stop(){}
function resize(){}

// _bro: 1=NN6+, 2=NN4, 3=IE, 4=Opera, 0=others
_bro=(window.opera?4:(document.all?3:(document.getElementById?1:(document.layers?2:0))));
// _ie5: true=IE5+
_ie5=(navigator.appName.indexOf('Microsoft Internet Explorer')>=0 && document.getElementById)?true:false;
// _mac : true = macintosh, false = other os
_mac=navigator.userAgent.indexOf('Mac')>=0;

function getDivFromName(nm){
  if(document.getElementById) return document.getElementById(nm); 
  if(document.all) return document.all(nm); 
  if(document.layers){ 
    var s='';
    for(var i=1; i<arguments.length; i++)
      s+='document.layers.'+arguments[i]+'.';
    return eval(s+'document.layers.'+nm);
  }
  return null;
}
function getDivTop(div){
  if(typeof window.crypto!="undefined" &&
     typeof window.getComputedStyle!="undefined"){ 
    return parseInt(div.style.top);
  }
  else 
   return document.layers?div.top:(div.offsetTop||div.style.left||div.style.pixelTop||0);
}
function moveDivTo(div,left,top){
  if(document.layers){ div.moveTo(left,top); return; } 
  if(typeof div.style.left!="undefined"&& typeof div.style.left=="string"){ 
    div.style.left=left+'px';
    div.style.top =top +'px';
  }
  else if(typeof div.style.pixelLeft!="undefined"){ 
    div.style.pixelLeft=left;
    div.style.pixelTop =top;
  }
}
function moveDivBy(div,left,top){
  if(document.layers){ div.moveBy(left,top); return; } 
  if(typeof window.crypto!="undefined" &&
     typeof window.getComputedStyle!="undefined"){ 
    div.style.left=(parseInt(div.style.left)+Math.round(left))+'px';
    div.style.top =(parseInt(div.style.top) +Math.round(top) )+'px';
    return;
  } 
  if(typeof div.style.left!="undefined"&& typeof div.style.left=="string"){
    div.style.left=(div.offsetLeft+Math.round(left))+'px';
    div.style.top =(div.offsetTop +Math.round(top) )+'px';
    return; 
  }
  if(typeof div.style.pixelLeft!="undefined"){
    div.style.pixelLeft+=Math.round(left);
    div.style.pixelTop +=Math.round(top);
    return;
  }
}
function initDivSize(div){
  if(document.layers) return;
  if(typeof div.style.width!="undefined"&& typeof div.style.width=="string"){
   div.style.width =div.offsetWidth +'px';
   div.style.height=div.offsetHeight+'px';
  }
  else if(typeof div.style.pixelWidth!="undefined"){ 
   div.style.pixelWidth =div.offsetWidth;
   div.style.pixelHeight=div.offsetHeight;
  }
}
function getDivHeight(div){
  return document.layers?
         div.clip.height:(div.offsetHeight||div.style.pixelHeight||0);
}
function setDivVisibility(div,visible){
  (div.style||div).visibility=(visible)?
   ((window.opera && !document.documentElement)?'visible':'inherit'):'hidden';
}

function ScrollWindow(div,d){
  this.div=div; 
  initDivSize(div);
  this.h=getDivHeight(div);
  this.d=d;
  return this;
}  
ScrollWindow.prototype.scllUp = function(){ 
  var div=this.div;
  this.dx=0; this.dy=-this.d;
  if(getDivTop(div)>(Math.abs(this.dy)-(this.h-(wh-bw)))){
    moveDivBy(div,this.dx,this.dy);
    return false;
  }else{
    moveDivTo(div,bw,-(this.h-(wh-bw)));
    return true;  
  }
}
ScrollWindow.prototype.scllDown = function(){
  var div=this.div;
  this.dx=0; this.dy=this.d;
  if(getDivTop(div)<(bw-this.dy)){
    moveDivBy(div,this.dx,this.dy);
    return false;
  }else{
    moveDivTo(div,bw,bw);
    return true;  
  }
}
tid=null;
interval = 20; 
function moveup(){
  if(scll[sN]){
   scll[sN].scllUp();
   tid=setTimeout('moveup()',interval);      
  }  
  return false;
}
function movedown(){
  if(scll[sN]){
   scll[sN].scllDown();
   tid=setTimeout('movedown()',interval);
  }
 return false;
}

function showPage(num){
 setDivVisibility(pageDiv[sN],false); 
 setDivVisibility(pageDiv[num],true);
 moveDivTo(pageDiv[sN],bw,bw);
 sN = num;
}
function stop(){
  if(tid){ clearTimeout(tid); tid=null; } 
  return false;
}

wh = 0;
bw = 1;
pgN = 3;
sN = 0;
var winDiv=null;
var pageDiv = new Array();
var scll = new Array();
function scrollInit(){
  //if(document.layers) getDivFromName('cover').document.sPage.pages.selectedIndex = 0;
  //else document.sPage.pages.selectedIndex = 0;
  winDiv=getDivFromName('news');
  initDivSize(winDiv);
  wh = getDivHeight(winDiv);
  for(var i=0; i<pgN; i++){
    pageDiv[i]=getDivFromName('p'+i,'news'); 
    var div=pageDiv[i];
    moveDivTo(div,bw,bw);
    scll[i]=new ScrollWindow(div,3);
  }  
  setDivVisibility(pageDiv[sN],true);  
}
function resize(e){
 location.reload();
}