系統發信發生錯誤,您將不會收到諮詢確認信',callback:{close:function(){frm_cont.f_reset();}}},'msg_add_ok':{txt:'資料送出完成,我們將會儘快與您聯絡,謝謝',callback:{close:function(){frm_cont.f_reset();}}}};var msg=[];for(var i in res){if(errMsg[i]){msg.push(errMsg[i]);}}if(msg.length>0){msg.unshift('下列欄位錯誤');set_dialog('alert',{txt:msg});return;}for(var i in res){if(errMsg2[i]){var myType=errMsg2[i]['type']||'alert';set_dialog(myType,errMsg2[i]);return;}}return;}jQuery(document).ready(function(){jQuery('.inputBox input').focus(function(){jQuery(this).parents('.inputBox').css('background-position','0 0');});jQuery('.inputBox input').blur(function(){jQuery(this).parents('.inputBox').css('background-position','0-32px');});jQuery('.inTextArea textarea').focus(function(){jQuery('.inW83').css('background-position','0 0');jQuery(this).parents('.inTextArea').css('background-position','0 0');});jQuery('.inTextArea textarea').blur(function(){jQuery('.inW83').css('background-position','0-32px');jQuery(this).parents('.inTextArea').css('background-position','0-112px');});jQuery('.inW162 input').focus(function(){jQuery('.inW107').css('background-position','0 0');jQuery('.inW107 img').removeClass('imgBlack');});jQuery('.inW162 input').blur(function(){jQuery('.inW107').css('background-position','0-32px');jQuery('.inW107 img').addClass('imgBlack');});frm_cont={res:{},_form:$('#contact_form'),_name:$('input[name=name]'),_mail:$('input[name=mail]'),_phone:$('input[name=phone]'),_fax:$('input[name=fax]'),_company:$('input[name=company]'),_txt:$('textarea[name=txt]'),_img:$('#check_code'),_code:$('input[name=check_code]'),_submit:$('#btnSubmit'),f_reset:function(){this._form[0].reset();this._img.click();return false;},init:function(){var that=this;this._form.attr('method','post');this._img.click(function(){$(this).attr('src','security_image.php?sys=contact&'+Math.random());}).css('cursor','pointer');this._submit.click(function(){that.checkForm();return false;});this._form.submit(function(){return false;});return false;},checkForm:function(){this.res={};if(!this._code.val())this.res.code=true;if(!this._name.val())this.res.name=true;if(!this._phone.val())this.res.phone=true;if(!this._company.val())this.res.company=true;if(!this._mail.val()||!check_mail(this._mail.val()))this.res.mail=true;if(!this._txt.val())this.res.txt=true;if(!object_empty(this.res)){ajax_msg(this.res);return false;}set_dialog('process',{txt:'程式執行中,請稍候...',timeout:32000});$.setAjax('ajax_contact.php',this._form.serialize());return false;}};frm_cont.init();});