﻿// JScript File
/********************************************************************************/
// 1. Please create MainPage div for the page you want to hide
// 2. add div tag with id "wait" to your page having your prefered progress bar
//    Give the waiting div width, height
//3.  include this file to your page
//4. call function Wait
function Wait()
{
    //this.parent.document.getElementById("MainPage").style.display="none";
    //this.parent.document.getElementById("MainPage").disabled =true;
    
    var obj = this.parent.document.getElementById("wait")
    var width,height;
     if (window.innerWidth) //if browser supports window.innerWidth
    {
       width = window.innerWidth;
       height =window.innerHeight;
      
    }
    else if (document.documentElement) //else if browser supports document.all (IE 4+)
    {
        width =document.documentElement.clientWidth ;
        height=document.documentElement.clientHeight;
        
    }
    else if (document.body)
    {
        width =document.body.clientWidth ;
        height=document.body.clientHeight;
    }
    
    var h= this.parent.document.getElementById("MainPage").offsetHeight;
        
        
    obj.style.position="absolute";
    obj.style.left=Math.abs( (width -parseInt( obj.style.width))/2) + "px";
    obj.style.top=Math.abs( (height -parseInt( obj.style.height))/2) + "px";
    obj.style.display="block";  
   
    this.parent.document.getElementById("MainPage").innerHTML +='<div id="GreyBackground" style="z-index: 2; width: 100%; height: '+h+'px; background-color: Silver;position: absolute; opacity: 0.4; filter: alpha(opacity=40); top: 0px; left: 0px;right: 0px; bottom: 0px;"></div>'   
    
    
    
}
