﻿// JScript 文件

function CheckInfo()
{
    if($F("txt_joinNum")=="")
    {        
        alert("please enter your Total Attendees!");
        $("txt_joinNum").focus();
        return false;
    }   
    if($F("txt_name")=="")
    {        
        alert("please enter your name!");
        $("txt_name").focus();
        return false;
    }
    if($F("txt_position")=="")
    {
        alert("Please enter your title!");
        $("txt_position").focus();
        return false;
    }
    if($F("txt_comp")=="")
    {
        alert("Please enter the name of your company!");
        $("txt_comp").focus();
        return false;
    }
    if($F("txt_tel")=="")
    {
        alert("Please let us know your contact number!");
        $("txt_tel").focus();
        return false;
    }        
    if($F("txt_mail")=="")
    {
        alert("Please let us know your email address!");
        $("txt_mail").focus();
        return false;
    }
    if($F("txt_mobile")!="")
    {
        if(isNaN($F("txt_mobile")))
        {
            alert("The number you entered is not correct, please check and reenter!");
            return false;
        }
    } 
    if(!validateEmail($F("txt_mail")))
    {
        alert("The email address is not correct, please let us know and reenter. thanks!");
        $("txt_mail").focus();
        return false;
    }
    return true;
}    
function ClearInfo()
{
    $("txt_joinNum").value="";
    $("txt_name").value="";
    $("txt_position").value="";
    $("txt_comp").value="";
    $("txt_mobile").value="";
    $("txt_country").value="";
    $("txt_tel").value="";
    $("txt_fax").value="";
    $("txt_mail").value="";
    $("txt_address").value="";
}
    
//判断输入的是否是数字
function checkIsNum(val,obj)
{
    if(isNaN(val))
    {
        alert('please enter number!');
        skipFocus(obj);
    }
}
function skipFocus(obj)
{
    var checkid=$(obj);
    checkid.value="";
}


function $(obj)
{
    return document.getElementById(obj);
}
function $F(obj)
{
    return $(obj).value;
}