//////////////////////////////////////////////////////////////////////
/////             SCRIPT VARIABLES DECLARATION                ////////
//////////////////////////////////////////////////////////////////////

// don't touch 'em ! ;)
var currentline = 0;
var alpha;
var start;
var time;

//////////////////////////////////////////////////////////////////////
/////             END SCRIPT VARIABLES DECLARATION            ////////
//////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////
/////             SCRIPT CONSTANTS DECLARATION                ////////
//////////////////////////////////////////////////////////////////////

// the text scrolling speed
var speed = 80;
// period to wait before hiding the text
var wait  = 5000;

//////////////////////////
///    IE5+ OPTIONS    ///
//////////////////////////

// the text fading speed in IE5+
var fadingspeed = 30;

// text fading "smoothness"
var smoothness = 10;

//////////////////////////
///  END IE5+ OPTIONS  ///
//////////////////////////


////////////////////////////////////////
///      SCROLL TEXT DEFINITION      ///
////////////////////////////////////////

var line = new Array
	   (
	     "A court is in session, a verdict is in <br>"+
             "no appeal on the docket today <br>"+
             "just my own sin, <br>"+
             "the walls are cold and pale <br>"+
             "the cage made of steel <br>"+
             "screams fill the room, alone I drop and kneel",
                          
             "silence now the sound <br>"+
             "my breath the only motion around <br>"+
             "demons cluttering around <br>"+
             "my face showing no emotion <br>"+
             "shackled by my sentence, expecting no return <br>"+
             "here there is no penance, my skin begins to burn",
             
             "so I held my head up high <br>"+
             "hiding hate that burns inside <br>"+
             "which only fuels their selfish pride <br>"+
             "we're all held captive out from the sun <br>"+
             "a sun that shines on only some <br>"+
             "we the meek are all in one",
             
             "I hear a thunder in the distance <br>"+
             "see a vision of the cross <br>"+
             "I feel the pain that was given <br>"+
             "on that sad day of loss <br>"+
             "a lion roars in the darkness <br>"+
             "only he holds the key <br>"+
             "a light to free me from my burden <br>"+
             "and grant me life eternally",
             
             "should have been dead <br>"+
             "on a sunday morning <br>"+
             "banging my head, no time for mourning <br>"+
             "ain't got no time... <br>"+
             "I cry out to God, seeking only his decision <br>"+
             "Gabriel stands and confirms <br>"+
             "<br>"+
             "I've created my own prison",
             
             "\"my own prison\" - creed"+
             "<br> <br> <br> <br>"+
             "copyright by <br>"+
             "\"Wind-up Entertaiment Inc.\", 1999"
           );

////////////////////////////////////////
///    END SCROLL TEXT DEFINITION    ///
////////////////////////////////////////


//////////////////////////////////////////////////////////////////////
/////             END SCRIPT CONSTANTS DECLARATION            ////////
//////////////////////////////////////////////////////////////////////






function moptext()
{
	if (currentline < line.length )
	{
		layerWrite(line[currentline],"moptext");
		mopLayer = getLayer("moptext");
		reset(mopLayer);
		mopLayerHeigth = parseInt(mopLayer.style.height);
		for (i=0; i<=mopLayerHeigth; i++)
		{
			setTimeout("writeIt()",time);
			time+=speed;
		};
		time+=wait;
		setTimeout("hide()",time);	
	};
};

function writeIt()
{
	mopLayer.style.clip="rect(auto auto "+start+"px auto)";
	start++;
};

function hide()
{
	switch(browserID)
	{
		case "IE5": filter = mopLayer.style.getAttribute("filter");
			    alpha = parseInt(filter.slice(filter.indexOf("=")+1, filter.length-1));
			    // reset time for fading ( new time frame )
			    time=0;
			    fadeOut();
			 break;
		default: hideLayer("moptext");
			 currentline++;
			 moptext();
			 break;	
	};
};

function fadeOut()
{
	if (alpha>=0)
	{
		alpha-=smoothness;
		mopLayer.style.setAttribute("filter","alpha(opacity="+alpha+")","false");
		setTimeout("fadeOut()",time);
		time+=fadingspeed;
	}
	// all done, start next run
	else
	{ 
		currentline++;
		setTimeout("moptext()",time+speed);
	};
};

function reset(mopLayer)
{
	// reset time and start
	time = 0;
	start = 0;
	// if IE5 filter avaible set fully visible ( fading possible )
	if (browserID=="IE5") mopLayer.style.setAttribute("filter","alpha(opacity=100)","false");
	mopLayer.style.clip="rect(auto auto "+start+"px auto)";
	showLayer("moptext");
};



/////////////////////////////////////////////
///    coded by general@myownprison.de    ///
/////////////////////////////////////////////
