﻿
//<%-- Prakhar Vyas--%>
function MakeUpper(obj)
{
    obj.value=obj.value.toUpperCase();
}

function mzero(Obj)
{
    Obj.value = "";
    return false;
}
           
function IsAlpha(txtvalue)
{
    var numaric = txtvalue.value ;
    for(var j=0; j<numaric.length; j++)
    {
        var alphaa = numaric.charAt(j);
        var hh = alphaa.charCodeAt(0);
        if((hh > 64 && hh < 91) || (hh > 96 && hh < 123) || (((numaric.charAt(0)).charCodeAt(0)!= 32) && (hh==32)) || (hh==46))
        {
        }
        else        
        {
            txtvalue.focus(); 
            txtvalue.value = ""; 
            alert('Please Insert [a-z] only number are not allowed!');
            return false;
        }
    }
    return true;
}





function IsNumeric(Obj)
{
    if(Obj.value != "")
    {
        if(isNaN(Obj.value))
        {
            alert("Please Enter Numeric Value");
            Obj.value = "";
            Obj.focus();
            return false;
        }
        else
        {
            return true;
        }    
    }
}




//function CheckMobileNo(obj)
//{
//    var a=obj.value;
//    if(((a.length > "0") && (a.length < "10")) || ((a.length == "11") && ((a.charAt(0)!= "0") || (a.charAt(1)!= "9" ))) || ((a.length == "10") && (a.charAt(0)!= "9")))
//    {
//        alert("Please Enter correct Mobile No");
//        a.value="";  
//        a.focus();
//        return false;
//    }
//    else
//    {
//        return true;
//    }
//}

            
            function CheckMobileNo(obj)
            {
                var a=obj.value;
                if(((a.length > "0") && (a.length < "10")) || ((a.length == "11") && (a.charAt(0)!= "0")) || ((a.length == "11") && (a.charAt(0)== "0") && (a.charAt(1)< "8")) || ((a.length == "10") && (a.charAt(0)< "8")))  
                {
                    alert("Please Enter correct Mobile No");
                    obj.value="";  
                    obj.focus();
                    return false;
                }
                else
                {
                    return true;
                }
            }




function ChkPhoneNo(obj)
{
    var c=obj.value;
    if((c.length > "0") && (c.length < "6"))
    {
        alert("Please Enter correct Phone No");
        c.value="";
    c.focus();
        return false;
    }
    else if((c.length == "6") && (c.charAt(0)!= "2"))
    {
        alert("Please Enter correct Phone No");
        c.value="";
    C.focus();
        return false;
    }
    else
    {
        return true;
    }
}



function invalidemail(s)
{
    res=0;
    len=s.length;
    for(i=0;i<len;i++)
    { 
        if(s.charAt(i)=='@' )
        for(j=i;j<len;j++)
        {
           if(s.charAt(j)=='.')
           res=1;
        }
    }  
    if (res==0)
    return true; 
    else
    return false; 
   
}



 function chkmail(obj)
{
    var str = obj.value;
    var at="@";
    var dot=".";
    var lat=str.indexOf(at);
    var lstr=str.length;
    var ldot=str.indexOf(dot);
    if(obj.value=="")
    {
        alert("Please Enter Ur EmailID");
        obj.value="";
        obj.focus();
        return false;
    }
    else
    {
        if ((lat==-1 || lat==0 || lat==lstr) || (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr-1 || str.indexOf(dot)==lstr-2) || (str.indexOf(at,(lat+1))!=-1) || (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) || (str.indexOf(dot,(lat+2))==-1) || (str.indexOf(" ")!=-1))
        {
            alert("Please Enter Valid Email");
            obj.value="";
            obj.focus();
            return false;
        }
        else
        {
            return true;
        }
    }
    
		 
}
