 //document.onkeydown=function(){if(window.event.keyCode==13){return false;}}
 //ENTER KEY IS DISABLED EXCEPT IN TEXTAREAS
 var globalBrowserLeft,globalBrowserTop,globalBrowserWinBottom,globalBrowserWinRight,globalEventX,globalEventY,globalTarget;
 function trackMousePosition()
 {
      globalTarget=window.event.srcElement;
      globalBrowserLeft= window.event.clientX;
      globalBrowserTop=window.event.clientY;
      globalBrowserWinBottom=document.body.clientHeight;
      globalBrowserWinRight=document.body.clientWidth;
 }
 var popupIsMoving=false;
 var prevPopupPositionX;
 var prevPopupPositionY;
 var popupInProgress=false;

 function winInit() {
     return;
 }
 function closeWinAction(popupId){
     return;
  }
 document.onmousemove=trackMousePosition;
 function sourceFocus(id,name)
 {
    if(name)
   {
     document.frm[name].focus();
   }
   else if (id)
   {
     document.getElementById(id).focus();
   }
 }
 // FEATURES OF NEW SHOWALERT POPUP.
 //function blockKeys(){if(window.event.keyCode==9 || window.event.keyCode==13){return false;}}
 function shieldUp(id,fleft,ftop){
 centerPopup(id,fleft,ftop);
 popupInProgress=true;
 //document.getElementById("disableShield").style.display="block";
 //document.frm.menu.disabled=true;
 //document.attachEvent("onkeydown",blockKeys);
 }
 function shieldDown(){
 popupInProgress=false;
 document.getElementById("disableShield").style.display="none";
 document.frm.menu.disabled=false;
 document.detachEvent("onkeydown",blockKeys);
 }
 function centerPopup(id,fleft,ftop){
     if(!id){id="popupShowAlert";}
     if(!fleft){fleft=150;}
     if(!ftop){ftop=80;}
   document.getElementById(id).style.left=((document.body.offsetWidth /2)-fleft)+"px";
   document.getElementById(id).style.top=((document.body.offsetHeight /2)-ftop)+"px";
   //document.getElementById(id).style.left=((document.body.scrollLeft)+fleft*2.5)+"px";
   //document.getElementById(id).style.top=((document.body.scrollTop)+ftop*2.5)+"px";
 }

 var movementTrigger=null;
 function grabPopup(id){
      if(!id){id="popupShowAlert";}
     popupIsMoving=true;
     movementTrigger=setInterval("movePopup('"+id+"')",5)
 }
 function releasePopup(flag,id){
     if(!id){id="popupShowAlert";}
     if(flag==0){
         popupIsMoving=false;
         prevPopupPositionX=null;
         prevPopupPositionY=null;
         clearTimeout(movementTrigger);
     }
     else if(globalBrowserLeft<parseInt(document.getElementById(id).style.left)-10 ||
             globalBrowserLeft>parseInt(document.getElementById(id).style.left)+310 ||
             globalBrowserTop<parseInt(document.getElementById(id).style.top)-10 ||
             globalBrowserTop>parseInt(document.getElementById(id).style.top)+50){
         popupIsMoving=false;
         prevPopupPositionX=null;
         prevPopupPositionY=null;
         clearTimeout(movementTrigger);
     }

 }
 function movePopup(id){
     if(popupIsMoving){
          if(!id){id="popupShowAlert";}
         if(!prevPopupPositionX){prevPopupPositionX=globalBrowserLeft;prevPopupPositionY=globalBrowserTop;}
         Xoffset=globalBrowserLeft-parseInt(document.getElementById(id).style.left);
         Yoffset=globalBrowserTop-parseInt(document.getElementById(id).style.top);
         diffX=globalBrowserLeft-prevPopupPositionX;
         diffY=globalBrowserTop-prevPopupPositionY;
         document.getElementById(id).style.left=(globalBrowserLeft+diffX)-Xoffset+"px";
         document.getElementById(id).style.top=(globalBrowserTop+diffY)-Yoffset+"px";
         prevPopupPositionX=globalBrowserLeft;
         prevPopupPositionY=globalBrowserTop;
     }

 }
 