        function ___getPageScroll() {
            var xScroll, yScroll;
            if (self.pageYOffset || self.pageXOffset) {
                yScroll = self.pageYOffset;
                xScroll = self.pageXOffset;
            } else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
                yScroll = document.documentElement.scrollTop;
                xScroll = document.documentElement.scrollLeft;
            } else if (document.body) {// all other Explorers
                yScroll = document.body.scrollTop;
                xScroll = document.body.scrollLeft;	
            }
            arrayPageScroll = new Array(xScroll,yScroll);
            return arrayPageScroll;
        }
        function ___winSize(){
            var myWidth = 0, winHeight = 0;
            if( typeof( window.innerWidth ) == 'number' ) {
                //Non-IE
                winWidth = window.innerWidth;
                winHeight = window.innerHeight;
            } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
                //IE 6+ in 'standards compliant mode'
                winWidth = document.documentElement.clientWidth;
                winHeight = document.documentElement.clientHeight;
            } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                //IE 4 compatible
                winWidth = document.body.clientWidth;
                winHeight = document.body.clientHeight;
            }
            arrayWinSize = new Array(winWidth,winHeight);
            return arrayWinSize;
        }
        //нервы, блядь, у меня не выдержали...
        function ___checkBrowser(){
            //alert(window.navigator.userAgent);
            uAgent = window.navigator.userAgent;
			if(uAgent.indexOf("MSIE") >= 0){
                userApplication = "MSIE";
            }
            else if( (uAgent.indexOf("AppleWebKit") >= 0 ) && (uAgent.indexOf("Chrome") < 0 )){
                userApplication = "Safari";
            }
            else if( (uAgent.indexOf("AppleWebKit") >= 0 ) && (uAgent.indexOf("Chrome") >= 0 )){
                userApplication = "Chrome";
            }
            else if( (uAgent.indexOf("AppleWebKit") >= 0 )){
                userApplication = "WebKit";
            }
            else if(uAgent.indexOf("Gecko") >= 0){
                userApplication = "Gecko";
            }
            else if(uAgent.indexOf("Presto") >= 0){
                userApplication = "Presto";
            }
			else{
				userApplication = "unknown";
			}
			return userApplication;
        }
        $(document).ready(function(){
            document.onmousemove = function(e){
                if (!e) var e = window.event;
                //___checkBrowser();
				if(!document.getElementById("scheme_one") || !document.getElementById("scheme_two")){return;}
                var Box0 = document.getElementById("scheme_one");
                var Box1 = document.getElementById("scheme_two");
                var arrayPageScroll = ___getPageScroll();
                //координаты блока первого этажа
                var bX = Box0.offsetLeft;
                var bY = Box0.offsetTop;
				//координаты блока второго этажа
                var sbX = Box1.offsetLeft;
                var sbY = Box1.offsetTop;
                //координаты мыши
                var mX = e.clientX + arrayPageScroll[0];
                var mY = e.clientY + arrayPageScroll[1];
                if( ( mX > bX && mX < (bX + 255) ) && ( mY > bY && mY < (bY + 205) )){
					Box0.style.backgroundPosition = "0 -209px";
					$(".ffi_fl").css({ display:"none" });
                }
				else if( ( mX > sbX && mX < (sbX + 204) ) && ( mY > bY && mY < (bY + 205) )){
					Box1.style.backgroundPosition = "0 -209px";
					$(".ffi_fl").css({ display:"none" });
                }
				else{
                    Box0.style.backgroundPosition = "0 0";
					Box1.style.backgroundPosition = "0 0";
					$(".ffi_fl").css({ display:"block" });
                }
            }
            jQuery("#scheme_one a, #scheme_two a").hover(
                function(){
                    var aBox = $(this);
                    var parId = aBox.parent().attr("id");
                    switch (parId){
                        case "scheme_one":
                            var pUp = jQuery("#bubBody");
                            break;
                        case "scheme_two":
                            var pUp = jQuery("#bubBodyd");
                            break;
                    }
                    var group = aBox.attr("rel");
                    var pPos = aBox.attr("id");
                    var pText = aBox.attr("alt");
                    pUp.css({ display: "block", visibility: "hidden" });
                    switch(group){
                        case "old":
                            lightcolor = "#3d3a34";
                            break;
                        case "mid":
                            lightcolor = "#5b5141";
                            break;
                        case "new":
                            lightcolor = "#67552b";
                            break;
						case "hall":
                            lightcolor = "#746d5c";
                            break;
                    }
                    pUp.html(pText).addClass(pPos).css({ backgroundColor:lightcolor, visibility:"visible" });
                },
                function(){
                    jQuery("#bubBody, #bubBodyd").html('').removeClass().css({ backgroundColor:"transparent", display:"none" });
                }
            );
        });
