
	if (document.layers) var ns4 = 1;
else if (document.all) var ie4 = 1;
else if (document.getElementById) var w3c = 1;

var range = "";                     //object range
var cap = "";                       //end cap (NS6 only)
var numScroll = 1;                  //number of scrollers on the page.
var prevPage = "";                  //name of initial div loaded (if any)
//var inNav = false;
//var minX = 0;
//var minY = 0;  
//var maxX = 0;
//var maxY = 0;
//var mutex = "";
//var currentPage = "";
//if (ns4) document.captureEvents(Event.MOUSEMOVE);
//document.onmousemove = divRollover;


mutex = new Array(numScroll);
for (m=0; m<=numScroll-1; m++) { 
mutex[m] = 0; }

var yplace = new Array(numScroll);
for (m=0; m<=numScroll-1; m++) { 
yplace[m] = 0; }

var ymax = new Array(numScroll);
for (m=0; m<=numScroll-1; m++) { 
ymax[m] = 0; }

var ymin = new Array(numScroll);
for (m=0; m<=numScroll-1; m++) { 
ymin[m] = 0; }

var xplace = new Array(numScroll);
for (m=0; m<=numScroll-1; m++) { 
xplace[m] = 0; }

var newsHeight = new Array(numScroll);
for (m=0; m<=numScroll-1; m++) { 
newsHeight[m] = 0; }

var speed = new Array(numScroll);
for (m=0; m<=numScroll-1; m++) { 
speed[m] = 2; }

var newsId = new Array(numScroll);
for (m=0; m<=numScroll-1; m++) { 
newsId[m] = "articles" + m; }

var newsClipId = new Array(numScroll);
for (m=0; m<=numScroll-1; m++) { 
newsClipId[m] = "articleClipping" + m; }


//Functions
function redrawScreen() {
  location.reload();
  return false
}

function getObject(obj) {
	var theObj = eval("document." + range + obj + cap);
	return theObj;
} 

function shiftTo(obj, x, y) {
  if (w3c) {
    obj.style.left = x + "px";
    obj.style.top = y + "px";
  }
  else if (ns4) {
	 obj.moveTo(x,y);
  } 
  else if (ie4) {
    obj.style.pixelLeft = x;
	  obj.style.pixelTop = y;
  }
}

function scrollUp(m) {
if (mutex[m] == 1){
  var theObj = getObject(newsId[m]);
  if (yplace[m] < ymax[m]) {
    yplace[m] = yplace[m] + speed[m];
    if (yplace[m] > ymax[m]) yplace[m] = ymax[m];
    shiftTo(theObj, xplace[m], yplace[m]);
    setTimeout("scrollUp(" + m + ")",15);
  }
}
}
  
function scrollDown(m) {
	if (mutex[m] == 2){
	  var theObj = getObject(newsId[m]);
	  if (yplace[m] > ymin[m]) {
	    yplace[m] = yplace[m] - speed[m];
	    if (yplace[m] < ymin[m]) yplace[m] = ymin[m];
	    shiftTo(theObj, xplace[m], yplace[m]);
	    setTimeout("scrollDown(" + m + ")",15);
	  }
	}
}

function scrollIt(msg, dir, m) {
  window.status = msg; 
  mutex[m] = dir;
  if (mutex[m] == 1) scrollUp(m);
  else if (mutex[m] == 2) scrollDown(m);
}
/*
function divRollover(evt) {
	if (ns4 || w3c) {
	  var x=evt.pageX;
	  var y=evt.pageY;
	} else if (ie4) {
	  var x=window.event.clientX;
	  var y=window.event.clientY;
    }
  if (x>minX && x<maxX && y>minY && y<maxY) {
		inNav=true;
		return;
	}
  //if ((x<minX || x>maxX || y<minY || y>maxY) && (inNav==true)) {
   if ((x<minX || x>maxX || y<minY || y>maxY) && (currentPage!="")) {
      inNav=false;
	  hideObject(currentPage);
	  minX=0; minY=0; maxX=0; maxY=0;
	  currentPage="";
	  return;
   }
	
}
*/
function init() {
	if (w3c) {
	  range = "getElementById(\"";
	  cap = "\")";
    for (m=0; m<=numScroll-1; m++) { 
  	  theObj = getObject(newsClipId[m]);
  	  newsHeight[m] = parseInt(theObj.offsetHeight);
  	  theObj = getObject(newsId[m]);
  	  ymin[m] = (parseInt(theObj.offsetHeight) - newsHeight[m]) * -1;
    }
	}
	else if (ns4) {
	  window.captureEvents(Event.RESIZE);
	  window.onresize = redrawScreen;
    for (m=0; m<=numScroll-1; m++) {
  	  theObj = getObject(newsClipId[m]);
  	  newsHeight[m] = theObj.clip.height;
  	  newsId[m] = newsClipId[m] + ".document." + newsId[m];
  	  theObj = getObject(newsId[m]);
  	  ymin[m] = (theObj.clip.height - newsHeight[m]) * -1;
    }
	}
	else if (ie4) {
	  range = "all.";
    for (m=0; m<=numScroll-1; m++) {
  	  theObj = getObject(newsClipId[m]);
  	  newsHeight[m] = theObj.offsetHeight;
  	  theObj = getObject(newsId[m]);
  	  ymin[m] = (theObj.offsetHeight - newsHeight[m]) * -1;
    }
	}
}
	
