var source = 1;
function val_Submit() {
    var province = $("#txt_Province").val();
    var city = $("#txt_City").val();
    var region = $("#txt_Region").val();
    var property = $('input:radio[name="radio_Property"]:checked').val();
    var service = $('input::checkbox:checked').val();
    var corporate = $("#txt_Corporate").val();
    var name = $("#txt_Contact").val();
    var mode = $("#txt_ContactMode").val();
    var email = $("#txt_Email").val();
    var IM = $("#txt_IM").val();
    var PageRowSources = document.referrer;
    var select_index = "";
    $("input:checkbox:checked").each(function() {
        select_index = select_index + $(this).val() + ',';
    })

    if ($.trim(province) == "" || $.trim(province) == "选择省份") {
        art.dialog({ time: 2, content: '请选择省份！' });
        return false;
    }
    if ($.trim(city) == "" || $.trim(city) == "选择城市") {
        art.dialog({ time: 2, content: '请选择城市！' });
        return false;
    }
    if ($.trim(region) == "" && $("select[id=sel_Region] option").size() > 1) {
        art.dialog({ time: 2, content: '请选择区域！' });
        return false;
    }
    /*
    if ($.trim(property) == "") {
    art.dialog({ time: 2, content: '请选择贵公司企业性质！' });
    return false;
    }
    if ($.trim(service) == "") {
    art.dialog({ time: 2, content: '请选择贵公司希望享受到以下哪些服务！' });
    return false;
    }
    */
    if ($.trim(corporate) == "") {
        art.dialog({ time: 2, content: '请输入您的企业名称！' });
        return false;
    }
    if (IsNumber(corporate) == true) {
        art.dialog({ time: 2, content: '企业名称不能全为数字！' });
        return false;
    }
    if ($.trim(name) == "") {
        art.dialog({ time: 2, content: '请输入联系人！' });
        return false;
    }
    if (IsNumber(name) == true) {
        art.dialog({ time: 2, content: '联系人不能全为数字！' });
        return false;
    }
    if ($.trim(mode) == "") {
        art.dialog({ time: 2, content: '请输入联系电话！' });
        return false;
    }
    /*
    if ($.trim(email) == "") {
    art.dialog({ time: 2, content: '请输入您的E-MAIL！' });
    return false;
    }
    if (IsEmail(email) == false) {
    art.dialog({ time: 2, content: 'E-MAIL格式不正确，请输入正确的E-MAIL格式，如xxx@xxx.com！' });
    return false;
    }
    if ($.trim(IM) == "") {
    art.dialog({ time: 2, content: '请输入您的QQ、阿里旺旺或MSN等！' });
    return false;
    }
    */
    var callback_GetResult = function(response) {
        if (response != '' && response != '0') {
            art.dialog({ time: 2, content: '提交成功，感谢您对一达通的大力支持！' });
            $("#txt_Corporate").val("");
            $("#txt_Contact").val("");
            $("#txt_ContactMode").val("");
            $("#txt_Email").val("");
            $("#txt_IM").val("");
        }
        else {
            art.dialog({ time: 2, content: '抱歉，提交失败！如有疑问，请联系一达通客户专员，感谢您对一达通的大力支持！' });
        }

        $("#btn_Submit").val("确认提交");
        $("#btn_Submit").attr("disabled", false)
    }

    $("#btn_Submit").val("提交中…");
    $("#btn_Submit").attr("disabled", true);

    $.get(
        '../../handle/ServiceApply.ashx',
        { r: Math.random(), province: province, city: city, region: region, property: property, service: select_index, corporate: corporate, name: name, mode: mode, email: email, IM: IM, source: source, PageRowSources: PageRowSources },
        callback_GetResult,
        'json'
      );

}
function ret_UserPass() {
    var pass = $.trim($("#pass").val());  
    var usid = $.trim($("#usid").val());
    $.ajax({
        type: "post",
        url: '../../cn/ajax.aspx',
        data: { type: pass, uname: usid },
        success: function(data) {          
            document.getElementById("EPass").value = data;            
        }
    })
}
function Check_User() {
    var usid = $.trim($("#usid").val());
    var pass = $.trim($("#pass").val());
    var mpass = $.trim($("#EPass").val());
    var txt_CheckCode = $.trim($("#CheckCode").val());
    var checkCode_org = $.cookie('ydt_CheckCode');
    if (usid == "") {
        art.dialog({ time: 2, content: '请输入用户名！' });
        return false;
    }
    if (pass == "") {
        art.dialog({ time: 2, content: '请输入密码！' });
        return false;
    }
    if (txt_CheckCode == '' ||txt_CheckCode == '请输入右边验证码' ||txt_CheckCode.toLowerCase() != checkCode_org.toLowerCase()) {
        $('#CheckCode').removeClass('tooltipinputok').addClass('tooltipinputerr');
        art.dialog({ time: 2, content: '验证码输入有误！' });
        return false;
    }
    if (mpass == "") {
        $.ajax({
            type: "post",
            url: '../../cn/ajax.aspx',
            data: { type: pass,uname:usid},
            success: function(data) {
            window.open("http://oop.onetouch.cn/default/login?UserName=" + usid + "&Password=" + data);
            }
        })  
       
    } else {
    window.open(" http://oop.onetouch.cn/default/login?UserName=" + usid + "&Password=" + mpass);
    }

}
function Check_User2() {
    var usid = $.trim($("#usidss").val());
    var pass = $.trim($("#passss").val());
    if (usid == "") {
        art.dialog({ time: 2, content: '请输入用户名！' });
        return false;
    }
    if (pass == "") {
        art.dialog({ time: 2, content: '请输入密码！' });
        return false;
    }
}

function Tag_Click(id) {
    $("#Li_Tag0").removeClass("selectTag")
    $("#Li_Tag1").removeClass("selectTag")
    $("#tagContent0").hide();
    $("#tagContent1").hide();
    $("#Li_Tag" + id).addClass("selectTag")
    $("#tagContent" + id).show();
}
function Change_Code() {
    var imgNode = document.getElementById("img_Validata");
    imgNode.src = "../../validate/Images.aspx?t=" + Math.random();
}