function f_change(x){

        y=-(x-1)*206;
        $('#picture ul').css('top',y +'px');
        return false;
}

$(document).ready(function(){
        $cont=$('.m_contact');
        $use=$('.m_usefull');
        $part=$('.m_partners');
        $comp=$('.m_company');

        mas = [$comp,$use,$part,$cont];

            $.each( mas, function(){
               $(this).mouseenter(function(){
                      $(this).animate({top: '0px'},  "easeOutElastic");
                });
                $(this).mouseleave(function(){
                      $(this).animate({top: '-15px'},  "easeOutElastic");
                });
            });


        $('.carousel UL').jcarousel({ scroll: 1,wrap: 'both' });
        $('#mini_photo UL').jcarousel({ scroll: 1});
        $('#btn_update').click(function(){
                $.ajax({
                  cache: false,
                  url: 'public/modules/struct/ajax.php',
                  data: {num: 3, t: (new Date).getTime()} ,
                  success: function(html){
                        $(".dictionary div").html(html);
                    }

                });
                 return false;
        });
        
        $('#weather').html('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="160" HEIGHT="358" id="loader" ALIGN=""> <PARAM NAME=movie VALUE="http://rp5.ru/informer/group/1/30.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=scale VALUE=noscale> <PARAM NAME=salign VALUE=LT> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#FFFFFF> <PARAM NAME=flashvars VALUE="points=6560,10561,10560,9773,11492,10357,141485,9677,9043&lang=ru"><EMBED src="http://rp5.ru/informer/group/1/30.swf" quality=high scale=noscale salign=LT wmode=transparent bgcolor=#FFFFFF  WIDTH="160" HEIGHT="358" NAME="loader" flashvars="points=6560,10561,10560,9773,11492,10357,141485,9677,9043&lang=ru" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');

        $("#picture a[rel=fancy-tour]").fancybox({
                'transitionIn'		: 'none',
                'transitionOut'		: 'none',
                'padding'           : 9,
                'titlePosition' 	: 'over',
                'overlayColor'      : '#000',
                'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                        return '<div id="fancybox-title-over"><span>Image ' + (currentIndex + 1) + ' / ' + currentArray.length + '</span>' + (title.length ? ' &nbsp; ' + title : '') + '</div>';
                }
        });
});
