var FrontPublic_recommendToFriend01={hasSpecSymbol_name:function(A){return specialCharactersCheck(A)},getLocalHtml:function(){document.getElementById("action_page").value=window.location.pathname},checkFriendName:function(A,B){if(A[B]!=undefined){var C=trim(A[B].value);if(C==""||C.length<=0){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error1,B);return false}if(FrontPublic_recommendToFriend01.hasSpecSymbol_name(C)){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error3,B);return false}if(C.length>20){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error2,B);return false}FrontPublic_recommendToFriend01.hideError(B)}return true},checkFriendMail:function(A,C){if(A[C]!=undefined){var B=trim(A[C].value);if(B==""||B.length<=0){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error4,C);return false}if(B.length>50){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error5,C);return false}if(!isEmail(B,false)){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error6,C);return false}FrontPublic_recommendToFriend01.hideError(C)}return true},checkYourName:function(A,B){if(A[B]!=undefined){var C=trim(A[B].value);if(C==""||C.length<=0){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error7,B);return false}if(FrontPublic_recommendToFriend01.hasSpecSymbol_name(C)){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error3,B);return false}if(C.length>20){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error8,B);return false}FrontPublic_recommendToFriend01.hideError(B)}return true},checkYourMail:function(A,C){if(A[C]!=undefined){var B=trim(A[C].value);if(B==""||B.length<=0){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error9,C);return false}if(B.length>50){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error10,C);return false}if(!isEmail(B,false)){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error11,C);return false}FrontPublic_recommendToFriend01.hideError(C)}return true},checkSubject:function(A,B){if(A[B]!=undefined){var C=trim(A[B].value);if(C.length>50){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error12,B);return false}FrontPublic_recommendToFriend01.hideError(B)}return true},checkMessage:function(A,C){if(A[C]!=undefined){var B=trim(A[C].value);if(B.length>500){FrontPublic_recommendToFriend01.showError(i18n_frontpublic_recommendToFriend01_error13,C);return false}FrontPublic_recommendToFriend01.hideError(C)}return true},checkVerifyCode:function(A,C){if(A.length<=0){var D=document.getElementById("_verifyCodePrompt");var B=document.getElementById("_verifyCodeOK");D.style.display="inline";D.innerHTML="验证码为必填项,请填写。";B.style.display="none"}},checkVerifyCodeInput:function(A,B){var C=false;$.ajax({type:"post",dataType:"json",async:false,url:"/FrontPublic.do?method=checkVerifyCode",data:{verifyCodeInput:A},success:function(D){$.each(D,function(E,F){if(F=="wrong"){FrontPublic_recommendToFriend01.showError("验证码输入错误,请重新填写。","_verifyCode")}else{FrontPublic_recommendToFriend01.hideError("_verifyCode");C=true}})}});return C},checkAll:function(A){var B=true;var C=document.forms[A+"_recommendToFriendForm"];if(!FrontPublic_recommendToFriend01.checkFriendName(C,"_friendName")){B=false}if(!FrontPublic_recommendToFriend01.checkFriendMail(C,"_friendEmail")){B=false}if(!FrontPublic_recommendToFriend01.checkYourName(C,"_yourName")){B=false}if(!FrontPublic_recommendToFriend01.checkYourMail(C,"_yourEmail")){B=false}if(!FrontPublic_recommendToFriend01.checkSubject(C,"_subject")){B=false}if(!FrontPublic_recommendToFriend01.checkMessage(C,"_messages")){B=false}if(!FrontPublic_recommendToFriend01.checkVerifyCodeInput(C.verifyCode.value,"_verifyCode")){B=false}return B},submitForm:function(B){if(FrontPublic_recommendToFriend01.checkAll(B)){var C=document.getElementById(B+"_recommendToFriendForm");var A=(document.location).pathname;C.action="/FrontPublic.do?method=recommendToFriend01&compId="+B+"&directHtml="+A;C.submit()}},showError:function(A,D){var C=document.getElementById(D+"Message");var F=document.getElementById(D+"Prompt");var B=document.getElementById(D+"OK");var E=document.getElementById(D+"Remind");if(C){C.style.display="none"}if(E){E.style.display="none"}if(B){B.style.display="none"}if(F){F.style.display="inline";F.innerHTML=A}},hideError:function(C){var B=document.getElementById(C+"Message");var E=document.getElementById(C+"Prompt");var A=document.getElementById(C+"OK");var D=document.getElementById(C+"Remind");if(B){B.style.display="none"}if(E){E.style.display="none"}if(D){D.style.display="none"}if(A){A.style.display="inline"}},displayMessage:function(C){var B=document.getElementById(C+"Message");var E=document.getElementById(C+"Prompt");var A=document.getElementById(C+"OK");var D=document.getElementById(C+"Remind");if(B){B.style.display="none"}if(E){E.style.display="none"}if(A){A.style.display="none"}if(D){D.style.display="inline"}},close:function(){window.close()},goBack:function(A){document.location.href=A},goToPage:function(A){document.location.href=A}};