﻿// JavaScript Validation
function ValidateNumeric(e)
{
    if (navigator.appName.indexOf("Microsoft") != -1)
        key = e.keyCode;
    else
        key = e.which; 
    text = String.fromCharCode(key);
    
    // control keys
    if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27))
        return true;
    // numbers
    else if ((("0123456789").indexOf(text) > -1))
        return true;
    else
        return false;
}

function ValidateDecimal(e)
{
    if (navigator.appName.indexOf("Microsoft") != -1)
        key = e.keyCode;
    else
        key = e.which; 
    text = String.fromCharCode(key);
    
    // control keys
    if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27))
        return true;
    // numbers
    else if (((".0123456789").indexOf(text) > -1))
        return true;
    else
        return false;
}

function AutoFill(textBox)
{
    if (textBox.value == '')
        textBox.value = 1;
    textBox.select();
}

function ScrollToErrorMsg()
{
    //document.getElementById('errorMsg').scrollIntoView(true);
    window.location = window.location+"#errorMsg";
}