
// ASM SCROLLER 2.0 - (c) 2000 Brent Gustafson, vitaflo.com and assembler.org
//
// Feel free to hack around with this code for personal use, it's open source
// so do what ya want w/ it.  Though a link would be nice. ;)  While this code
// doesn't have a ton of documentation, please remember that I am a busy man,
// so support of this code will be very minimal.  Use at your own risk.
//
// Follow me into a solo, get in the FLO
// And you can picture like a photo
// Music mixed mellow maintains to make 
// Melodies for MC's motivates the breaks 
// I'm everlasting, I can go on for days and days 
// With rhyme displays that engrave deep as X-rays
//
// -Brent (brent@assembler.org)
// assembler.org || vitaflo.com

var w3c = (document.getElementById) ? 1:0
var ns4 = (document.layers) ? 1:0
var ie4 = (document.all) ? 1:0

var range_right = "";
var cap_right = "";
var mutex_right = 0;
var yplace_right = 0;
var ymax_right = 0;
var ymin_right = 0;
var xplace_right = 0;
var newsHeight_right = 0;

/** The only code you should ever need to change here are the following 3 vars **/
var speed = 3;                         //speed at which the news scrolls
var newsId_right = "news_right";                   //name of the overall news div
var newsClipId_right = "newsClipping_right";       //name of the news clipping div

function set_yplace () {

yplace_right = 0;
var theObj_right = getObject_right(newsId_right);
shiftTo(theObj_right, 0, 0);

}

function redrawScreen() {
  location.reload();
  return false
}

function shiftTo(obj_right, x, y) {
  if (w3c) {
    obj_right.style.left = x + "px";
    obj_right.style.top = y + "px";
  }
  else if (ns4) {
	 obj_right.moveTo(x,y);
  } 
  else if (ie4) {
    obj_right.style.pixelLeft = x;
	obj_right.style.pixelTop = y;
  }
}

function getObject_right(obj_right) {
	var theObj_right = eval("document." + range_right + obj_right + cap_right);
	return theObj_right;
} 

function scrollUp_right() {
  if (mutex_right == 1){
    var theObj_right = getObject_right(newsId_right);
    if (yplace_right < ymax_right) {
      yplace_right = yplace_right + speed;
      if (yplace_right > ymax_right) yplace_right = ymax_right;
      shiftTo(theObj_right, xplace_right, yplace_right);
      setTimeout("scrollUp_right()",25);
    }
  }
}
  
function scrollDown_right() {

  if (mutex_right == 2){
    var theObj_right = getObject_right(newsId_right);
    if (yplace_right > ymin_right) {
      yplace_right = yplace_right - speed;
      if (yplace_right < ymin_right) yplace_right = ymin_right;
      shiftTo(theObj_right, xplace_right, yplace_right);
      setTimeout("scrollDown_right()",25);


    }
  }
}

function scrollIt_right(msg, dir) {
  window.status = msg; 
  mutex_right = dir;
  if (mutex_right == 1) scrollUp_right();
  else if (mutex_right == 2) scrollDown_right();
}

function init_right() {
  if (w3c) {
    range_right = "getElementById(\"";
    cap_right = "\")";
    theObj_right = getObject_right(newsClipId_right);
    newsHeight_right = parseInt(theObj_right.offsetHeight);
    theObj_right = getObject_right(newsId_right);
    ymin_right = (parseInt(theObj_right.offsetHeight) - newsHeight_right) * -1;
  }
  else if (ns4) {
    window.captureEvents(Event.RESIZE);
    window.onresize = redrawScreen;
    theObj_right = getObject_right(newsClipId_right);
    newsHeight_right = theObj_right.clip.height;
    newsId_right = newsClipId_right + ".document." + newsId_right;
    theObj_right = getObject_right(newsId_right);
    ymin_right = (theObj_right.clip.height - newsHeight_right) * -1;
  }
  else if (ie4) {
    range_right = "all.";
    theObj_right = getObject_right(newsClipId_right);
    newsHeight_right = theObj_right.offsetHeight;
    theObj_right = getObject_right(newsId_right);
    ymin_right = (theObj_right.offsetHeight - newsHeight_right) * -1;
  }
}

// END OF LINE



// BEGIN LAYER ON/OFF FUNCTIONS


window.onerror = null;

var netscape = 0;

var goodIE = 0;

browserName = navigator.appName.substring(0,8);

browserVer = parseFloat(navigator.appVersion);

if (browserName == "Netscape" && browserVer >= 3)

{ netscape = 1; }

if (browserName == "Microsof" && browserVer >= 4)

{ goodIE = 1; }

// end error trapping code





function layer_on_off (layerID, status) {

if (netscape || goodIE) {

        layer = document.getElementById(layerID);
        layer.style.visibility = status;


}}

function change_pic_button (buttonID, newpicture) {

if (netscape || goodIE) {

        typeimage = document.getElementById(buttonID);
      //  alert(typeimage.src);
        typeimage.src = newpicture;


}}








