function avoidTiltSign(e)
{
    var keynum;
    var keychar;
    var numcheck;

    if(window.event) // IE
	{
	    keynum = e.keyCode;
	}
    else if(e.which) // Netscape/Firefox/Opera
	{
	    keynum = e.which;
	}
    keychar = String.fromCharCode(keynum);
    numcheck = /\~/;
    if(keychar=="~")
    {
        //alert("You Cant Enter '~' operator");
        return !numcheck.test(keychar);
    }
}

function markAll(btn_chk,obj1)
{
    var checkboxCollection = document.getElementById(obj1).getElementsByTagName('input');
           
    for(var i=0;i<checkboxCollection.length;i++)
    {
        if(checkboxCollection[i].type.toString().toLowerCase() == "checkbox")
        {
            checkboxCollection[i].checked = btn_chk.checked;
        }
    }
}

function UncheckRadioList(objMain)
{
    var rdolstCollection = document.getElementById(objMain);

    for(var i = 0; i < rdolstCollection.length; i++)
    {
        if(rdolstCollection[i].checked)
        {
            rdolstCollection[i].checked = false;
        }
    }
    return false;
}
// To select and deselect iteams in a list box
function listBoxSelectAllIteam(listBoxID, chkObj) 
{
    var listbox = document.getElementById(listBoxID);
    //var checkbox = document.getElementById(chkObj);
    
    if(chkObj.checked)
    {
       for(var count=0; count < listbox.options.length; count++) 
       {
           listbox.options[count].selected = true;
       }
    }
    else
    {
       for(var count1=0; count1 < listbox.options.length; count1++) 
       {
           listbox.options[count1].selected = false;
       }
    }
}


// To Move selected iteam from one list box to another box
function listBoxIteamMovecross(sourceListBoxID, destListBoxID) 
{
    var src = document.getElementById(sourceListBoxID);
    var dest = document.getElementById(destListBoxID);
 
    for(var count=0; count < src.options.length; count++) 
    {
        if(src.options[count].selected == true) 
        {
              var option = src.options[count];
 
              var newOption = document.createElement("option");
              newOption.value = option.value;
              newOption.text = option.text;
              newOption.selected = true;
              try 
              {
                   dest.add(newOption, null); //Standard
                   src.remove(count, null);
              }
              catch(error) 
              {
                  dest.add(newOption); // IE only
                  src.remove(count);
              }
              count--;
        }
    }
}

function avoidSpecialCharacterAndSpace(e)
{
    var keynum;
    var keychar;
    
    if(window.event) // IE
	{
	    keynum = e.keyCode;
	}
    else if(e.which) // Netscape/Firefox/Opera
	{
	    keynum = e.which;
	}
	
    if(keynum == 32)
    {
        // Validation for " Space "
        //alert("You Cant Use 'Space'");
        return false;
    }
    else if(keynum > 32 && keynum < 46)
    {
        // Validation for " ! " # $ % & ' ( ) * + , - "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum == 47)
    {
        // Validation for " / "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum > 57 && keynum < 65)
    {
        // Validation for " : ; < = > ? @ "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum > 90 && keynum < 95)
    {
        // Validation for " [ \ ] ^ "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum == 96)
    {
         // Validation for " ` "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum > 122 && keynum < 127)
    {
        // Validation for " ; { | } ~ "
        //alert ("Special characters are not allowed.")
        return false;
    }
}

function avoidSpecialCharacterForTestKeyword(e)
{
    var keynum;
    var keychar;
    
    if(window.event) // IE
	{
	    keynum = e.keyCode;
	}
    else if(e.which) // Netscape/Firefox/Opera
	{
	    keynum = e.which;
	}
	
    if(keynum > 32 && keynum < 43)
    {
        // Validation for " ! " # $ % & ' ( ) * "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum > 44 && keynum < 46)
    {
        // Validation for " - "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum == 47)
    {
        // Validation for " / "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum > 57 && keynum < 65)
    {
        // Validation for " : ; < = > ? @ "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum > 90 && keynum < 95)
    {
        // Validation for " [ \ ] ^ "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum == 96)
    {
         // Validation for " ` "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum > 122 && keynum < 127)
    {
        // Validation for " ; { | } ~ "
        //alert ("Special characters are not allowed.")
        return false;
    }
}  
    
function avoidOnlySpecialCharacter(e)
{
    var keynum;
    var keychar;
    
    if(window.event) // IE
	{
	    keynum = e.keyCode;
	}
    else if(e.which) // Netscape/Firefox/Opera
	{
	    keynum = e.which;
	}
	
    if(keynum > 32 && keynum < 46)
    {
        // Validation for " ! " # $ % & ' ( ) * + , - "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum == 47)
    {
        // Validation for " / "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum > 57 && keynum < 65)
    {
        // Validation for " : ; < = > ? @ "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum > 90 && keynum < 95)
    {
        // Validation for " [ \ ] ^ "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum == 96)
    {
         // Validation for " ` "
        //alert ("Special characters are not allowed.");
        return false;
    }
    else if(keynum > 122 && keynum < 127)
    {
        // Validation for " ; { | } ~ "
        //alert ("Special characters are not allowed.")
        return false;
    }
}
    
    
  /* function RangeOfLoginId ()
    {     
        var txt = document.getElementById('<%=txtUserLogin1.ClientID%>').value.length;

        if(txt>=5)
        {
            document.getElementById('<%=lblLoginIdLength.ClientID%>').innerHTML="";
            return true;
        }
        else
        {
            document.getElementById('<%=lblLoginIdLength.ClientID%>').innerHTML="User LoginId required 5 character";
            return false;
        }
    }
    */
