// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function text_required()
  {
    var op = $("problem_option").value;
    return op == "I have a suggestion ..." || op == "I have a problem that\'s not on this list ...";
  }

function toggle_other()
 {
   if (text_required())
     {
       Element.show("other");
       $("other").focus();
     }
   else
     Element.hide("other");
   return false;
  }

function checkContents(e)
  {
    var reg = /^\s*$/;
    return reg.test(e);
  }

function validate_other()
  {
    if( text_required() && checkContents($F("other")) )
      {
        alert("Please enter some text");
        $("other").focus();
        return false; 
      }
  return true;
  }


function collapseMe(expander){
  Element.hide(expander);
}

function expandMe(expander){
	Element.show(expander);
}

