// If subject "Other" is seelcted
function activate(field) 
{
  field.disabled=false;
  if(document.styleSheets)field.style.display  = 'block';
  field.focus(); 
}

function last_choice(selection) 
{
  return selection.selectedIndex==selection.length - 1; 
}

function process_choice(selection,textfield) 
{
  if(last_choice(selection)) 
  {
    activate(textfield); 
  }
  else {
    textfield.disabled = true;    
    if(document.styleSheets)textfield.style.display  = 'none';
    textfield.value = ''; 
  }
}

function valid(subject,subject2) 
{ 
  if(subject.selectedIndex == 0) 
  {
    alert('Please select a subject.');
    return false;
  } 
  if(subject2.value == '') 
  {
    if(last_choice(subject)) 
	{
      alert('Please type in your own subject or select one from the "subject" drop down menu.');
      return false; 
	}
    else {
      return true; 
	}
}

  else 
  {
    if(!last_choice(subject)) 
	{
      alert('Incompatible selection');
      return false; 
	}
   
    else 
	{
	  return true; 
	}
  }
}

function check_choice() 
{
  if(!last_choice(document.contactForm.subject)) 
  {
    document.contactForm.subject2.blur();
    alert('Please check your subject selection first');
    document.contactForm.subject.focus(); 
	}
}
