function showliuyanok(){ popwin=document.getElementById("popwin_bg_tran"); if (popwin==null){ }else{ alert("鐣欒█鎻愪氦鎴愬姛銆?); close_popwin(); } $(".lyokshowPhone").show(); $(".lyokhidePhone").css('display', 'none'); $("#divshowok").css('display', 'block'); $("#divliuyan").css('height', $("#divshowok").height()-4); repostion(); } function hideliuyan(){ $("#divliuyan").fadeOut(150, function(){ $("#divliuyan").css('height', $("#divdoshow").height()-4); repostion(); $("#divdoshow").css('display', 'block'); $("#divliuyan").fadeIn(150); }); } function showliuyan(){ $("#divliuyan").fadeOut(150, function(){ $("#divdoshow").css('display', 'none'); $("#divliuyan").css('height', 370); repostion(); $("#divliuyan").fadeIn(150); }); } function repostion(){ scTop=$(window).scrollTop(); cWidth=$(window).outerWidth(); cHeight=$(window).outerHeight(); $("#divliuyan").css('top', cHeight+scTop-$("#divliuyan").height()-12); $("#divliuyan").css('left', cWidth-$("#divliuyan").width()-8); } //AJAX Start var Try = { these: function() { var returnValue; for (var i = 0; i < arguments.length; i++) { var lambda = arguments[i]; try { returnValue = lambda(); break; } catch (e) {} } return returnValue; } } var getTransport = function() { return Try.these( function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')}, function() {return new XMLHttpRequest()} ) || false; } function JAX(url, parameters) { var req = getTransport(); if (parameters) { req.open('POST', url, false); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.send(parameters); } else { req.open('GET', url, false); req.send(null); } if (req.status == 200) { return req.responseText; } else { return null; } } //AJAX End /*妫€娴嬪瓧绗︿覆鎵€鍗犵殑瀛楄妭鏁?/ function mbStringLength(s) { var totalLength = 0; var i; var charCode; for (i = 0; i < s.length; i++) { charCode = s.charCodeAt(i); if (charCode < 0x007f) { totalLength = totalLength + 1; }else if ((0x0080 <= charCode) && (charCode <= 0xffff)) { totalLength += 2; } } return totalLength; } function submitMsgFormByID(formid){ var leavetype = 0; leavetyperadio=document.getElementsByName("leavetype"); for (var i=0;i30){ alert("璇锋纭~鍐欐偍鐨勫鍚?); document.getElementById("CName").focus(); } else if(tel=="") { alert("璇峰~鍐欐偍鐨勮仈绯荤數璇?); document.getElementById("Phone").focus(); } else if(mbStringLength(tel)>150) { alert("璇锋纭~鍐欐偍鐨勭數璇?); document.getElementById("Phone").focus(); } else if(company=="") { alert("璇峰~鍐欐偍鐨勫崟浣?鍏徃"); document.getElementById("GuestType").focus(); }else if(mbStringLength(company)>150) { alert("鎮ㄧ殑鍗曚綅/鍏徃鍚嶇О涓嶈兘瓒呰繃75涓眽瀛楁垨鑰?50涓瓧绗?); document.getElementById("GuestType").focus(); }else if(ly=="") { alert("璇峰~鍐欐偍鐨勭暀瑷€鍐呭"); document.getElementById("Content").focus(); }else if(mbStringLength(ly)>3000) { alert("鎮ㄧ殑鐣欒█鍐呭涓嶈兘瓒呰繃1500涓眽瀛楁垨鑰?000涓瓧绗?); document.getElementById("Content").focus(); }else if (email!="" && mbStringLength(email)>150) { alert("璇锋纭~鍐欐偍鐨勯偖绠?); document.getElementById("Email").focus(); } else { //$("#diverrormsg").html("姝e湪鎻愪氦锛岃绋嶅€?...."); var aoptions = { url: "/img/pub/addLeaveword_ajax.php", type:"POST", dataType:'text', cache: false, clearForm:false, restForm:false, success: function (result) { if (result=="ok") //$("#msgbtn").removeAttr("disabled"); showliuyanok(); else //$("#diverrormsg").html(base64DecodeUTF8(result.info)); alert(result); } }; $("#"+formid).ajaxSubmit(aoptions); } } function submitMsgForm(){ submitMsgFormByID('lw_single'); }