﻿// 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
                if(window.event){
                    btn.click();
                    event.keyCode = 0;
                }else{
                    var e = document.createEvent("MouseEvents");
                    e.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
                    btn.dispatchEvent(e);
                }
                              
                
            }
        }
   }
   
function doLink(linkName,e)
    {
        //Get the button the user wants to have clicked
        var btn = document.getElementById(linkName);
        if (btn != null)
        { //If we find the button click it
            if(window.event){ //IE
                btn.click();
                event.keyCode = 0
            }else{
                btn.onclick(); //firefox
                return true;
            }
        }
   }

   
function Confirm(message)
    {
        var ans; 
		ans=window.confirm(message);  
		if (ans == false) { 
		    if(window.event){
			    window.event.returnValue = false; //important
			}
			return false; 
		}
    }

function ignoreEnter(event) {

            if (typeof event == "undefined")

                  event = window.event;

            

            var val = event.keyCode;

            if(val == 13)
                  return false;

      }


    
   /* <script language="javascript"> 
			function getMessage() { 
				var ans; 
				ans=window.confirm('Are you sure you want to delete selected messages?');  
				if (ans == false) { 
					window.event.returnValue = false; //important
					return false; 
				}
			} 
		</script>*/



