﻿// JScript 文件
$(document).ready(function(){	
	$("#slider").easySlider({
		controlsBefore:	'<p id="controls">',
		controlsAfter:	'</p>',
		auto: true, 
		continuous: true
	});
			
});

$(window).ready(function(){
	jQuery("#navigation").Smartmenu();
});

$(function () {
			var tabContainers = $('div.tabs > div');
			tabContainers.hide().filter(':first').show();
			
			$('div.tabs ul.tabNavigation a').hover(function () {
				tabContainers.hide();
				tabContainers.filter(this.hash).show();
				$('div.tabs ul.tabNavigation a').removeClass('selected');
				$(this).addClass('selected');
				return false;
			}).filter(':first').hover();
		});
		
function MLDL(){
    var MLN = $.trim($("#txtuserid").val());
    var MLP = $.trim($("#txtpwd").val());
    if(MLN == ""){
        alert("请输入用户名");
        $("#txtuserid").focus();
        return;
    }
    if(MLP == ""){
        alert("请输入密码");
        $("#txtpwd").focus();
        return;
    }
    $.ajax({
            type:"get",
            dataType:"json",
            url:"ashx/hl.ashx?type=userlogin&username="+MLN+"&userpwd="+MLP+"&times="+new Date().getTime(),
            error:function(){alert("系统错误");},
            success:function(json){
                if(json.result=="ok"){
                    $(".userlogin").html("");
                    $(".userlogin").html("欢迎：<font color='red'>"+MLN+"</font>&nbsp;&nbsp;&nbsp;<a href='user/main.aspx' style='color:blue; text-decoration:underline;'>进入会员中心</a>");
                }
                else{
                    alert("对不起，您输入的用户名跟密码不匹配！")
                    $("#txtuserid").val(""); $("#txtpwd").val("");
                    }
            }
        });
}

function ZCPD(u_name){
    if(u_name == ""){
        $(".uid_tip").html("5-15位 a-z;A-Z;0-9的字母数字组合");
        $(".uid_tip2").html("");
        return;
    }
    $.ajax({
            type:"get",
            dataType:"json",
            url:"ashx/hl.ashx?type=judge_username&username="+u_name+"&times="+new Date().getTime(),
            error:function(){alert("系统错误");},
            success:function(json){
                if(json.result=="1"){
                    $(".uid_tip").html("<font color='red'>× 该用户名已经存在,请重新输入!</font>");
                    $(".uid_tip2").html("1");
                }
                else{
                    $(".uid_tip").html("<font color='green'>√ 恭喜你,该用户名可用</font>");
                    $(".uid_tip2").html("");
                    }
            }
        });
}
