
// Distributed by http://www.hypergurl.com

// Scrollers width here (in pixels)
var scrollerwidth="490px"
var initposx = "50px";
var initposy = "50";
// Scrollers height here
var scrollerheight="350px"
var sinusit = 0;
// Scrollers speed here (larger is faster 1-10)
var scrollerspeed=10

var frame = 0, frame2 = 0;
var amplitude1 = 2, amplitude2 = 0.025;
var offset = 0.02;
var offset2 = 0.3;
var twopi = Math.PI * 2;
var angle;
var angle2;
// Scrollers content goes here! Keep all of the message on the same line!


var scrollercontent='<div align="left"><font size="3" face="Arial, Helvetica, sans-serif"><strong>JULIOL   2008 </strong></font><font face="Arial, Helvetica, sans-serif">   <p><strong><font size="3"><br>    4, divendres, a les 22 h.<br>    </font></strong><font size="3">Pollen&ccedil;a, Claustre de Santo Domingo</font></p>  <p><font size="3"><strong>10, dijous, a les 22 h.<br>    </strong>Castell de Bellver<br>    XIII Festival de M&uacute;sica Castell de Bellver</font></p>  <p><font size="3"><strong>17, dijous, a les 22 h.<br>    </strong>Castell de Bellver<br>    XIII Festival de M&uacute;sica Castell de Bellver</font></p>  <p><font size="3"><strong>24, dijous, a les 22 h.<br>    </strong>Castell de Bellver<br>    XIII Festival de M&uacute;sica Castell de Bellver</font></p>  <p><font size="3"><strong>31, dijous, a les 22 h.<br>    </strong>Castell de Bellver<br>    XIII Festival de M&uacute;sica Castell de Bellver<br>  </font></p>  </font><left> </div>';

var pauseit=0;

var startit = 0;

// Change nothing below!

scrollerspeed=(document.all)? scrollerspeed : Math.max(1, scrollerspeed-1) //slow speed down by 1 for NS
var copyspeed=scrollerspeed
var iedom=document.all||document.getElementById
var actualheight=''
var cross_scroller, ns_scroller
var pausespeed=(pauseit==1)? copyspeed: 0
var direction = -1;

function uppressed(){
	startit = 1;
	direction = -1;
}

function upout(){
	startit = 0;
}

function downpressed(){
	startit = 1;
	direction = 1;
}

function downout(){
	startit = 0;
}

function populate(){
if (iedom){
cross_scroller=document.getElementById? document.getElementById("iescroller") : document.all.iescroller
cross_scroller.style.top= initposy;
cross_scroller.style.left= initposx;
cross_scroller.innerHTML=scrollercontent
actualheight=cross_scroller.offsetHeight
}
else if (document.layers){
ns_scroller=document.ns_scroller.document.ns_scroller2
ns_scroller.top=parseInt(scrollerheight)+8
ns_scroller.document.write(scrollercontent)
ns_scroller.document.close()
actualheight=ns_scroller.document.height
}
lefttime=setInterval("scrollscroller()",20)
}
window.onload=populate

function scrollscroller(){

		frame += offset;
		frame2 += offset2;
	if (frame > twopi) frame -= twopi;
	if (frame2 > twopi) frame2 -= twopi;
	
 	angle = frame;
	angle2 = frame2;
		

		
	if (iedom){

		if( (parseInt(cross_scroller.style.top)>(actualheight*(-1))) ){

//		characters[i].style.left = pos;		
//		characters[i].style.top = initialy + amplitude1 * Math.sin(angle) + amplitude2 * Math.sin(angle2);
//		angle += offset; 
//		angle2 += offset2;		
//			pos += charwidth;
		
		cross_scroller.style.top=parseInt(cross_scroller.style.top)+ direction * startit*(copyspeed)+"px";

//		cross_scroller.style.left=parseInt(cross_scroller.style.left);
		cross_scroller.style.left=parseInt(cross_scroller.style.left)+ sinusit*(startit*(1*(amplitude1 * Math.sin(angle)) + 1*(amplitude2 * Math.sin(angle2))))		
//		angle += offset;
//		angle2 += offset2;

		
		}else{
			if (parseInt(cross_scroller.style.top)<(actualheight*(-1)+8)){
				 cross_scroller.style.top=parseInt(scrollerheight)+8+"px"
			}
			if (parseInt(cross_scroller.style.left) > (scrollerwidth + 8) ){
				cross_scroller.style.left = initposx;
			}
		 }
	}else if (document.layers){
		if (ns_scroller.top>(actualheight*(-1)+8))	ns_scroller.top-=copyspeed;
		else ns_scroller.top=parseInt(scrollerheight)+8
	}
}



if (iedom||document.layers){
with (document){
if (iedom){
write('<div style="position:relative;width:'+scrollerwidth+';height:'+ scrollerheight +';overflow:hidden">')
write('<div id="iescroller" style="position:absolute;left:0px;top:0px;width:100%;">')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+scrollerwidth+' height='+scrollerheight+' name="ns_scroller">')
write('<layer name="ns_scroller2" width='+scrollerwidth+' height='+scrollerheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=scrollerspeed"></layer>')
write('</ilayer>')
}
}
}

