﻿/// <reference path="../jQuery-vsdoc.js" />

function login(type)
{
    var username=$("#username").val();
    var pwd=$("#pwd").val();
    if($.trim(username)==""||$.trim(pwd)=="")
    {
        if(type)
        {
        alert("User name and password can not be empty!");
        }else{
        alert("用户名和密码不能为空！");
        }
        return ;
    }else
    {
      $.ajax({
        url: "/common/ajax.aspx",
        type: "GET",
        cache: false,
        dataType: "text",
        data: { action: "chklogin", username: escape($.trim($("#username").val())), pwd: escape($.trim($("#pwd").val())) },
        success: function(transport) {
            if (transport == "1") {
                window.location.href = "/cn/";
            }
            else {
                if(type){
                    alert("User name or password error!");
                }else{
                    alert("用户名或密码错误或未通过审核!");
                }
            }
        }
    });
    }
}

function subshow(pid)
{
    $(".menu ul ul").hide();
    $("#sub_"+pid).show();
}

function show()
{
    //$("#productsleft").show();
}
