          jQuery(function(){
			     $(document).ready(function(){ 
			         //$('#menu_right').height($('#middle_container').height());
			         $("ul.sf-menu").supersubs({
                minWidth:10,
                maxWidth:27,
                extraWidth:1
              }).superfish();
              $("a.fancy").fancybox({
				        'overlayShow'	: true,
				        'transitionIn'	: 'fade',
				        'transitionOut'	: 'fade'
			        });
              $("a[rel=gallery]").fancybox({
				        'transitionIn'		: 'elastic',
				        'transitionOut'		: 'elastic',
				        'titlePosition' 	: 'over',
				        'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					         return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				        }
			        });
              $("a.fbiframe").fancybox({
		            'width'				: 820,
		            'height'			: 420,
                'autoScale'     	: false,
                'transitionIn'		: 'fade',
		            'transitionOut'		: 'fade',
		            'type'				: 'iframe'
	             });
               $("a.fancyiframe,a.morefancy").fancybox({
		            'width'				: '75%',
		            'height'			: '90%',
                'autoScale'     	: false,
                'transitionIn'		: 'fade',
		            'transitionOut'		: 'fade',
		            'type'				: 'iframe'
	             });
               	
               positionSocNet(); 
	             function positionSocNet(){
		              var window_height = $(window).height();
		              var window_scroll =  $(window).scrollTop();
		              var document_height = $(document.body).height();
		              var difference = window_scroll + window_height - $("#social_container").height();
		              if (difference < 0) 
			               difference = 0;
			            if (difference > document_height-$("#social_container").height()){
                      difference = document_height-$("#social_container").height();
                  }
                  $('#fbbutton').qtip("api").hide();
		              $("#social_container").animate({
                    top: difference, opacity: 1
                    }, { duration: 1000, queue: false});
	              };
	             $(window).resize(positionSocNet);
	             $(window).scroll(positionSocNet);
            });
		    }); 
