function sendFeedbackMessage(){var C=$("feedbackFromAddress");var A=true;if(C!=null&&C!=""){A=isValidFromEmailAddress(C.value,C)}if(A){var B=$F("feedbackMessage");if(B==null||B==""||B==" "){alert('Oops! No message entered. Please enter your feedback in the "Message" box below');$("feedbackMessage").focus()}else{sendFeedbackRequest()}}}function sendFeedbackRequest(){var A="SendFeedback";var B=Form.serialize("feedbackForm")+"&outxx=xml&r="+getRandomNumber();new Ajax.Request(A,{method:"post",parameters:B,onSuccess:processFeedbackRequest,onFailure:failure,onException:exception})}function processFeedbackRequest(E){var B=E.responseXML;var A=B.getElementsByTagName("success")[0];var G=A.firstChild.nodeValue;if(G=="true"){$("feedbackErrorMessageContainer").style.display="none";$("feedbackHeader").style.display="none";$("feedbackForm").style.display="none";$("feedbackThankYou").style.display="block"}else{if(G=="false"){var C=B.getElementsByTagName("failureReason")[0];var H=C.firstChild.nodeValue;var D="Sorry, but";if(H=="no message"){D+=' we did not receive your message. Please enter text in the "Message" box below.';$("feedbackMessage").focus}else{if(H=="message too large"){D+=" your message is too long. Please try to reduce its size.";$("feedbackMessage").focus}else{if(H=="subject too large"){D+=" your subject is too long. Please try to reduce its size.";$("feedbackSubject").focus}else{if(H=="from address too large"){D+=" your email address is too long.";$("feedbackFromAddress").focus}else{D+=" an error occurred. We did not receive your feedback."}}}}var F=$("feedbackErrorMessageContainer");F.innerHTML=D;F.style.display="block"}}}function isValidFromEmailAddress(B,A){if(!isEmailAddressValid(B)){alert("Sorry, but the email address you entered is not valid.\nRemember, for feedback, an email address is optional. ");A.focus();return false}return true}function initFeedback(){setFeedbackFromEmailAddress();var A=getValueFromCookie("uid");if(A!=null&&A!=""){$("feedbackSubject").focus()}else{$("feedbackFromAddress").focus()}}function setFeedbackFromEmailAddress(){populateUserEmailAddress("feedbackFromAddress")};