function submitContest() {
    violation = true;
    violString = "The following errors occurred on the form:\n\n";

    var name = document.getElementById("focusable").value;
    var email = document.getElementById("contestemail").value;
 
    if (name.length == 0) {
        violString += "- Your Name is a required field.\n";
        violation = false;
    }
    if (email.length == 0) {
        violString += "- Email is a required field.\n";
        violation = false;

    } else if (!echeck(email)) {
        violString += "- Email is an invalid format.\n";
        violation = false;
    }

    if (!violation) {alert(violString); return;}

    var xmlHTTP = getXMLHTTPObject();
    if (!xmlHTTP) {return false;}

    xmlHTTP.onreadystatechange=function() {
        if (xmlHTTP.readyState==4) {
            var responseText = xmlHTTP.responseText;
            var action = null;
            
            if (responseText.indexOf("<action>") != -1 && responseText.indexOf("</action>") != -1) {
                action = responseText.substring(responseText.indexOf("<action>") + 8, responseText.indexOf("</action>"));
                responseText = responseText.substring(responseText.indexOf("</action>") + 9);
            }

            if (action != null) {
                if (action == "ok") {
                    showPopup("/popups/greenmessage.jsp?messagetitle=Your entry was submitted!&messagebody=" + responseText);
                }

            } else {
                document.getElementById("popupmessage").style.visibility = 'visible';
                document.getElementById("popupmessage").innerHTML = responseText;
            }
        }
    }

    var date = new Date();
    var timestamp = date.getTime();

    var data = "name=" + cleanURL(name) + "&email=" + cleanURL(email);

    xmlHTTP.open("POST", "/marketplace/contestpopupsubmit.jsp?time=" + timestamp, true);
    xmlHTTP.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHTTP.send(data);
}




