// JavaScript Document

window.onerror = null
var browserOK = (((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) >= 3)) || ((navigator.appName == 'Microsoft Internet Explorer') && (parseInt(navigator.appVersion) >= 4)));
var hex_out = 255;
var hex_in = 0;

if(browserOK)
{
	messages = new Array();
		messages[0] = "Haley Pullos books a guest star appearance on \"House MD\" and continues in her role as Molly on \"General Hospital\"";
		messages[1] = "Caleb Pinkett booked a role in the film \"The Heart Specialist\"";
		messages[2] = "Jadon Sand booked a role in the major motion picture \"Spiderman\"";
		messages[3] = "Mateus Ward lands a role in the pilot \"Outnumbered\"";
		messages[4] = "Catch Scotty Noyd in an episode of \"The Middle\"";
		messages[5] = "Curt Mega does a little soft shoe on \"Glee\"";
		messages[6] = "Jordan Steele nabs a spot on \"Brothers & Sisters\"";
		messages[7] = "Katee Shaen books a commercial for Liv Toys";
		messages[8] = "Celena Ahn will be in a commercial for Verizon";
		messages[9] = "Gigi Papasavvas booked a role in the short film \"90 Seconds\"";
	var line = 0;
	
	images = new Array();
		images[0] = "im/test_1.png";
		images[1] = "im/test_2.png";
		images[2] = "im/test_3.png";
	var picture = 0;
}

var $ = function(id)
{
	return document.getElementById(id);
}

var fade_in = function()
{ 
  if(hex_in < 255)
	{
    hex_in += 11;
    document.getElementById("m_text").style.color = "rgb(" + hex_in + "," + hex_in + "," + hex_in + ")";
    setTimeout("fade_in()",50); 
  }
	else
	{
		hex_in = 0;
	}
}

var fade_out = function()
{ 
  if(hex_out > 0)
	{
    hex_out -= 11;
    document.getElementById("m_text").style.color = "rgb(" + hex_out + "," + hex_out + "," + hex_out + ")";
    setTimeout("fade_out()",50); 
  }
	else
	{
		hex_out = 255;
	}
}

var marquee = function()
{
  if(browserOK)
  {
    $("m_text").firstChild.nodeValue = messages[line++];
    if(line >= messages.length)
		{
      line = 0;
		}
		window.setTimeout("marquee()", 10000);
		fade_in();
//	fade_out();
	}
}

var testimonials = function()
{
  if(browserOK)
  {
    $("test_image").src = images[picture++];
    if(picture >= images.length)
		{
      picture = 0;
		}
    window.setTimeout("testimonials()", 30000);
  }
}

window.onload = function()
{
	marquee();
	testimonials();
}
