    //avoid conflict with other script
 
    $(document).ready(function($) {
 
	//this is the floating content
	var $floatingbox = $('#floating-box');
 
	if($('#body1').length > 0){
 
	  var bodyY = parseInt($('#body1').offset().top) - 20;
	  var originalX = $floatingbox.css('margin-right');
 
	  $(window).scroll(function () { 
 
	   var scrollY = $(window).scrollTop();
	   var isfixed = $floatingbox.css('position') == 'fixed';
 
	   if($floatingbox.length > 0){
 
 
	      if ( scrollY > bodyY && !isfixed ) {
			$floatingbox.stop().css({
			  position: 'fixed',
			  top: 20,
			});
		} else if ( scrollY < bodyY && isfixed ) {
		 	  $floatingbox.css({
			  position: 'relative'
		});
	     }		
	   }
       });
     }
  });


    $(document).ready(function($) {
 
	//this is the floating content
	var $floatingbox = $('#floating-share');
 
	if($('#shareY').length > 0){
 
	  var bodyY = parseInt($('#shareY').offset().top) - 20;
	  var originalX = $floatingbox.css('margin-right');
 
	  $(window).scroll(function () { 
 
	   var scrollY = $(window).scrollTop();
	   var isfixed = $floatingbox.css('position') == 'fixed';
 
	   if($floatingbox.length > 0){
 
 
	      if ( scrollY > bodyY && !isfixed ) {
			$floatingbox.stop().css({
			  position: 'fixed',
			  top: 20,
			  marginLeft: -165
			});
		} else if ( scrollY < bodyY && isfixed ) {
		 	  $floatingbox.css({
			  position: 'relative',
			  top: 20,
			  marginLeft: -165
		});
	     }		
	   }
       });
     }
  });

