﻿// Move an element directly on top of another element (and optionally  
       // make it the same size)  
       function Cover(bottom, top, ignoreSize) { 
            //alert("ignoresize")
           var location; 
           if (navigator.appName.indexOf("Microsoft")!=-1) {
           
                if (!ignoreSize) {  
                var mybottom = $get('topPanBG')
                location = Sys.UI.DomElement.getLocation(mybottom); 
                }
                else
                {
                    location = Sys.UI.DomElement.getLocation(bottom);
                }
                
             }
             else
             {
                location = Sys.UI.DomElement.getLocation(bottom);
                
                if (!ignoreSize) { 
                    if (bottom.toString == "Changes")
                    {
                        location.y = location.y - 600
                    }
                    else
                    {
                        location.y = location.y - 390
                    }
                }
             }
           top.style.position = 'absolute';  
           top.style.top = location.y + 'px';  
           top.style.left = location.x + 'px';  
           if (!ignoreSize) {  
               top.style.height = '600px';//bottom.offsetHeight + 'px';  
               top.style.width = '500px';//bottom.offsetWidth + 'px'; 
               var winW, winH, myNum, myNum2;

                 if (navigator.appName=="Netscape") {
                  winW = window.innerWidth;
                  winH = window.innerHeight;
                 }
                 if (navigator.appName.indexOf("Microsoft")!=-1) {
                  winW = document.body.offsetWidth;
                  winH = document.body.offsetHeight;
                 }
                 //alert(winW)
                 myNum = top.style.width;
                 myNum = parseInt(myNum)
                 //alert(myNum)
                 myNum2 = (winW/2) - (myNum/2);
                 //alert(myNum2)
                 winW = myNum2;
                 //alert(winW)
                 top.style.left = winW + 'px'; 
           }  
            
 
       }
          
