/**
 * Scroll Banner script
 * 
 * Include this file:
 * 	<script type="text/javascript" src="ScrollBanner.js" />
 * , and the section at the end of this file.
 */

//-- Begin Scroller's Parameters and messages -->

//scroller's width
var swidth=180;

//scroller's height
var sheight=125;

var sspeed=20;

//scroller's speed 
var sstep=1;
var restart=sstep;
var rspeed=sstep;

//scroller's pause 
var spause=2000;

//-- end Parameters and message -->


//-- begin: Scroller's Algorithm -->
var ii=0;

function Group()
{
	if(sstep!=rspeed*16)
	{
	    sstep = sstep*2;
	    restart = sstep;
	}
}

function StartScroll()
{
	if(document.getElementById)
	{
	   ns6div=document.getElementById('iens6div');
	   ns6div.style.top = sheight+"px";
	   ns6div.innerHTML = array[0] + '<br />';
	   sizeup=ns6div.offsetHeight - 1;
	   if(array.length >1)
	    {
            ns6div.innerHTML = array[0] + '<br />' + array[1];
	        ns6scroll();
	     }
	     else
	    {
            ns6div.innerHTML = array[0] + '<br />' + array[0];
	        ns6scroll();
	    }
	        
	}
	else if(document.layers)
	{
	    ns4layer=document.ns4div.document.ns4div1;
	    ns4layer.top=sheight;
	    ns4layer.document.write(array[0] + '<br />');
	    ns4layer.document.close();
	    sizeup=ns4layer.document.height;
	    if(array.length >1)
	    {
	        ns4layer.document.write(array[0] + '<br />' + array[1]);
	        ns4scroll();
	    }
	    else    
	     {   
	        ns4layer.document.write(array[0] + '<br />' + array[0]);
	        ns4scroll();
	     
	     }   
	}
	else if(document.all)
	{
	    iediv=iens6div;
	    iediv.style.pixelTop = sheight+"px";
	    iediv.innerHTML = array[0] + '<br />';
	    sizeup=iediv.offsetHeight;
	    if(array.length >1)
	    {
	        iediv.innerHTML = array[0] + '<br />' + array[1];
	        iescroll();
	    }
	    else
	    {
	        iediv.innerHTML = array[0] + '<br />' + array[0];
	        iescroll();
	    }    
	}
}

function iescroll()
{
	if(iediv.style.pixelTop>0&&iediv.style.pixelTop<=sstep)
	{
	    iediv.style.pixelTop=0;
	    //setTimeout("iescroll()",spause);
	    iescroll();
	}
	else if(iediv.style.pixelTop>=sizeup*-1)
	{
	    iediv.style.pixelTop-=sstep+"px";
	    setTimeout("iescroll()",sspeed);
	}
	else
	{
	    ii = (ii+1) % array.length;
	    iediv.style.pixelTop=sheight+"px";
	    iediv.innerHTML=array[ii] + '<br />';
	    sizeup=iediv.offsetHeight;
	    iediv.innerHTML=array[ii] + '<br />' + array[(ii+1) % array.length];
	    iescroll();
}
}

function ns4scroll()
{
	if(ns4layer.top>0&&ns4layer.top<=sstep)
	{
	    ns4layer.top=0;
	    //setTimeout("ns4scroll()",spause);
	    ns4scroll();
	}
	else if(ns4layer.top>=sizeup*-1)
	{
	    ns4layer.top-=sstep;setTimeout("ns4scroll()",sspeed);
	    ns4scroll();
	}
	else
	{
	    ii = (ii+1) % array.length;
	    ns4layer.top=sheight;
	    ns4layer.document.write(array[ii]);
	    ns4layer.document.close();
	    sizeup=ns4layer.document.height;
	    ns4layer.document.write(array[ii] + '<br />' + array[(ii+1) % array.length]);
	    ns4scroll();
	}
}

function ns6scroll()
{
    if(parseInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=sstep)
    {
	    ns6div.style.top=0;
	    //setTimeout("ns6scroll()",spause);
	    ns6scroll();
    }
	else if(parseInt(ns6div.style.top) >= sizeup*-1)
    {
	    ns6div.style.top=parseInt(ns6div.style.top)-sstep+"px";
	    setTimeout("ns6scroll()",sspeed);
    }
    else
    {
	    //set the next index
	    ii = (ii+1) % array.length;
	    ns6div.style.top=sheight+"px";
	    ns6div.innerHTML = array[ii] + '<br />';
	    sizeup=ns6div.offsetHeight - 1;
	    ns6div.innerHTML = array[ii] + '<br />' + array[(ii+1) % array.length];
	    ns6div.style.top = 0;
	    //setTimeout("ns6scroll()",spause);
	    ns6scroll();
    }
}
//-- end Algorithm -->

/*
Add this section to some place in html file

<script type="text/javascript">
	if(document.layers)
	{
		document.write('<ilayer id="ns4div" width="'+swidth+'" height="'+sheight+'" bgcolor=transparent><layer id="ns4div1" width="'+swidth+'" height="'+sheight+'" onmouseover="sstep=0;" onmouseout="sstep=rspeed"></layer></ilayer>')
	}
	if(document.getElementById||document.all)
	{
		document.write('<div style="margin-left:8px;position:relative;overflow:hidden;width:'+swidth+'px;height:'+sheight+'px;background-color:transparent;" onmouseover="sstep=0" onmouseout="sstep=rspeed"><div id="iens6div" style="position:relative;width:'+swidth+'px;"></div></div>');
	}
</script>
*/