﻿function addEvent(obj, evType, fn, useCapture) {
    if (obj.addEventListener) {
        obj.addEventListener(evType, fn, useCapture);
        return true;
        } 
    else if (obj.attachEvent) {
        var r = obj.attachEvent("on"+evType, fn);
        return r;
        } 
    else {
        //alert("Handler could not be attached");
        }
    }
function window_onfocus()   {
    if (overlayform){
        document.getElementById('lnkactive').click();
        overlayform = false;
        }
    }
function _onloadEventHandler(args)  {
    if(FireOnload)  {
        FireOnload(args);
        }
    }

function FireOnload(args)   {
    //Attach the events
    if (!window.addEventListener) {
        addEvent(window, "focus", window_onfocus, false);
        form1.focus();
        }
    else    {
        if (overlayform) {
        var _btnActive = document.getElementById('btnactive');	    
            if (_btnActive != null) {
                _btnActive.focus();
                _btnActive.click();
                overlayform = false;
                }
            }
        }
    }
