﻿
    function windowOpen()
    {
    window.open("RegisterUser.aspx",'MyWindow33','toolbar=no,height=320px,width=460px,location=no,top=110px,left=130px,directories=no, status=no,menubar=no,scrollbars=yes,resizable=no');
    return false;
    }
	function openwindow()
	{
	var url=document.getElementById("lblDomain");
	window.open('http://'+url.innerText,'domain','');
	return false;
	}
	function validateLogin()
	{
	
	var id=document.getElementById("txtUserName");
	var pwd=document.getElementById("txtPassword");
	
	if(id.value=="")
	{
	alert("User name can't be blank.");
	id.focus();
	return false;
	}else
	if(pwd.value=="")
	{
	alert("Password can't be blank.");
	pwd.focus();
	return false;
	}
	}
	
	function opneForgetPwd()
	{
	var tblForget=document.getElementById("dvforgotpwt");
	tblForget.style.display="block";
	return false;
	}
	
	function closeForgetPwd()
	{
	var tblForget=document.getElementById("dvforgotpwt");
	tblForget.style.display="none";
	return false;
	}






    function validateuid()
    {
    
    var uid=document.getElementById("txtLoginId");
    var st=document.getElementById("status");
    //alert(uid.value.length);
    if(uid.value.length==0)
    {
    st.style.backgroundColor="white";
    st.style.color="white";
    uid.focus();
    return false;
    }else
    if(uid.value.length<=5)
    {
    st.style.backgroundColor="red";
    st.style.color="white";
    st.style.width="50px";
    st.innerText="Week";
    uid.focus();
    return false;
    }else
    if((uid.value.length==5)||(uid.value.length<=8))
    {
    st.style.backgroundColor="Green";
    st.style.color="white";
    st.style.width="80px";
    st.innerText="Good";
    uid.focus();
    return false;
    }else
    if((uid.value.length>=8)||(uid.value.length>=15))
    {
    st.style.backgroundColor="Blue";
    st.style.color="white";
    st.style.width="100px";
    st.innerText="Strong";
    uid.focus();
    return false;
    }
    
    
    }
    
    
    
    
    
   
// For Blank And Email Validation :- Start //
function validateAddDraft()
{
 var to=document.getElementById('ctl00_ContentPlaceHolder1_txtTo');
 if(to.value=="")
    {
	    alert("Please Enter E-Mail Id.");
	    to.focus();
	    return false;
    }
var e=document.getElementById('ctl00_ContentPlaceHolder1_txtTo').value; 
var j=e.indexOf("@");
var k=e.indexOf("."); 
if(j==-1 || k==-1)
    {
       alert("Enter Valid E-Mail Id.");
       document.getElementById('ctl00_ContentPlaceHolder1_txtTo').focus();  
       return false;
    }
    var ch=confirm('Do You Want To Send Msg Without Any Subject!');
                if(ch==true)
                    {
                        {}
                    }
                else
                {return false; }    
}
// For Blank  And Email Validation :- End //


  	// Validation For Description Counting :- Start //
    function CountText()
    {
     var len=document.getElementById("ctl00_ContentPlaceHolder1_txtDescription").value;
        if(len.length==300)
        {
            var k=window.event.keyCode;
            if((k>33&&k<38) || k==8 || k==13 || k==46)
                {}
            else
                {
                alert("You can't enter more than 300 characters.");
                window.event.returnValue=false;
                document.getElementById("txtText").value
                }
        }
        else
        {
        document.getElementById("txtText").value=300-len.length-1;
        }
    }
    // Validation For Deascription Counting :- End //
   
   
   
   
   
   
   
function NumericOnly()
    {
        var key = window.event.keyCode; 
        if (key <48 || key >57 )
            {
                window.event.returnValue = false;
                alert('Enter Number Only'); 
            }
    }
    
function ValidateText(i) 
    {
    if(i.value.length>0) 
    {
    i.value = i.value.replace(/[^\d]+/g, ''); 
    }
    }
	
function validateUser()
{

var uName=document.getElementById("txtUserName");

var fName=document.getElementById("txtFirstName");
var lName=document.getElementById("txtLastName");
var eMail=document.getElementById("txtEmail");
var mobile=document.getElementById("txtMobile");
var city=document.getElementById("ddlCity");
var state=document.getElementById("ddlState");
var country=document.getElementById("ddlCountry");
if(uName.value=="")
{
alert("user name can't be blank.");
uName.focus();
return false;
}else
if(uName.value.length<=4)
{
alert("user name must be atleast 5 character");
uName.focus();
return false;
}else
if(eMail.value=="")
	  {
	  alert("email-Id can't be blank.");
	  eMail.focus();
	  return false;
	  }
	  var e=document.getElementById("txtEmail").value;   
                if(e.indexOf("@")==-1 || e.indexOf(".")==-1)
                {
                alert("please enter valid e-mailid");
                eMail.focus();
                return false;
                }else
if(mobile.value=="")
{
alert("mobile no. can't be blank.");
mobile.focus();
return false;
}else
 if(mobile.value.length<=9)
  {
  alert("mobile no. must be 10 digit with");
  mobile.focus();
  return false;
  }else
if(city.value=="Select")
{
alert("city can't be blank.");
city.focus();
return false;
}else
if(state.value=="Select")
{
alert("please select state.");
state.focus();
return false;
}else
if(country.value=="Select")
{
alert("please select country.");
country.focus();
return false;
}

}

