    function CloseMsgBox() {
       document.getElementById("ctl00_pMsgBox").style.display = "none";
    }
    
    function ActivateAlertDiv(visstring, elem, msg) {
      var adiv = $get(elem);
      adiv.style.visibility = visstring;
      adiv.innerHTML = msg;     
      
    }
    
    function AdjustElements() {
        var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
        
        var winPositionFromTop= document.body.clientHeight


        var dsocleft=document.all? iebody.scrollLeft : pageXOffset
        var dsoctop=document.all? iebody.scrollTop : pageYOffset
        
        if (document.getElementById("ctl00_pMsgBox") != null) {
        
            document.getElementById("ctl00_pMsgBox").style.top=(dsoctop+10) + "px";
        }
        
      
        
        if (document.getElementById("AlertDiv") != null) {
            document.getElementById("AlertDiv").style.top = (dsoctop + 1) + "px";

            
        }
        
        window.onscroll = AdjustElements;

    }
    
   

    
                    function BeginRequestHandler(sender, args)
                {
                     AdjustElements();
                     //ActivateAlertDiv('visible', 'AlertDiv', 'Lutfen Bekleyiniz ...');
                     //document.body.style.cursor = "wait";

                     
                }
   function EndRequestHandler(sender, args) {
     if (args.get_error() != undefined && args.get_error().httpStatusCode == '500') {
          if (document.getElementById("ctl00_pMsgBoxMsg") != null) {
             document.getElementById("ctl00_pMsgBoxMsg").innerHTML = args.get_error().message;
             document.getElementById("ctl00_pMsgBox").style.display="block";
             args.set_errorHandled(true);
          }
       }
       AdjustElements();
       //ActivateAlertDiv('hidden', 'AlertDiv', '');
       //document.body.style.cursor = "default";


}
function load() {
   Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
   Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}


