var swidth=0
var sheight=0
var sjump=1
var stimeout=50
var bgcolor="white"
var bordercolor="black"

var strings=new Array()
strings[0]='Replace with your scrolling news !!'

if (strings.length>1)
	i=1
else
	i=0

function start_news_scroller()
	{
	if (document.all)
		{
		ieslider1.style.top=sheight
		iemarquee(ieslider1)
		}
	else if (document.layers)
		{
//		document.ns4slider.document.ns4slider1.top=sheight
//		document.ns4slider.document.ns4slider1.visibility='show'
//		ns4marquee(document.ns4slider.document.ns4slider1)
		}
	else if (document.getElementById&&!document.all)
		{
		document.getElementById('ns6slider1').style.top=sheight
		ns6marquee(document.getElementById('ns6slider1'))
		}
	}

function initialise_news_scroller(swidtharg, sheightarg, sjumparg, stimeoutarg, bgcolorarg, bordercolorarg, stringsarg)
	{
  swidth = swidtharg;
  sheight = sheightarg;
  sjump = sjumparg;
  stimeout = stimeoutarg;
  bgcolor = bgcolorarg;
  bordercolor = bordercolorarg;
  strings[0] = stringsarg;
  i=0;

    if (document.all)
        {
        document.write('<div style="position:relative;overflow:hidden;width:'
            +swidth+';height:'+sheight+';clip:rect(0 '+swidth+' '+sheight
            +' 0);border:1 solid '+bordercolor+'; background-color:'+bgcolor+';" '
            +'onmouseover="sjump=0;" onmouseout="sjump='+sjump+'">')
            
        document.write('<div id="ieslider1" style="position:relative;width:'+swidth+';">')
                strings[0] = stringsarg + '<p>&nbsp;</p>';
               
        document.write(strings[0])
        document.write('</div></div>')
        }
    else if (document.layers)
        {
        alert("layers");
        
//                document.write(strings[0]);
        document.write('<span style="borderWidth:1; margin:0pt; borderColor:'+bordercolor+'; width:'
            +swidth+'; height:'+sheight+'; background:'+bgcolor+'">')
        document.write('<ilayer id="ns4slider" width="'+swidth+'" height="'+sheight+'">')
        document.write('<layer id="ns4slider1" width="'+swidth+'" height="'+sheight
            +'" onmouseover="sjump=0;" onmouseout="sjump='+sjump+'">')
        document.write(strings[0])
        document.write('</layer></ilayer></span>')
        }
    else if(document.getElementById&&!document.all)
        {
//                document.write(strings[0]);
        swidth -= 2;
        document.write('<div style="position:relative;overflow:hidden;width:'
            +swidth+';height:'+sheight+';clip:rect(0 '+swidth+' '+sheight
            +' 0);border:1px solid '+bordercolor+'; background-color:'+bgcolor+';" '
            +'onmouseover="sjump=0;" onmouseout="sjump='+sjump+'">')
        document.write('<div id="ns6slider1" style="position:relative;width:'+swidth+';">')
        document.write(strings[0])
        document.write('</div></div>')
        }
	}

function iemarquee(whichdiv)
    {
    iediv=eval(whichdiv)

    /* Scroll the div containing the text until bottom of the text disappears */    
    if (iediv.style.pixelTop>= iediv.offsetHeight*-1)
        {
                
        iediv.style.pixelTop-=sjump
        setTimeout("iemarquee(iediv)",stimeout)
        }
    else
        {
        
        /* This should reset the scroller */
        iediv.style.pixelTop=sheight

        if (i==strings.length-1)
            {
            i=0;
            }
        else
            {
            i++;
            }
            
        setTimeout("iemarquee(iediv)",stimeout)
        }
    }
	
function ns6marquee(whichdiv)
    {
    ns6div=eval(whichdiv)

    if (parseInt(ns6div.style.top)>= ns6div.offsetHeight*-1)
        {
        ns6div.style.top= parseInt(ns6div.style.top)-sjump
        setTimeout("ns6marquee(ns6div)",stimeout)
        }
    else
        {
        ns6div.style.top=sheight
        
        if (i==strings.length-1)
            i=0
        else
            i++

        setTimeout("ns6marquee(ns6div)",stimeout)
        }
    }

function ns4marqueeorig(whichlayer)
    {
    ns4layer=eval(whichlayer)
    if (ns4layer.top>0&&ns4layer.top<=sjump)
        {
        ns4layer.top=0
        setTimeout("ns4marquee(ns4layer)",100)
        }
    if (ns4layer.top>=sheight*-1)
        {
        ns4layer.top-=sjump
        setTimeout("ns4marquee(ns4layer)",100)
        }
    else
        {
        ns4layer.top=sheight
        ns4layer.document.write(strings[i])
        ns4layer.document.close()
        if (i==strings.length-1)
            i=0 
        else
            i++
        }
    }
    
function ns4marquee(whichlayer)
    {
    ns4layer=eval(whichlayer)
    if (ns4layer.top>0&&ns4layer.top<=sjump)
        {
        ns4layer.top=0
        setTimeout("ns4marquee(ns4layer)",stimeout)
        }
    if (ns4layer.top>=sheight*-1)
        {
        ns4layer.top-=sjump
        setTimeout("ns4marquee(ns4layer)",stimeout)
        }
    else
        {
        ns4layer.top=sheight
        ns4layer.document.write(strings[i])
        ns4layer.document.close()
        if (i==strings.length-1)
            i=0
        else
            i++
        }
    }

