// File: b_sign_in_help_1543.js

g_sign_in_help=new Array();g_sign_in_help.init=function(A){this.menu=A};g_sign_in_help.on_load=function(){g_trace.log("sign in help on_load");g_events.add("submit","onclick",this._click,this)};g_sign_in_help._click=function(){var B=document.getElementById("email").value;var E=document.getElementById("username").value;if(B!=""&&E!=""){alert("Please enter an email OR a username.  Not both.  Please clear one field before submitting.");return false}var A="/sign_in_help_process.json";var D={success:this._json_response,failure:this._json_failed,scope:this};var C="email="+encodeURIComponent(B)+"&username="+encodeURIComponent(E);g_trace.log("about to send this off - "+C);YAHOO.util.Connect.asyncRequest("POST",A,D,C);return false};g_sign_in_help._json_response=function(o){g_trace.log("transaction id = "+o.tId);g_trace.log("o.status = "+o.status);g_trace.log("o.statusText = "+o.statusText);g_trace.log("o.getResponseHeader[ ] = "+o.getResponseHeader);g_trace.log("o.getAllResponseHeaders = "+o.getAllResponseHeaders);g_trace.log("o.responseText = "+o.responseText);g_trace.log("o.responseXML = "+o.responseXML);g_trace.log("o.argument = "+o.argument);if(o.responseText.substr(0,1)!="{"){g_trace.log("ERROR response - o.responseText = "+o.responseText);var resp={status:6}}else{eval("var resp="+o.responseText)}if(resp.status==0){this._json_success()}else{this._handle_bad_json_resp(resp)}};g_sign_in_help._json_failed=function(A){alert("Cannot communicate with the FlickAway website.  Please check your internet connection.")};g_sign_in_help._handle_bad_json_resp=function(A){this._hide_error();if(!A.status){g_trace.log("resp.status not present");A.status=6}switch(A.status){case 0:break;case 3:alert("This request was invalid.  It has been reported and we be investigated.  Please try again later.");break;case 14:alert("You are already signed-in");break;case 15:this._display_error("there is no account with that email address");break;case 16:this._display_error("there is no account with that username");break;case 4:default:alert("We're sorry!  There was an error during processing of this request (err: "+A.status+").  It has been reported and will be investigated.  Please try again later.");break}};g_sign_in_help._display_error=function(A){document.getElementById("error").innerHTML=A;g_board.adjust()};g_sign_in_help._hide_error=function(){document.getElementById("error").innerHTML="";g_board.adjust()};g_sign_in_help._json_success=function(A){alert("Your sign-in details have been emailed to you.");window.location="/sign_in.html"};g_events.add("window","ondomload",g_sign_in_help.on_load,g_sign_in_help);
