 function opencat(cat,img){	
 if(cat.style.display=="none")
 {	cat.style.display="";	
 img.src="images/class2.gif";	}	
 else 
 {	cat.style.display="none"; 	
 img.src="images/class1.gif";	
 }}

//文本框清空
function myckhelogin()
{
document.getElementById("LoginName").value="";
document.getElementById("Password").value=""
document.getElementById("LoginName").focus();
}
//登录用户验证
function CheckLoginForm()
{
if(document.formLogin.LoginName.value=="")
{
alert("请输入用户名！");
document.formLogin.LoginName.focus();
return false;
}
if(document.formLogin.LoginPassword.value == "")
{
alert("请输入密码！");
document.UserLogin.LoginPassword.focus();
return false;
}
document.formLogin.submit();
}
//**login*******************/

//验证码改变方法
function refreshimg()
{
document.getElementById("checkcodes").src="../Include/CheckCode/CheckCode.Asp?seed="+Math.random();
}
var prev;
function showCon(obj) {
    if (prev != null) {
        document.getElementById("con" + prev).style.display = "none";
        document.getElementById("m" + prev).className = "pa";
    }
    document.getElementById("con" + obj).style.display = "block";
    document.getElementById("m" + obj).className = "paA";
    prev = obj;
}

//找回密码 
function getpassword()
{
	window.open('MemberGetPass.Asp')
}

//图片处理
function DrawImage(MyPic, W, H) {
    var flag = false;
    var image = new Image();
    image.src = MyPic.src;
    if (image.width > 0 && image.height > 0) {
        flag = true;
        if (image.width / image.height >= W / H) {
            if (image.width > W) {
                MyPic.width = W;
                MyPic.height = (image.height * W) / image.width;
            }
            else {
                MyPic.width = image.width;
                MyPic.height = image.height;
            }
        }
        else {
            if (image.height > H) {
                MyPic.height = H;
                MyPic.width = (image.width * H) / image.height;
            }
            else {
                MyPic.width = image.width;
                MyPic.height = image.height;
            }
        }
    }
}
