<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the #content div and all content after
 *
 * @package Urdu Paper
 */
global $wp;
global $xpanel;
$sharing_bar = $xpanel['social-sidebar'];
$sharing_bar_pos = $xpanel['social-postion'];
$sharing_bar_rounded = $xpanel['social-rounded'];
$sharing_bar_hover = $xpanel['social-hover'];
$totop = $xpanel['totop'];
$preloader = $xpanel['preloader'];
if($sharing_bar_pos == 1) {
	$sharing_bar_position = "right:-2px;";
}
else {
	$sharing_bar_position = "left:-2px;";
}
if($sharing_bar_rounded == 1) {
	$icon_styles = ' style="border-radius:50%; -moz-border-radius:50%; -webkit-border-radius:50%"';
}
else {
	$icon_styles = "";
}
?>

	<footer id="footer" class="row footer-main">

		<div class="footer_widgets">
			<div class="footer-widget-col col-lg-4 col-md-4 col-sm-8 co-xs-16">
				<?php dynamic_sidebar('footer-4') ?>
			</div><!--#Footer Widget 4 -->
			<div class="footer-widget-col col-lg-4 col-md-4 col-sm-8 co-xs-16">
				<?php dynamic_sidebar('footer-3') ?>
			</div><!--#Footer Widget 3 -->
			<div class="footer-widget-col col-lg-4 col-md-4 col-sm-8 co-xs-16">
				<?php dynamic_sidebar('footer-2') ?>
			</div><!--#Footer Widget 2 -->
			<div class="footer-widget-col col-lg-4 col-md-4 col-sm-8 co-xs-16">
				<?php dynamic_sidebar('footer-1') ?>
			</div><!--#Footer Widget 1 -->
		</div><!--#Footer Widgets -->
		<div class="clear"></div>
		<div class="row footer-row pt-5 pb-5">
			<div class="footer-copyrights">
				<p><?php echo $xpanel['footer-copyright'] ?></p>
			</div><!--#Footer Copyright Info -->
		</div>
		

	</footer><!-- #footer -->

	</div><!-- #content -->

	</div><!-- #site inner -->

</div><!-- #site -->
<div class="search-box">
	<h2 class="text-center"><?php _e('اگر آپ کو کسی مخصوص خبر کی تلاش ہے تو یہاں نیچے دئے گئے باکس کی مدد سے تلاش کریں') ?></h2>
	<?php get_search_form() ?>
	<a href="javascript:" id="closeSearchBox"><i class="fa fa-times"></i></a>
</div>
<script>
    smoothScroll.init({updateURL: false});
</script>

<!--========= Add Urdu Font in Seach Box ==========-->
<script language="JavaScript" type="text/javascript">
$(document).ready(function() {    
    $('#searchInput').UrduEditor("20px");   
    $('textarea').UrduEditor("18px"); 
});  
</script>



<?php 
	if(isset($xpanel['totop']) && $xpanel['totop'] == 1) {
?>
<script>
(function($) {
        
	$(window).scroll(function(){
        if ($(this).scrollTop() > 200) {
            $('#scrollup').fadeIn(300);
        } else {
            $('#scrollup').fadeOut(300);
        }
    });
       
})(jQuery);
</script>
<?php } ?>
<script type="text/javascript">
  $(document).ready(function() { 
  $('#incSize').click(function(){    
        curSize= parseInt($('#post-conten-single p').css('font-size')) + 2;
  if(curSize<=40)
        $('#post-conten-single p').css('font-size', curSize);
        });  
  $('#dcrSize').click(function(){    
        curSize= parseInt($('#post-conten-single p').css('font-size')) - 2;
  if(curSize>=12)
        $('#post-conten-single p').css('font-size', curSize);
        }); 
 });
</script>
<?php 
	if(isset($xpanel['stickynav']) && $xpanel['stickynav'] == 1) {
?>
<script>
(function($) {
        
	$(window).scroll(function(){
        if ($(this).scrollTop() > 400) {
            $('#main-nav').addClass("sticknav animated fadeIn");
        } else {
            $('#main-nav').removeClass("sticknav animated fadeIn");
        }
    });
       
})(jQuery);
</script>
<?php } ?>
<?php if($xpanel['totop'] == 1) {?>
<a data-scroll href="#masthead" id="scrollup"><i class="fa fa-chevron-up"></i></a>
<?php } ?>

<script type="text/javascript">
	var ww = document.body.clientWidth;

	$(document).ready(function() {
	    $(".menu li a").each(function() {
	        if ($(this).next().length > 0) {
	            $(this).addClass("parent");
	        };
	    })
	    adjustMenu();
	})

	$(window).bind('resize orientationchange', function() {
	    ww = document.body.clientWidth;
	    adjustMenu();
	});

	var adjustMenu = function() {
	    if (ww < 768) {
	        $(".menu li").unbind('mouseenter mouseleave');
	        $(".menu li a.parent").unbind('click').bind('click', function(e) {
	            // must be attached to anchor element to prevent bubbling
	            e.preventDefault();
	            $(this).parent("li").toggleClass("hover");
	        });
	    } else if (ww >= 768) {
	        $(".menu").show();
	        $(".menu li").removeClass("hover");
	        $(".menu li a").unbind('click');
	        $(".menu li").unbind('mouseenter mouseleave').bind('mouseenter mouseleave', function() {
	            // must be attached to li so that mouseleave is not triggered when hover over submenu
	            $(this).toggleClass('hover');
	        });
	    }
	}
</script>
<?php wp_footer(); ?>
</body>
</html>
