// JScript source code
var speed=8; // scroll speed (bigger = faster)
var dR=false; // reverse direction

// Vertical Scroller Javascript
// copyright 24th September 2005, by Stephen Chapman
// permission to use this Javascript on your web page is granted
// provided that all of the code below (as well as these
// comments) is used without any alteration
var step = 1; 
function objWidth(obj) {
    if(obj.offsetWidth) 
        return obj.offsetWidth; 
    if (obj.clip) 
        return obj.clip.width; 
     return 0;
} 

function objHeight(obj) {
    if(obj.offsetHeight) 
        return obj.offsetHeight;
    if (obj.clip) 
        return obj.clip.height; 
    return 0;
} 

function scrF(i,j,sH,eH){
    var x=parseInt(i.top)+(dR? step: -step); 
    if(dR && x>sH)
        x=0;
    else if(x<2-eH)
        x=0;
    i.top = x+'px';
    // set the sub divs top location. 
    j.top = x+eH+'px';
} 

function startScroll(sN,txt){
    var scr=document.getElementById(sN); 
    var sW = objWidth(scr)-6;
    var clipWidth = objWidth(scr) 
    var sH = objHeight(scr); 
    scr.innerHTML = '<div id="'+sN+'in" style="position:absolute; left:3px; width:'+sW+';text-align:justify; font-family:Tahoma; font-size:13px; color:#4e4e4e;font-weight:normal;">'+txt+'<\/div>'; 
    //add in another sub div with content
  //  var sw1 = sW -10;
    scr.innerHTML += '<div id="'+sN+'in1" style="position:absolute; left:3px; width:'+sW+';text-align:justify; font-family:Tahoma; font-size:13px; color:#4e4e4e;font-weight:normal">'+txt+'<\/div>'; 
    var sTxt=document.getElementById(sN+'in'); 
    var sTxt1=document.getElementById(sN+'in1'); 
    var eH=objHeight(sTxt); 
    sTxt.style.top=(dR? 0 : 0)+'px'; 
    sTxt.style.clip='rect(0,'+clipWidth+'px,'+eH+'px,0)'; 
    // set extra sub div's top to just below/above the original sub div. 
    sTxt1.style.top= (dR? -eH : eH)+'px'; 
    sTxt1.style.clip='rect(0,'+clipWidth+'px,'+eH+'px,0)'; 
    setInterval(function() {scrF(sTxt.style,sTxt1.style,sH,eH);},1000/speed);
}

       
       
