 document.write(unescape("%3Cscript src='script/zheng_inquiry-consult.js' type='text/javascript'%3E%3C/script%3E"));
$(document).ready(function () {
    $("#send").click(function () {
        var c = "";
        var b = false;
        var focusOfElt = '';
        if ($("#name").val().length == 0) {
            if(c.length==0) if($("#name").length > 0) { focusOfElt = $("#name")[0]; }            
            c += "請輸入姓名\n"
        }
        if ($("#email").val().length) {
            var a = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
            if (!$("#email").val().match(a)) { 
                if(c.length==0) if($("#email").length > 0) { focusOfElt = $("#email")[0]; }                                
                c += "電子信箱格式錯誤\n"
            }
        } else {         
            if(c.length==0) if($("#email").length > 0) { focusOfElt = $("#email")[0]; }                 
            c += "請輸入電子信箱\n"
        }
        $(".taipeiCourse").each(function () {
            if ($(this).attr("checked")) {
                b = true
            }
        });
        $(".tokyoCourse").each(function () {
            if ($(this).attr("checked")) {
                b = true
            }
        });
        if (!b) {  
            if(c.length==0) if($(".taipeiCourse").length > 0) { focusOfElt = $(".taipeiCourse")[0]; }                        
            c += "請選取至少一項台北講座或東京留學課程\n"
        }
        
        alertMsgOfCheck(c,focusOfElt);
                     
        return false;
    })
});