// File: b_contact_us_1013.js

g_contact_us=new Array();g_contact_us.click=function(){var C=encodeURIComponent(document.getElementById("name").value);var B=encodeURIComponent(document.getElementById("email").value);var H=encodeURIComponent(document.getElementById("username").value);var D=encodeURIComponent(document.getElementById("subject").value);var F=encodeURIComponent(document.getElementById("msg").value);if(F==""){this._display_error("please type your message in full before submitting.");return false}var A="/contact_us_process.json";var G={success:this._json_response,failure:this._json_failed,scope:this};var E="name="+C+"&email="+B+"&username="+H+"&subject="+D+"&msg="+F;g_trace.log("about to send this off - "+E);YAHOO.util.Connect.asyncRequest("POST",A,G,E);return false};g_contact_us._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_contact_us._json_failed=function(A){alert("Cannot communicate with the FlickAway website.  Please check your internet connection.")};g_contact_us._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 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_contact_us._display_error=function(A){document.getElementById("error").innerHTML=A;g_board.adjust()};g_contact_us._hide_error=function(){document.getElementById("error").innerHTML="";g_board.adjust()};g_contact_us._json_success=function(A){window.location="/contact_done.html"};g_events.add("send","onclick",g_contact_us.click,g_contact_us);
