function social4i_foot()
{
    ?>
<div id="fb-root"></div>
<?php 
    if (get_option('s4dmob', false) == true && social4i_check_mobile()) {
        return;
    }
    if (get_option('s4optimize', true) == true && get_option('s4scripthead', 'head') == "foot") {
        echo s4load_script();
    }
    if ((is_single() || is_page()) && get_option('s4dispvb', false) == true) {
        ?>
<script type="text/javascript">
 var offset = jQuery("#social4ivtop").offset();
            var offset1 = jQuery("#social4ivbottom").offset();
            var lmargin=<?php 
        echo get_option('s4vbmargin', 100);
        ?>
;
            var tmargin=<?php 
        echo get_option('s4vbmargintop', 20);
        ?>
;
            var vhide=<?php 
        if (get_option('s4vbhide', 'vbhide') == "vbhide") {
            echo 1;
        } else {
            echo 0;
        }
        ?>
;
	    var avis=<?php 
        if (get_option('s4vbavis', 'true') == "true") {
            echo 1;
        } else {
            echo 0;
        }
        ?>
;
            var is_vis=true;
            var is_dis=true;
            jQuery("#social4iv").appendTo("body");
	    if(avis)
	    {
            	if(jQuery(window).scrollTop()<offset.top )
           	 	{jQuery("#social4iv").css("top",offset.top-jQuery(window).scrollTop());}
           	 else
           	 	{jQuery("#social4iv").css("top",tmargin);}
           	 jQuery("#social4iv").fadeIn();
           }
            jQuery("#social4iv").css("left",offset.left-lmargin);
            jQuery(window).scroll(function() {
		 offset = jQuery("#social4ivtop").offset();
           	 offset1 = jQuery("#social4ivbottom").offset();
           	 if(jQuery(window).scrollTop()<offset.top-tmargin)
           	 	{jQuery("#social4iv").css("top",offset.top-jQuery(window).scrollTop());}
           	 else
           	 	{jQuery("#social4iv").css("top",tmargin);}
           	 if(jQuery(window).scrollTop()<offset1.top-tmargin || vhide==0)is_dis=true;else is_dis=false;
                if ((jQuery(window).scrollTop() > offset.top||avis) && is_dis && is_vis) 
                {
		    jQuery("#social4iv").fadeIn();
                } else {
                    jQuery("#social4iv").fadeOut();
                }
            });
            jQuery(window).resize(function() {
            	offset = jQuery("#social4ivtop").offset();
            	offset1 = jQuery("#social4ivbottom").offset();
            	var off=jQuery("#social4iv").offset();
            	jQuery("#social4iv").css("left",offset.left-lmargin);
		if(offset.left-lmargin<0)is_vis=false; else is_vis=true;
		 if(jQuery(window).scrollTop()<offset1.top || vhide==0)is_dis=true;else is_dis=false;
                if (jQuery(window).scrollTop() > offset.top && is_dis && is_vis) 
                {
		    jQuery("#social4iv").fadeIn();
                } else {
                    jQuery("#social4iv").fadeOut();
                }
	    });
</script>
<?php 
    }
    if (get_option('s4analytics', false) == false) {
        return;
    }
    ?>
	<script src="http://analytics-api-samples.googlecode.com/svn/trunk/src/tracking/javascript/v5/social/ga_social_tracking.js"></script>
	<script>
 		 _ga.trackSocial();
	</script>
	
	
<?php 
}
function social4i_foot()
{
    if (get_option('s4dmob', false) == true && social4i_check_mobile()) {
        return;
    }
    if (get_option('s4optimize', true) == true && get_option('s4scripthead', 'head') == "foot") {
        echo s4load_script();
    }
}
function social4i_foot()
{
    if (get_option('s4dmob', false) == true && social4i_check_mobile()) {
        return;
    }
    if (get_option('s4optimize', true) == true && get_option('s4scripthead', 'head') == "foot") {
        echo s4load_script();
    }
    if (get_option('s4analytics', false) == false) {
        return;
    }
    ?>
    <script src="http://analytics-api-samples.googlecode.com/svn/trunk/src/tracking/javascript/v5/social/ga_social_tracking.js"></script>
    <script>
         _ga.trackSocial();
    </script>
    
<?php 
}