// invokeEmail
// Puts together the broken up email address and invokes the standard
// email client with pre-filled email address and subject
function invokeEmail(end, middle, start, subject)
{
	var one = 'mai';
	var two = 'lto:';
	var three = '?Subject=';
	
	// Put email and subject into a string
	var emailWithSubject = one + two + getPutTogetherEmail(end, middle, start) + three + subject;
	
	// Invoke email client with prefilled fields
	document.location.href=eval('"' + emailWithSubject + '"');
}

// getPutTogetherEmail
// Returns a string that is a legible representation of the 3 provided strings of a broken up email
function getPutTogetherEmail(end, middle, start)
{
	// start, middle, end
	var putTogether = start + middle + end;
	
	// Return email in its legible form
	return (putTogether);
}


// getEmailWithMessage
// Returns a string that contains a message before and after the email address
function getEmailWithMessage(beforeMessage, emailString, afterMessage)
{
	var emailWithMessage = beforeMessage + emailString + afterMessage;
	
	return (emailWithMessage);
}


// displayMessageAsStatus
// Updates the window status with the custom message putting together the broken up
// email address
function displayMessageAsStatus(end, middle, start, messageBefore, messageAfter)
{
	// Get email address string
	var emailAddress = getPutTogetherEmail(end, middle, start);
	
	// Compile a message using emailAddress
	var message = getEmailWithMessage(messageBefore, emailAddress, messageAfter);
	
	// Update window status
	window.status = message;
}


function openPrintable(pageURL)
{
	window.open(pageURL,'printable','height=550,width=700,scrollbars,toolbar,resizable');
}

function rollOver(imageTagName, imageObject)
{
	document.images[imageTagName].src=imageObject.src;
}

// Preload images to be used for email swapping
emailRegular = new Image();
emailRegular.src = "images/emailRegular.gif";
emailRolledOver = new Image();
emailRolledOver.src = "images/emailRolledOver.gif";



