/* The Reyna Collection JS Document */

<!--
//SUBMIT VALIDATION SCRIPT ---------------------------------------------------
	function checkMandatory()
	{
		var error_string = "";
//check the text field first name
		if(window.document.trcform.fname.value == "")
		{
			error_string += "Your first name is a required field.\n";

		}
		
//check the text field last name
		
		if(window.document.trcform.lname.value == "")
		{
			error_string += "Your last name is a required field.\n";

		}
		
//check the text field email
		var emailver ="no";
		var emailad=window.document.trcform.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";

		}



//check checkboxes
		var checkboxes = "no";
			if ((window.document.trcform.comment1.checked == true) ||
			 (window.document.trcform.comment2.checked == true) ||
			 (window.document.trcform.comment3.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=no, status=no, width=500, height=400');

//Comments or Suggestions		
		var fmcomment=new Array()

		if (window.document.trcform.comment1.checked == true)
		{
		fmcomment[0] = "Bluworld Custom Water Feature"
		}
		if (window.document.trcform.comment2.checked == true)
		{
		fmcomment[1] = "Request Catalog"
		}
		if (window.document.trcform.comment3.checked == true)
		{
		fmcomment[2] = "Other Information - Price Quote"
		}

		

	


//	var finish = "no"
		
		message = "<html><head><title>Tropical Creations USA Form Information</title></head><body><ul><li><b>First Name: </b>" + document.trcform.fname.value;"</li>"
		message += "<li><b>Last Name: </b>" + document.trcform.lname.value;"</li>"
		message += "<li><b>Company: </b>" + document.trcform.company.value;"</li>"
		message += "<li><b>Address: </b>" + document.trcform.address.value;"</li>"
		message += "<li><b>City: </b>" + document.trcform.city.value;"</li>"
		message += "<li><b>State: </b>" + document.trcform.state.value;"</li>"
		message += "<li><b>Zip: </b>" + document.trcform.zip.value;"</li>"
		message += "<li><b>Country: </b>" + document.trcform.country.value;"</li>"
		message += "<li><b>Phone: </b>" + document.trcform.phone.value;"</li>"
		message += "<li><b>Email: </b>" + document.trcform.email.value;"</li>"
		message += "<li><b>Subject: </b>" + document.trcform.subject.value;"</li>"
		message += "<li><b>Requested Information: </b>" + fmcomment;"</li>"

		message += "<li><b>Specific Request: </b>" + document.trcform.specificrequest.value;"</li></ul>"

		message += "</body></html>"
		DispWin.document.write(message);

		DispWin.document.close();
		}
		
		
	


		
// end hide -->