function WebMain_correctEmail(x1) {
  return !(Prelude_null(Prelude_snd(Prelude_break(function(x10) { return boolEq("@",x10);} )(x1))));
}

function Prelude_null(x1) {
  var x4;
  var x5;
  x5 = x1;
  if ((typeof(x5) == "string")) {
    x5 = string2charlist(x5);
  }
  switch (x5[0]) {
    case "[]" :
      x4 = true;
      break;
    case ":" :
      x4 = false;
      break;
  }
  return x4;
}

function Prelude_snd(x1) {
  return x1[2];
}

function Prelude_break(x1) {
  return function(x4) { return Prelude_span(Prelude__2E(function(x7) { return !(x7);} ,x1),x4);} ;
}

function Prelude_span(x1,x2) {
  var x8;
  var x9;
  x9 = x2;
  if ((typeof(x9) == "string")) {
    x9 = string2charlist(x9);
  }
  switch (x9[0]) {
    case "[]" :
      x8 = new Array("(,)",new Array("[]"),new Array("[]"));
      break;
    case ":" :
      if (x1(x9[1])) {
        var x5;
        x5 = Prelude_span(x1,x9[2]);
        x8 = new Array("(,)",new Array(":",x9[1],Prelude_span_2E_5F_23selFP12(x5)),Prelude_span_2E_5F_23selFP13(x5));
      } else {
        if (Prelude_otherwise()) {
          x8 = new Array("(,)",new Array("[]"),new Array(":",x9[1],x9[2]));
        } else {
          x8 = alertFailed();
        }
      }
      break;
  }
  return x8;
}

function Prelude__2E(x1,x2) {
  return function(x6) { return Prelude__2E_2E_5F_23lambda1(x1,x2,x6);} ;
}

function Prelude_span_2E_5F_23selFP12(x1) {
  return x1[1];
}

function Prelude_span_2E_5F_23selFP13(x1) {
  return x1[2];
}

function Prelude_otherwise() {
  return true;
}

function Prelude__2E_2E_5F_23lambda1(x1,x2,x3) {
  return x1(x2(x3));
}

var LazyStringConversion = true;

//----------------------
// Primitives for JavaScript compilation:

// higher-order application (in case of explicitApply):
function apply(f,e) {
  var missing = f[1];
  if (missing>1) {
    r = new Array();
    r[0] = f[0];
    r[1] = missing-1;
    for (var i = 2; i < f.length; i++) r[i] = f[i];
    r[i] = e;
    return r;
  } else {
    return fullapply(f,e);
  }
}

// applying a partial constructor application to its last argument
// (in case of explicitApply):
function fullconsapply(f,e) {
  r = new Array();
  r[0] = f[0];
  for (var i = 2; i < f.length; i++) r[i-1] = f[i];
  r[i-1] = e;
  return r;
}

// boolean equality:
function boolEq(x1,x2) {
  switch (typeof(x1)) {
  case "number" : return (x1==x2);
  case "boolean" : return (x1==x2);
  case "string" : if (typeof(x2)=="string") { return (x1==x2); }
		      else { return boolEq(string2characterlist(x1),x2); }
  case "object" :
    if (typeof(x2)=="string") { x2 = string2characterlist(x2); }
    var eq = true;
    for (var i =0 ; eq && i < x1.length ; i++) eq = boolEq(x1[i],x2[i]) ;
    return eq;
  default : alert("Internal error: Unhandled type "+typeof(x1)+" in boolEq!");
  }
}

// Implementation of Prelude.div
function preludeDiv(x,y) { return (x - (x % y)) / y; }

// Implementation of Prelude.ord
function preludeOrd(s) { return s.charCodeAt(0); }

// Implementation of Prelude.char
function preludeChr(n) { return String.fromCharCode(n); }

// failed (should not occur in correctly translated programs!)
function alertFailed() {
  alert("Internal error: Failure occurred!");
}

// Transform a standard string into a (lazy) list-of-character representation,
// i.e., only the first cons of the list is built
function string2charlist(s) {
  if (s == "") {
    return new Array("[]");
  } else {
    return new Array(":",s.charAt(0),s.substring(1));
  }
}

// Transform a standard string into a list-of-character representation
function string2characterlist(s) {
  var len = s.length;
  var i = s.length;
  var tail = new Array("[]");
  while (i>0) {
    i-- ;
    tail = new Array(":",s.charAt(i),tail);
  }
  return tail;
}

//----------------------
//----------------------
// Prelude for inclusion into WUI scripts:

var AllowSubmission = true;

// check whether submission is possible:
function submissionAllowed() {
  if (!AllowSubmission) {
    alert("Submission not possible due to errors in input fields!");
  }
  return AllowSubmission;
}

// Boolean conjunction (similar to && but evaluate both arguments
// due to strictness)
function And(b1,b2) { return b1 && b2 }

// Get integer value of a string element with a given name:
function intValueOf(ElemName) {
  return parseInt(document.getElementsByName(ElemName)[0].value) ;
}

// Get string value of an element with a given name:
function stringValueOf(ElemName) {
  if (LazyStringConversion) { // defined by Curry2JS translator
    return document.getElementsByName(ElemName)[0].value ;
  } else {
    return string2characterlist(document.getElementsByName(ElemName)[0].value) ;
  }
}

// Get integer value of a selection element with a given name:
function selectValueOf(ElemName,ValueField) {
  return ValueField[parseInt(document.getElementsByName(ElemName)[0].value)] ;
}

// Get Boolean value of a check box element with a given name:
function checkBoxValueOf(ElemName) {
 return document.getElementsByName(ElemName)[0].checked ;
}


// Show or hide the error message in a WUI element by modifying the CSS
// style class depending on the Boolean value
// of the second argument, and return the Boolean value:
function setErrorClassName(ElemName,b) {
  var field = document.getElementById(ElemName);
  var errmsgfield = document.getElementById("MSG_"+ElemName);
  if (b) {
    if (errmsgfield) { errmsgfield.className = "wuihide"; }
    if (field) { field.className = "wuipassiveerrmsg"; }
  } else {
    if (errmsgfield) { errmsgfield.className = "wuinohide"; }
    if (field) { field.className = "wuiactiveerrmsg"; }
  }
  return b;
}

// Hide the error message in a WUI element and return true:
function unsetErrorClassName(ElemName) {
  var field = document.getElementById(ElemName);
  var errmsgfield = document.getElementById("MSG_"+ElemName);
  if (errmsgfield) { errmsgfield.className = "wuihide"; }
  if (field) { field.className = "wuipassiveerrmsg"; }
  return true;
}

// Return input string without prefix and suffix white spaces
function stripWhiteSpaces(s) {
  var len = s.length;
  var start = 0;
  var stop  = len;
  while (start < len && s.charAt(start) == ' ') { start++ ; }
  while (stop > start && s.charAt(stop-1) == ' ') { stop-- ; }
  return s.substring(start,stop);
}

// Contains an element an integer string?
function parseIntCheck(ElemName) {
  var elem = document.getElementsByName(ElemName)[0];
  var elemstr = stripWhiteSpaces(elem.value);
  var i = 0;
  var c;
  if (elemstr == "") { return false; }
  if (elemstr.charAt(0) == "-") { i++; }
  while (i < elemstr.length) {
    c = elemstr.charCodeAt(i);
    if (c<48 || c>57) { return false; }
    i++;
  }
  return true;
}

// Is a string not empty?
function notEmpty(s) { return (s != "") ; }


// Transform an array into a list representation:
function array2list(a) { return array2listi(a,0); }

function array2listi(a,i) {
  if (i > a.length) { alert("Internal error in array2list"); }
  if (i == a.length) {
    return new Array("[]");
  } else {
    return new Array(":",a[i],array2listi(a,i+1));
  }
}

//----------------------
