System error occurred writing,you will not receive confirmation Consulting',callback:{close:function(){frm_cont.f_reset();}}},'msg_add_ok':{txt:'Send complete information,we will contact you as soon as possible,thank you',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('The following fields error');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:'Program execution,please wait...',timeout:32000});$.setAjax('ajax_contact.php',this._form.serialize());return false;}};//name,phone,fax,company,mail,txt,code//contact_form 表單物件初始化 frm_cont.init();});