// JavaScript Document	

// inserts the speaker information into the speaker information cell //

function insertSpeakerData() {

	if (speakerFirst.length < 1 ) {
		if (speakerLast.length < 1) {
			}
		else {
			document.write(" with special guest ");
			}
				
		}


	else {
		document.write(" with special guest ");
		}
	
	if (speakerTitle.length > 0) {document.write(speakerTitle + " ");}
	
	if (speakerFirst.length > 0) {document.write(speakerFirst + " ");}
	
	if (speakerMiddle.length > 0) {document.write(speakerMiddle + " ");}
	
	if (speakerLast.length > 0) {document.write(speakerLast);}
	
	if (speakerSuffix.length > 0) {document.write(", " + speakerSuffix);}

	if (broadcastDate.length > 0) {
		document.write(" on " + broadcastDate);
		}

	if (broadcastTime.length > 0) {
		document.write(" at " + broadcastTime);
		}

	if (episodeTitle.length > 0) {
		document.write(" for our episode entitled &quot;" + episodeTitle + "&quot;");
		}
	else {document.write("!");}

	}

// Inputs the thumnail of the speaker into the page //

function insertSpeakerThumb() {
	if (speakerThumbNameFull.length > 0) {
		document.write("<img width='65' height='65' alt='" + speakerTitle + " " + speakerFirst + " " + speakerLast + "'  src='http://www.streamingfaith.com/UserFiles/Image/Head_Shots/" + speakerThumbNameFull +"' class='thumb'");
	}
	
	else if (speakerFirst.length > 0) {
		document.write("<img width='65' height='65' alt='" + speakerTitle + " " + speakerFirst + " " + speakerLast + "' src='http://www.streamingfaith.com/UserFiles/Image/Head_Shots/" + speakerFirst + speakerLast + "_thumb" + speakerThumbEnd + ".jpg' class='thumb'");
	}
	
	else if (speakerLast.length > 0) {
		document.write("<img width='65' height='65' alt='" + speakerTitle + " " + speakerFirst + " " + speakerLast + "' src='http://www.streamingfaith.com/UserFiles/Image/Head_Shots/" + speakerFirst + speakerLast + "_thumb" + speakerThumbEnd + ".jpg' class='thumb'");
	}

}

// Inputs the blue link below the green paragraph
// stating when the next episode will be.
// Only works if the information has been added if
// broadcastDate has information and the time is 
// only added if broadcastTime holds information

function insertNextEpisode() {
	if (broadcastDate.length > 0) {
		document.write("<div class='LiveLink'>Next Episode: " + broadcastDate);
		if (broadcastTime.length > 0) {
			document.write(" @ " + broadcastTime + "</div>");
		}
		else {
			document.write("</div>");
		}
	}
}

function insertReminderURL() {
	if (reminderURL.length > 0) {
		document.write("<a href='" + reminderURL + "'><div class='LiveLink'>Click here to receive a reminder!</div></a>");
	}
}