/* Jaans Shoppe JS Document */

<!--
//SUBMIT VALIDATION SCRIPT ---------------------------------------------------
	function checkMandatory()
	{
		var error_string = "";
//check the text field first name
		if(window.document.omasform.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.omasform.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.omasform.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 checkboxes
		var checkboxes = "no";
			if ((window.document.omasform.comment1.checked == true) ||
			 (window.document.omasform.comment2.checked == true) ||
			 (window.document.omasform.comment3.checked == true) ||
			 (window.document.omasform.comment4.checked == true) ||
			 (window.document.omasform.quest1.checked == true) ||
			 (window.document.omasform.quest2.checked == true) ||
			 (window.document.omasform.quest3.checked == true) ||
			 (window.document.omasform.quest4.checked == true))
			 {
			checkboxes = "yes";
			}
			if (checkboxes =="no")
			{
				error_string += "Please select a Comment or Question.\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.omasform.comment1.checked == true)
		{
		fmcomment[0] = "Suggestions"
		}
		if (window.document.omasform.comment2.checked == true)
		{
		fmcomment[1] = "Food"
		}
		if (window.document.omasform.comment3.checked == true)
		{
		fmcomment[2] = "Service"
		}
		if (window.document.omasform.comment4.checked == true)
		{
		fmcomment[3] = "Other"
		}
		
		var fmquest=new Array()

		if (window.document.omasform.quest1.checked == true)
		{
		fmquest[0] = "Reservations"
		}
		if (window.document.omasform.quest2.checked == true)
		{
		fmquest[1] = "Gift Cards"
		}
		if (window.document.omasform.quest3.checked == true)
		{
		fmquest[2] = "Gifts"
		}
		if (window.document.omasform.quest4.checked == true)
		{
		fmquest[3] = "Other"
		}
	


//	var finish = "no"
		
		message = "<html><head><title>Oma's Form Information</title></head><body><ul><li><b>First Name: </b>" + document.omasform.fname.value;"</li>"
		message += "<li><b>Last Name: </b>" + document.omasform.lname.value;"</li>"
		message += "<li><b>Company: </b>" + document.omasform.company.value;"</li>"
		message += "<li><b>Address: </b>" + document.omasform.address.value;"</li>"
		message += "<li><b>City: </b>" + document.omasform.city.value;"</li>"
		message += "<li><b>State: </b>" + document.omasform.state.value;"</li>"
		message += "<li><b>Zip: </b>" + document.omasform.zip.value;"</li>"
		message += "<li><b>Country: </b>" + document.omasform.country.value;"</li>"
		message += "<li><b>Phone: </b>" + document.omasform.phone.value;"</li>"
		message += "<li><b>Email: </b>" + document.omasform.email.value;"</li>"
		message += "<li><b>Subject: </b>" + document.omasform.subject.value;"</li>"
		message += "<li><b>Comments: </b>" + fmcomment;"</li>"
		message += "<li><b>Questions: </b>" + fmquest;"</li>"
		message += "<li><b>Information: </b>" + document.omasform.specificrequest.value;"</li></ul>"
/*		message += <input type="button" value="Display" name="display" style="margin-left: 150px;" onClick=finish = "yes";/>*/
		message += "</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 -->