//window.onload = RunOnload;

$(document).ready(function() {

	//Fix Javascript links that Ektron refuses to allow
	$("a[@href*=/javascript:]").each(function() {
		
		var Link = $(this).get(0).getAttribute("href");
		Link = Link.replace("/javascript:","javascript:");
		Link = Link.replace("http://www.clarke.edu","");
		$(this).attr("href", Link);
	});

	//Set a class on the first LI of every list
	$("li:first-child").addClass("first_child");

});

function DisplayEmail(FirstName, LastName, MaxLength)
{
	var Suffix = '...';
	var EmailAddress = FirstName.toLowerCase() + '.' + LastName.toLowerCase() + '@clarke.edu';

	EmailAddress = EmailAddress.replace(" ","");
	EmailAddress = EmailAddress.replace("'","");

	var DisplayEmailAddress = '';
	if(EmailAddress.length > (MaxLength + Suffix.length) )
	{
		DisplayEmailAddress = EmailAddress.substring(0, MaxLength) + Suffix;
	}
	else
	{
		DisplayEmailAddress = EmailAddress;
	}

	document.write('<a href="' + 'mail' + 'to:' + EmailAddress + '">' + DisplayEmailAddress + '</a>');
}

function meet_me_at_clarke()
{

	var URLtoOpen = "http://www.clarke.edu/media/static/meetmeatclarke/meetmeatclarke.html";
	var windowName = "Meet_Me_at_Clarke";
	var height = 480;
	var width = 760;

	windowFeatures ="menubar=no,scrollbars=no,location=no,favorites=no,resizable=no,status=no,toolbar=no,directories=no";

	var test = "'";

	winLeft = (screen.width-width)/2;
	winTop = (screen.height-(height+110))/2;
	myWin= open(URLtoOpen,windowName,"width=" + width +",height=" + height + ",left=" + winLeft + ",top=" + winTop + test + windowFeatures + test);

}
