/* CareGiving JS Document */

<!--
//SUBMIT VALIDATION SCRIPT ---------------------------------------------------
	function checkMandatory()
	{
		var error_string = "";
//check the text field first name
		if(window.document.cgform.fname.value == "")
		{
			error_string += "Your first name is a required field.\n";
		//	theForm.fname.focus();
		//	return (false);
		}
		
//check the text field last name
		
		if(window.document.cgform.lname.value == "")
		{
			error_string += "Your last name is a required field.\n";
		//	theForm.lname.focus();
		//	return (false);
		}
		
//check the text field email
		var emailver ="no";
		var emailad=window.document.cgform.email.value;
		var the_at = emailad.indexOf("@");
		var the_dot = emailad.lastIndexOf(".");
		var a_space = emailad.indexOf(" ");
		if ((the_at != -1) && //if there's an '@'
			(the_at != 0) && // and it's not at position 0
			(the_dot !=-1) && // and there's a '.'
			(the_dot > the_at +1) && // and something between the '@' and '.'
			(the_dot < emailad.length -1) && //and something after the '.'
			(a_space == -1)) // and there are no spaces
			{emailver ="yes";
			}
		if (emailver =="no")
		{
			error_string += "Your email is a required field.\n";
		//	theForm.email.focus();
		//	return (false);
		}


//check the text field subject
		
		if(window.document.cgform.subject.value == "")
		{
			error_string += "The subject is a required field.\n";
		//	theForm.lname.focus();
		//	return (false);
		}



//check checkboxes
		/*var checkboxes = "no";
			if ((window.document.cgform.comment1.checked == true) ||
			 (window.document.cgform.comment2.checked == true) ||
			 (window.document.cgform.comment3.checked == true) ||
			 (window.document.cgform.comment4.checked == true) ||
			 (window.document.cgform.comment5.checked == true) ||
			 (window.document.cgform.comment6.checked == true))
			 {
			checkboxes = "yes";
			}
			if (checkboxes =="no")
			{
				error_string += "Please select a Requested Information Checkbox.\n";
			}*/

			
//return commands					
		if (error_string !== "")
		{	
			error_string = "We found the following omissions in your form: \n" + error_string;
			alert(error_string);
			return false;
			}
		
}



//PREVIEW WINDOW SCRIPT ------------------------------------------------------
	function diswind() 
		{DispWin = window.open('', 'NewWin',
		'toolbar=yes, status=no, width=800, height=600, scrollbars, resizable');

//Comments or Suggestions		
		/*var fmcomment=new Array()

		if (window.document.cgform.comment1.checked == true)
		{
		fmcomment[0] = "Share Your Story"
		}
		if (window.document.cgform.comment2.checked == true)
		{
		fmcomment[1] = "Caregiving Support"
		}
		if (window.document.cgform.comment3.checked == true)
		{
		fmcomment[2] = "Self&ndash;Publishing Consulatation"
		}
		if (window.document.cgform.comment4.checked == true)
		{
		fmcomment[3] = "Booking Information"
		}
		if (window.document.cgform.comment5.checked == true)
		{
		fmcomment[4] = "Comments, Compliments, Suggestions"
		}
		if (window.document.cgform.comment6.checked == true)
		{
		fmcomment[5] = "More Information"
		}*/

		

	


//	var finish = "no"
		message = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><title>Caregiving 101 Form Information</title><link rel='stylesheet' type='text/css' href='../css/normalize.css'/><link rel='stylesheet' type='text/css' media='screen, print' href='../css/printform.css'/></head><body><div id='contents'><h1>Caregiving 101</h1><h2 class='bookingf'>Booking/Speaking Engagement Form</h2><div id='leftcolumn'>";
		<!--message = "<html><head><title>Caregiving 101 Form Information</title></head><body><ul><li><b>First Name: </b>" + document.cgform.fname.value;"</li>"-->
		message += "<ul><li><span>First Name: </span>" + document.cgform.fname.value;"</li>"
		message += "<li><span>Last Name: </span>" + document.cgform.lname.value;"</li>"
		message += "<li><span>Company: </span>" + document.cgform.company.value;"</li>"
		message += "<li><span>Address: </span>" + document.cgform.address.value;"</li>"
		message += "<li><span>City: </span>" + document.cgform.city.value;"</li>"
		message += "<li><span>State: </span>" + document.cgform.state.value;"</li>"
		message += "<li><span>Zip: </span>" + document.cgform.zip.value;"</li>"
		message += "<li><span>Country: </span>" + document.cgform.country.value;"</li>"
		message += "<li><span>Phone: </span>" + document.cgform.phone.value;"</li>"
		message += "<li><span>FAX: </span>" + document.cgform.fax.value;"</li>"
		message += "<li><span>Email: </span>" + document.cgform.email.value;"</li>"
		message += "<li><span>Subject: </span>" + document.cgform.subject.value;"</li>"
		//message += "<li><span>Requested Information: </span>" + fmcomment;"</li>"

		message += "<li><span>Name of Event/Group: </span>" + document.cgform.eventname.value;"</li>"
		message += "<li><span>Event/Meeting Date(s): </span>" + document.cgform.whenevent.value;"</li>"
		message += "<li><span>Event/Meeting Location: </span>" + document.cgform.whereevent.value;"</li>"
		message += "<li><span>Number of Attendees: </span>" + document.cgform.howmany.value;"</li>"
		message += "<li><span>Other Details: </span>" + document.cgform.otherdetails.value;"</li>"
/*		message += <input type="button" value="Display" name="display" style="margin-left: 150px;" onClick=finish = "yes";/>*/
		message += "</ul><p><a href='javascript:window.print()'>Print This Page</a></p></div></div></body></html>"
		DispWin.document.write(message);
//		DispWin.document.writeln(<INPUT TYPE=\"BUTTON\" VALUE=\"Send\" onClick=\"finish = yes\">);
//		DispWin.document.writeln("</FORM>");
		DispWin.document.close();
		}
		
		
//return commands	

/*		if (finish == "yes")
		{
		return true;
		}*/
		

//NEW BROWSER WINDOW --------------------------------------------------------------

//	var detailsWindow;
	
//	function showDetails(bookURL)
//	{
//		detailsWindow = window.open(bookURL, "URL Link");
//		detailsWindow.focus();
//		return true;
//	}		
		


		
// end hide -->