﻿
   var prm = Sys.WebForms.PageRequestManager.getInstance(); 
   prm.add_initializeRequest(InitializeRequest); 
   prm.add_endRequest(EndRequest); 
   

   function InitializeRequest(sender, args) 
   { if (prm.get_isInAsyncPostBack()) 
         args.set_cancel(true); 
         //$get(validUP_id).style.display = 'block';
         if( PicLoading ) {
            map.removeOverlay( PicLoading );
            document.getElementById("MaxInstruct").style.display="none";
         }
         PicLoading = new GScreenOverlay($get("LoadPic"+ MapaID).innerHTML ,new GScreenPoint(.5, .5, 'fraction', 'fraction'),  
         new GScreenPoint(.5, .5, 'fraction', 'fraction'),  new GScreenSize(120, 120));
         map.addOverlay(PicLoading);
         
          var cc = map.fromLatLngToContainerPixel(map.getCenter()); 
          var left = cc.x - 150; 
          var top = 50; 
 
         var pos = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(left,top));
         pos.apply(document.getElementById("MaxInstruct"));
         map.getContainer().appendChild(document.getElementById("MaxInstruct"));
         document.getElementById("MaxInstruct").style.display="block"
  
    } 
  function EndRequest(sender, args) 
  {      
             if( PicLoading ) {
                document.getElementById("MaxInstruct").style.display="none";
                map.removeOverlay( PicLoading );
            }
} 
