﻿function UserLoginCheck()
{
    if(document.getElementById("right1_txt_UserName").value == "")
    {
        alert("Please fill in your e_mail address.");
        return false;
    }
    var username = document.getElementById("right1_txt_UserName").value;
    var EmailReg=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
    if(!EmailReg.test(username))
    {
        alert("Your e_mail address is invalid.");
        return false;
    }
    if(document.getElementById("right1_txt_Password").value == "")
    {
        alert("Please fill in your password.");
        return false;
    }
    return true
}
function IsLoginOk()
{
    if(UserLoginCheck())
    {
       __doPostBack('right1$lb_Login','')
    }
}

function txt_UserName_Focus()
                        {
                        var txt_UserName=document.getElementById("right1_txt_UserName");
                            if(txt_UserName.value=="Email/UserName")
                            {
                                txt_UserName.value="";
                                txt_UserName.style.color="#000000";
                            }
                        }
                        function txt_Password_Focus()
                        {
                        var txt_UserName=document.getElementById("right1_txt_UserName");
                        var txt_Password=document.getElementById("right1_txt_Password");
                            if(txt_Password.value=="Password")
                            {
                                txt_Password.style.color="#000000";
                                txt_Password.value="";
                            }
                        }
                        
                        function txt_UserName_Blur()
                        {
                            var txt_UserName=document.getElementById("right1_txt_UserName");
                            if(txt_UserName.value=="")
                            {
                                txt_UserName.value="Email/UserName";
                                txt_UserName.style.color="#656D77";
                            }
                        }
                        function txt_Password_Blur()
                        {
                            var txt_Password=document.getElementById("right1_txt_Password");
                            if(txt_Password.value=="")
                            {
                                txt_Password.value="Password";
                                txt_Password.style.color="#656D77";
                            }
                        }
