<!-- Hide me from old browsers
/* Form for email Library/TexShare Card request: November 14, 2003 */
/* Contact me at christopher.e.gonzales@nhmccd.edu NHC LB201 x7872 */
/* Revisions
	Jan 12,01 - First version
	Jan 25,01 - Rewrote 'for' statement in CheckIt() for IE/AOL Compatability
	Oct 03,01 - Added Error Check: not quality only existance of answers
	Sep 27,02 - Added Subject to email, Added where located info
	Oct 23,02 - Updated TOM email addres to Margaret.E.Dawson@nhmccd.edu
	Nov 07,02 - Corrected Errors after SSN & Fairbanks additions; Dreamweaver Fix
	APR 25,03 - Javascript in external file; defaulted NOR for recipient if empty;
		 	  - created details function for card info
	Nov 14,03 - Split forms and adjusted for new format - telephone,card_type,add cy-fair college
	Jun 16,05 - Changed email for PAR,CAR added check for Pick Up Loc and Home Loc
	Apr 10,06 - Changed email for FAI; rewrote ifs for switch statement in WhichOne(i);
			  - rewote msg for msg[]; set Pick Up location to overide College Attended
	Sept 21,07 - Changed MC to Janice Peyton @nhmccd.edu. 
	Oct 24, 07 - Changed MC to Justin.G.Fuller@nhmccd.edu. 
	Jan 31, 08 - changed MC and Conroe center back to Janice.l.Peyton@lonestar.edu.
	Jan 31, 08 changed all directional revipient.value emails to lonestar.edu. 
	Apr 04, 08 - changed MC and Conroe center to Suzie.S.Solomon@lonestar.edu.
*/

function WhichOne(i) {

	// --- Place correct email addresses here ---
	switch (i) {

		case "Carver Center":
			document.theForm.recipient.value="tawana.l.burke@lonestar.edu";
			break;

		case"CATE Center":
			document.theForm.recipient.value="kingwood.lrc-circ@lonestar.edu";
			break;

		case "Center for Business Technology Training":
			document.theForm.recipient.value="Suzie.S.Solomon@lonestar.edu";
			break;

		case "Conroe Center":
			document.theForm.recipient.value="Suzie.S.Solomon@lonestar.edu";
			break;

		case "Cy-Fair":
			document.theForm.recipient.value="daniel.p.propes@lonestar.edu";
			break;

		case "Fairbanks Center":
			document.theForm.recipient.value="Pheneria.J.Watson@lonestar.edu; carol.r.throckmorton@lonestar.edu";
			break;

		case "Kingwood College":
			document.theForm.recipient.value="kingwood.lrc-circ@lonestar.edu";
			break;

		case "Montgomery College":
			document.theForm.recipient.value="Suzie.S.Solomon@lonestar.edu";
			break;

		case "North Harris College":
			document.theForm.recipient.value="nhc.circ@lonestar.edu";
			break;

		case "Parkway Center":
			document.theForm.recipient.value="barbara.a.lewis@lonestar.edu";
			break;

		case "Tomball College":
			document.theForm.recipient.value="Margaret.E.Dawson@lonestar.edu";
			break;

		case "Willow Chase":
			document.theForm.recipient.value="cecelia.cameron@lonestar.edu";
			break;
	}
	//alert(i + "\n" + document.theForm.recipient.value) // DEBUG:

	// --- Force NHC Picture ID Card ---
	if ((document.theForm.Pick_up_card_at[document.theForm.Pick_up_card_at.selectedIndex].value == "North Harris College Library") && (i == "North Harris College"))
	{ alert("If you plan on coming in person to pick up your card, we encourage you to get a Picture Student ID.\nAlternatively, you may choose a different Pick Up location.")
	  document.theForm.Student_at[7].checked = false;
	}

}

// ---  Only checks for type of card and school, if more is needed/wanted, ask ---

function CheckIt() {

	// **** NOTE: Must set new msg to "" in equal statement. ****

	document.theForm.REFERRED_FROM.value = document.referrer;
	document.theForm.FORM_LOCATION.value = document.location.href;

	var msg = new Array(15)
	msg[0] = "" // RESERVED
	msg[1] = "" // First Name
	msg[2] = "" // Last Name
	msg[3] = "" // Address
	msg[4] = "" // City
	msg[5] = "" // State
	msg[6] = "" // Zip
	msg[7] = "" // Telephone
	msg[8] = "" // Birthdate
	msg[9] = "" // SSN
	msg[10] = "" // Barcode Number for TxShare Card Form
	msg[11] = "" // Agree To TexShare Card Terms
	msg[12] = "" // Method of Delivery
	msg[13] = "" // OPTIONAL Pickup Location
	msg[14] = "" // College

	if (document.theForm.First_Name.value == "")
		msg[1] = "     Enter your First Name.\n"

	if (document.theForm.Last_Name.value == "")
		msg[2] = "     Enter your Last Name.\n"

	if (document.theForm.Address.value == "")
		msg[3] = "     Enter your Address.\n"

	if (document.theForm.City.value == "")
		msg[4] = "     Enter your City.\n"

	if (document.theForm.State.value == "")
		msg[5] = "     Enter your State.\n"

	if (document.theForm.Zip.value == "")
		msg[6] = "     Enter your Zip Code.\n"

	if (document.theForm.Telephone.value == "")
		msg[7] = "     Enter your Telephone Number.\n"

	if (document.theForm.Birthdate.value == "")
		msg[8] = "     Enter your Birth Date.\n"

	if (document.theForm.SSN.value == "")
		msg[9] = "     Enter the last 4 digits of your Social Security Number.\n"

	// --- Check for Library Barcode on Texshare Form ONLY  ---
	if (document.theForm.card_type.value == "texshare") {
		if (document.theForm.barcode.value == "")
			msg[10] = "     Please enter your Library card barcode.\n"
	}

	// --- Check for Agree to Terms on Texshare Form ONLY  ---
	if (document.theForm.card_type.value == "texshare") {
		if (!document.theForm.Agreed_To_TexShare_Terms.checked)
			msg[11] = "     You must read and agree to the terms of TexShare Card use.\n"
	}

	if ((!document.theForm.Deliver_by[0].checked) && (!document.theForm.Deliver_by[1].checked))
		msg[12] = "     Choose your method of Delivery.\n"

	if ((document.theForm.Pick_up_card_at[document.theForm.Pick_up_card_at.selectedIndex].value == "") && (document.theForm.Deliver_by[1].checked == true))
		msg[13] = "     Choose your Pick Up Location.\n"

	// --- Check for school choice --- [ALTERNATE 'FOR' FOR MS IE & AOL]
	for (var i=0; i < document.theForm.Student_at.length; i++)
	{
		if (!document.theForm.Student_at[i].checked)
			msg[14] = "     Choose what college you attend.\n";
		else {
			msg[14] = "";
			var student_at = document.theForm.Student_at[i].value;
			break;
		     }
	}

	//alert(student_at + " vs. " + document.theForm.Pick_up_card_at[document.theForm.Pick_up_card_at.selectedIndex].value)

	// --- Send Card Request to Location It Will Be Picked Up at.
	if ((document.theForm.Deliver_by[1].checked == true) && (student_at != document.theForm.Pick_up_card_at[document.theForm.Pick_up_card_at.selectedIndex].value))
		WhichOne(document.theForm.Pick_up_card_at[document.theForm.Pick_up_card_at.selectedIndex].value);
	else
		WhichOne(student_at);

	for (i in msg) { msg[0] += msg[i] } //Build error message
	if ( msg[0] != "" )
	{
		alert("Please complete the following:\n" + msg[0]);
		return false;
	}
	else
	{
		// If the recipient has an error, default to North Harris so nhchelpdesk is not bothered
		if ((document.theForm.recipient.value == "") || (document.theForm.recipient.value == "undefined"))
			{ WhichOne("North Harris College") }
		//alert(document.theForm.recipient.value); return false // DEBUG:
		return true;
	}
}

function details(card) {
	if (card == "Library_Card")
		alert("Do you have a library card already?\n\nIf you have gotten a library card from any of the campuses (Kingwood, Tomball, Montgomery, \nNorth Harris, etc) then you do not need another. One card is good at all college campuses.\n\nIf you have your yellow library card from last year, then this card will still be good to use.\n\nIf you have a Picture Student ID card, you already have a library card!\nOn the back will be a 14 digit barcode that the library will use as your library card.")

	if (card == "TexShare_Card")
		alert("Do you qualify for a TexShare Card?\n\nA TexShare card is only given to Credit Students and Faculty/Staff. Your library record must be clear \nof all fines and overdue materials.\n\nTexShare cards for students are valid for one semester at a time. Your card will expire on either \n5/1, 8/1, or 12/1 of the current year. If you are card has expired and have meet the above \nconditions, you may request a new TexShare card.")

}
// Don't Hide me anymore -->