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

// ======= ======= ======= ======= ======= ======= =======
//
// ======= ======= ======= ======= ======= ======= =======
function SubmitForm( which )
{
  var form = document.getElementById( which );
  if( form.onsubmit() )
  {
    form.submit();
  }
  return( false );
}

function SubmitSimpleForm( which )
{
  var form = document.getElementById( which );
  form.submit();
  return( false );
}

// ======= ======= ======= ======= ======= ======= =======
//
// ======= ======= ======= ======= ======= ======= =======
function antispam( mail_no, template )
{
  x = "";
  y = "@";
  z1 = "energiesparduschen";
  z2 = "de";

  switch( mail_no )
  {
    case 1:
      x = "kundenservice";
      break;
    case 2:
      x = "mail";
      break;
    default:
      x = "info";
      break;
  }

  s = x + y + ( z1 + "." + z2 );

  if( !template )
    template = "<a href=\"mailto:###x###\" class=\"mail\">###x###</a><noscript><span style=\"color: #f00\">E-Mail-Adresse ist spam-gesch&uuml;tzt - bitte Javascript aktivieren!</span></noscript>"

  document.write( template.replace( /###x###/g, s ) );

}
