// ------ кнопка "отправить заявку" --------
$(document).ready(function() {	$("#left_col_fast_order").hover(
		function() { 
			$(this).find("#left_col_fast_order_btn").attr("src", "/images/order_btn_active.png"); 
			if ($.browser.name == 'msie' && $.browser.version == '6.0') fixPNG(document.getElementById('left_col_fast_order_btn'));
		},
		function() {
			$(this).find("#left_col_fast_order_btn").attr("src", "/images/order_btn.png");
			if ($.browser.name == 'msie' && $.browser.version == '6.0') fixPNG(document.getElementById('left_col_fast_order_btn'));
		}
	);
});





function getScrollY() 
{
    scrollY = 0;    
    if (typeof window.pageYOffset == "number") {
        scrollY = window.pageYOffset;
    } else if (document.documentElement && document.documentElement.scrollTop) {
        scrollY = document.documentElement.scrollTop;
    }  else if (document.body && document.body.scrollTop) {
        scrollY = document.body.scrollTop; 
    } else if (window.scrollY) {
        scrollY = window.scrollY;
    }
    return scrollY;
}
  
function getInnerHeight() 
{
    height = 0;
    if (window.innerHeight) {
        height = window.innerHeight - 18;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        height = document.documentElement.clientHeight;
    } else if (document.body && document.body.clientHeight) {
        height = document.body.clientHeight;
    }
    return height;
}

// -------- поизиционирование элемента по центру экрана --------
function moveToCenter(selector) {
	// позиционируем по центру
	var width = $(selector).width();
	var height = $(selector).height();
	
	var window_width = $(window).width();
	var window_height = $(window).height();
	
	var margin_top = -height/2;
	
	$(selector).css({top: getScrollY() + window_height/2 + "px", left: "50%", marginTop: -height/2 + "px", marginLeft: -width/2 + "px"});
	if (window_height < height) $(selector).css({top: getScrollY() + 3 + "px", left: "50%", marginTop: "0px", marginLeft: -width/2 + "px"});
}



$(document).ready(function() {
	// ------ кнопка "быстрая заявка" --------
	$("#fast_application_link").hover(
		function() { 
			$(this).attr("src", "/images/fast_application_link_active.gif"); 
		},
		function() {
			$(this).attr("src", "/images/fast_application_link.gif");
		}
	);
	// ------ кнопка "быстрая анкета" --------
	$("#fast_brief_link").hover(
		function() { 
			$(this).attr("src", "/images/fast_brief_link_active.gif"); 
		},
		function() {
			$(this).attr("src", "/images/fast_brief_link.gif");
		}
	);
});


function showScreen() {
     $("<div/>").attr("id", "screen").appendTo("body");
	 $("#screen").height(document.body.offsetHeight);
     $("#screen").show();
}
function hideScreen() {
     $("#screen").remove();
}
