// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function show_popup_form(div_name)
{
  $('transparent-div').style.display="block"
  Element.scrollTo($(div_name));
  $(div_name).show();
}

function hide_popup_form(div_name) {
    $(div_name).hide();
    $('transparent-div').style.display="none"
}

function delete_cookie (cookie_name)
{
  var cookie_date = new Date ( 1 );
  ck = cookie_name + "=none;expires=" + cookie_date.toGMTString() + ";path=/"
  document.cookie = ck;

}

function toggle_element_by_checkbox(checkbox_id, element_id)
{
  if ($(checkbox_id).checked) {
    $(element_id).show();
  } else {
    $(element_id).hide();
  }
}

function limitText(limit_field, limit_num) {
    if (limit_field.value.length > limit_num) {
        limit_field.value = limit_field.value.substring(0, limit_num);
    }
}
