﻿// JScript File

function doClick(buttonName,e)
    {
//the purpose of this function is to allow the enter key to 
//point to the correct button to click.
        var key;
         if(window.event)
              key = window.event.keyCode;     //IE
         else
              key = e.which;     //firefox
        if (key == 13)
        {
            //Get the button the user wants to have clicked
            var btn = document.getElementById(buttonName);
            if (btn != null)
            { //If we find the button click it
               btn.click();
                event.keyCode = 0
            }
        }
   }
   
   
   
   
   //////////////////
   function TestForReturn() 
{    
    if (event.keyCode == 13) 
    {        
        event.cancelBubble = true;
        event.returnValue = false;
        return true;
    }
    return false;
} 
////////////////////


function onEnterpress(e)
{
    //define any varible
    var KeyPress 
    //if which property of event object is supported 
    if(e && e.which)
    {
        e = e
        //character code is contained in NN4's which property
        KeyPress = e.which
    }
    else
    {
        e = event
        KeyPress = e.keyCode
    }
    //13 is the key code of enter key
    if(KeyPress == 13)
    {
        //frmLogin is the name of form
        document.forms[0].submit()
        return false    
    }
    else
    {
        return true
    }
}
///////////////