// Java Document
function ShowItem()
{	
	var Index = document.getElementById("select").value;  
	if ( Index == 'Search Engine' ) (
		(	
		document.getElementById("foundUsOther2").value = "",
		document.getElementById("foundUsOther").style.display = 'none',
		document.getElementById("searchEngine").style.display = '',
		document.getElementById("searchEngine2").style.display = '' 
		) 
	)
	else if ( Index == 'Other' ) (
		(
		document.getElementById("select2").value = "",
		document.getElementById("other2").value = "",
		document.getElementById("foundUsOther").style.display = '',
		document.getElementById("Other").style.display = 'none',
		document.getElementById("searchEngine2").style.display = 'none',
		document.getElementById("searchEngine").style.display = 'none'
		)
	)
	else(
		(
		document.getElementById("foundUsOther2").value = "",
		document.getElementById("select2").value = "",
		document.getElementById("other2").value = "",		
		document.getElementById("foundUsOther").style.display = 'none',
		document.getElementById("Other").style.display = 'none', 
		document.getElementById("searchEngine2").style.display = 'none',
		document.getElementById("searchEngine").style.display = 'none'
		)  
	)
} 
function ShowItem2()
{
	var Index = document.getElementById("select2").value;
	document.contact.select2.reset
	if ( Index == 'Other' ) (
		document.getElementById("Other").style.display = ''
	)
	else(
	(
	document.getElementById("other2").value = "",
	document.getElementById("Other").style.display = 'none'
	)
	)
} 
function ShowItem3()
{
	  var Index = document.getElementById("select3").value;
	  document.contact.select3.reset
	  if ( Index == 'Other' ) (
	  document.getElementById("Other3").style.display = ''
	  )
	  else(
	  (	  
	  document.getElementById("productSearchOther2").value = "",
	  document.getElementById("Other3").style.display = 'none'	  
	  )
	  )
} 
function checksubmit()
{
	
   // check to see if name field is empty
   // note that you use the name of the form and the field
   if (document.contact.FirstName.value == "")
   {
      // tell client that you need the name
      alert("Please enter your first name")
      // send the cursor to the fullname field
      document.contact.FirstName.focus()
      // field is empty, so return false to abort the form submission
      // the client is returned to the form
      return false
   }
   // check to see if email address field is empty
   if (document.contact.LastName.value == "")
   {
      alert("Please enter your last name")
      document.contact.LastName.focus()
      return false
   }
    // check to see if email address field is of valid syntax
   substremail = document.contact.EmailFrom.value.split("@")
   if (substremail.length > 1)
   {
      index = substremail[1].indexOf(".")
      if (index == -1)
      {
	  	alert("Please enter a valid email address")
         document.contact.EmailFrom.focus()
         return false
      }
      else
      {
         return true
      }
   }
   else
   {
   		alert("Please enter a valid email address")
      document.contact.EmailFrom.focus()
      return false
   }
   // if both fields are filled out, return true
   // this triggers the form submission
   return true
}
