
	function loadIndex()
	{
		document.getElementById("headline").innerHTML = 
				'<img src="http://www.radiator.com/inc/localheadline.php?text=Los Angeles-Long Beach&config=border" style="margin-top:5px" /><br />' 
								;
	}

function startMovie() 
{
	var flash;

	if(navigator.appName.indexOf("Microsoft") != -1) 
	{
		flash = window.radiator;
	}
	else 
	{
		flash = window.document.radiator;
	}

	flash.startMovie();
}

// Javascript utility functions added by SS
/////////////////////////////

function zipinput(fe) 
{
	var code;
	var e = fe || window.event;
	if (e.keyCode) code = e.keyCode;
	else if (e.which) code = e.which;
	if (code == 13)
	{
		gotochat(document.getElementById("chatzip").value);
	}
}	

function gotochat(zip)
{
	zip = trim(zip);
	
	if ((zip.length != 5) || (!is_numeric(zip)))
	{
		alert('Please enter a 5 digit zip code.');
	}
	else
	{
		document.getElementById("hiddenzip").value = zip;
		// alert(document.getElementById("hiddenzip").value);
		document.getElementById("hiddenzip").form.submit();
	}
}

function is_numeric(strString)
{
	//  check for valid numeric strings	
	var strValidChars = "0123456789";
	var strChar;
	var blnResult = true;

	if (strString.length == 0) return false;

	//  test strString consists of valid characters listed above
	for (i = 0; i < strString.length && blnResult == true; i++)
	{
		strChar = strString.charAt(i);
		if (strValidChars.indexOf(strChar) == -1)
		{
			blnResult = false;
		}
	}
   return blnResult;
}

function trim(str)
{
	if ((str != null) && (str.length > 0))
	{
		return str.replace(/^\s*|\s*$/g,"");
	}

	return "";
}

function racesubmit(r1, zip, email)
{

	chosen = "";
	len = r1.length;

	for (i = 0; i <len; i++) 
	{
		if (r1[i].checked) 
		{
			chosen = r1[i].value;
		}
	}

	if (chosen == "") 
	{
		alert("Please select Yes or No for question #2.");
		return false;
	}
		
	if (!is_numeric(zip) || (zip.length != 5))
	{
		alert("Please enter 5 digit zip.");
		return false;
	}

	email = trim(email);
	
	if (email.length > 0)
	{
		var emailRegxp = /^([\w]+)(.[\w]+)*@([\w]+)(.[\w]{2,3}){1,2}$/;		
		if (emailRegxp.test(email) != true)
		{
			alert("Please enter a valid email address.");
			return false;
		}
	}
	document.getElementById("race_form").submit();
}

function zipinput2(fe) 
{
	var code;
	var e = fe || window.event;
	if (e.keyCode) code = e.keyCode;
	else if (e.which) code = e.which;
	if (code == 13)
	{
		copyzip();
	}
}

function copyzip()
{
	var zip = document.getElementById("r_zip").value;
	if (!is_numeric(zip) || (zip.length != 5))
	{
		alert("Please enter 5 digit zip.");
		return false;
	}
	
	document.getElementById("race_zip").value = zip;
}

function validateZip(f) 
{
	
	if ((f.country.value != "US") && (f.country.value != "Canada")) 
	{
		// no zip required, therefore no validation required
		return true;
	}

	if ((f.country.value == "US") && (!is_numeric(f.zip.value)) && (f.zip.value.length != 5))
	{
		window.alert("Please enter a 5 digit zip code for the United States.");
		return false;						
	}
	
	if ((f.country.value == "Canada") && (f.zip.value.length != 6))
	{
		window.alert("Please enter your 6 character zip code for Canada.");
		return false;						
	}
}

function InitSaveVariables(form) 
{
	shipfirstname = form.shipfirstname.value;
	shiplastname = form.shiplastname.value;
	shipaddress = form.shipaddress.value;
	shipaddress2 = form.shipaddress2.value;
	shipcity = form.shipcity.value;
	shipstate = form.shipstate.value;
	shipzip = form.shipzip.value;
	shipphone = form.shipphone.value;
}

function ShipToBillPerson(form) 
{
	InitSaveVariables(form);
	form.shipfirstname.value = form.requiredbillfirstname.value;
	form.shiplastname.value = form.requiredbilllastname.value;
	form.shipaddress.value = form.requiredbilladdress.value;
	form.shipaddress2.value = form.billaddress2.value;
	form.shipcity.value = form.requiredbillcity.value;
	form.shipstate.value = form.requiredbillstate.value;
	form.shipzip.value = form.requiredbillzip.value;
	form.shipphone.value = form.requiredbillphone.value;
}