// JavaScript Document


$(document).ready(function(){
    ///fileadmin/templates/new/but/but_1a.gif

	 if ($.browser.msie) {
		$('#flashmenuwrap').show();
	}

    var imgPath = '/fileadmin/templates/new/but/';
    var id = '';
    //  var src = '';
    $('.block-index-buttons a img').hover(
        function() {
            id = $(this).attr('id');
            //      src = $(this).attr('src');
            $(this).attr('src',imgPath + id + 'a.gif');
            
        },
        function() {
            //$(this).attr('src',src);
            $(this).attr('src',imgPath + id + 'p.gif');
        }
        ); 
            
    $('div#top_menu ul li').hover(
        function() {
            $(this).addClass("hover");
        },
        function() {
            $(this).removeClass("hover");
        }
        );  
		
		
		//$('.spec').load('/nc/o-kompanii/specpredlozhenija/specy-na-glavnoi/ #ajax_block_for_main');
		
		
		
		$(".spec").load('/nc/o-kompanii/specpredlozhenija/specy-na-glavnoi/ #ajax_block_for_main', function(response, status, xhr) {
			if (status == "error") {
			var msg = "Sorry but there was an error: ";
			$(".spec").html(msg + xhr.status + " " + xhr.statusText);
			}
			$('#block-spec').show();
		});
		
		
		
		
		
		
		
	//	$('.oper-toggle').hide();
    //$('#oper-hide').show();
	
    $('#oper-open, #oper-hide').click(function(){   
        $('.oper-toggle').toggle();
        return false;
    });
		
		
		var offset = $("#operator").offset();

    var topPadding = 15;

    $(window).scroll(function() {

        if ($(window).scrollTop() > offset.top) {

            $("#operator").stop().animate({
                marginTop: $(window).scrollTop() - offset.top + topPadding
            });

        }

        else {
            $("#operator").stop().animate({
                marginTop: 0
            });
        };
    
    });
		
    
});




