function blockTextInput(e)
{
    // used by: onkeypress="return blockTextInput(event)"
    var browser=navigator.appName
    if (browser == "Microsoft Internet Explorer")
    {
        var key = window.event.keyCode;
        switch (key) {
            case 34:
            case 64:
            case 91:
            case 93:
            case 123:
            case 125:
            case 58:
            case 59:
            case 92:
            case 47:
            case 35:
            case 42:
            case 60:
            case 62:
            case 94:
            case 38:
            case 61:
                return false;
                break;
        }
    }
    else
    {
        var key = String.fromCharCode(e.which)
        switch (key) {
            case '"':
            case '@':
            case '[':
            case ']':
            case '{':
            case '}':
            case ':':
            case ';':
            case '\\':
            case '/':
            case '#':
            case '*':
            case '<':
            case '>':
            case '^':
            case '&':
            case '=':
                return false;
                break;
        }
    }
}

function changeTextInputValue(idName)
{
    var target = document.getElementById(idName);
    setTimeout("reallyChangeTextInputValue('" + idName + "');", 1);
}

function reallyChangeTextInputValue(idName) 
{
    var control = document.getElementById(idName);
    if (control.value.indexOf("\"") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("@") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("[") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("]") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("{") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("}") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf(":") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf(";") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("\\") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("/") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("#") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("*") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("<") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf(">") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("^") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("&") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("=") != -1)
    {
        control.value = ""
    }
    else if (control.value.indexOf("'") != -1)
    {
        control.value = ""
    }
}

function copyDate()
{
    document.getElementById('datePicker2').value = document.getElementById('datePicker1').value;
}

/*=========================================
The following functions help define list box
behaviors
===========================================*/

/*
Under the condition that the "All" item is the first item in the list box,
the selectAllBehavior will deselect other choices when click on the first
item. It will switch list box's "multiple" attribute to true when user 
click on an item besides the first item
*/
function selectAllBehavior(idName)
{
    var x=document.getElementById(idName);
    if (x.selectedIndex == 0)
    {
        x.multiple=false;
        for (i=0;i<x.length;i++)
        {
            x.options[i].selected=false;
        }
        x.options[0].selected=true;
    }
    else
    {
        x.multiple=true;
    }
}
