function getBrowserHeight() {
                var intH = 0;
                var intW = 0;
               
                if(typeof window.innerWidth  == 'number' ) {
                   intH = window.innerHeight;
                   intW = window.innerWidth;
                } 
                else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
                    intH = document.documentElement.clientHeight;
                    intW = document.documentElement.clientWidth;
                }
                else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
                    intH = document.body.clientHeight;
                    intW = document.body.clientWidth;
                }

                return { width: parseInt(intW), height: parseInt(intH) };
            } 

            function setLayerPosition() {
                var shadow = document.getElementById("shadow");
                var loadingLayerRef = document.getElementById("loading");
				
				
                var bws = getBrowserHeight();
				
				   shadow.style.height = getDocumentHeight() + "px";
                   shadow.style.width = getDocumentWidth() + "px";

				var divTop=f_scrollTop();
				loadingLayerRef.style.left = parseInt((bws.width - 250) / 2) + "px";
				loadingLayerRef.style.top = (divTop+170) + "px";
				shadow = null;
				loadingLayerRef = null;
				
            }
			
            function showLayer() {
                var shadow = document.getElementById("shadow");
				var loadingLayerRef = document.getElementById("loading");
                shadow.style.display = "block"; 
				loadingLayerRef.style.display = "block"; 
                shadow = null;
                loadingLayerRef = null;   
        
            }
            
            function hideLayer() {
			
                var shadow = document.getElementById("shadow");
                var loadingLayerRef = document.getElementById("loading");
               shadow.style.display = "none"; 
                loadingLayerRef.style.display = "none";
				shadow = null;
				loadingLayerRef = null; 
				
            }
			
			
			
            window.onresize = setLayerPosition;
			function f_scrollTop() {
			return f_filterResults (
			window.pageYOffset ? window.pageYOffset : 0,
			document.documentElement ? document.documentElement.scrollTop : 0,
			document.body ? document.body.scrollTop : 0
			);
}	
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}


    var ua = navigator.userAgent.toLowerCase();
    var isStrict = document.compatMode == 'CSS1Compat',
        isOpera = ua.indexOf("opera") > -1,
        isIE = ua.indexOf('msie') > -1,
        isIE7 = ua.indexOf('msie 7') > -1,
        isBorderBox = isIE && !isStrict,
        isSafari = (/webkit|khtml/).test(ua),
        isSafari3 = isSafari && !!(document.evaluate),
        isGecko = !isSafari && ua.indexOf('gecko') > -1,
        isWindows = (ua.indexOf('windows') != -1 || ua.indexOf('win32') != -1),
        isMac = (ua.indexOf('macintosh') != -1 || ua.indexOf('mac os x') != -1),
        isLinux = (ua.indexOf('linux') != -1);

    /**
     * Gets the height of the document (body and its margins) in pixels.
     *
     * @return  {Number}        The height of the document
     * @public
     * @static
     */
    getDocumentHeight = function(){
        var scrollHeight = isStrict ? document.documentElement.scrollHeight : document.body.scrollHeight;
        return Math.max(scrollHeight, getViewportHeight());
    };

    /**
     * Gets the width of the document (body and its margins) in pixels.
     *
     * @return  {Number}        The width of the document
     * @public
     * @static
     */
    getDocumentWidth = function(){
        var scrollWidth = isStrict ? document.documentElement.scrollWidth : document.body.scrollWidth;
        return Math.max(scrollWidth, getViewportWidth());
    };

	    /**
     * Gets the height of the viewport in pixels. Note: This function includes
     * scrollbars in Safari 3.
     *
     * @return  {Number}        The height of the viewport
     * @public
     * @static
     */
  getViewportHeight = function(){
        var height = window.innerHeight; // Safari
        var mode = document.compatMode;
        if((mode || isIE) && !isOpera){
            height = isStrict ? document.documentElement.clientHeight : document.body.clientHeight;
        }
        return height;
    };

    /**
     * Gets the width of the viewport in pixels. Note: This function includes
     * scrollbars in Safari 3.
     *
     * @return  {Number}        The width of the viewport
     * @public
     * @static
     */
  getViewportWidth = function(){
        var width = window.innerWidth; // Safari
        var mode = document.compatMode;
        if(mode || isIE){
            width = isStrict ? document.documentElement.clientWidth : document.body.clientWidth;
        }
        return width;
    };