<?php

/**

 * The template for displaying the footer

 *

 * Contains footer content and the closing of the #main and #page div elements.

 *

 * @package WordPress

 * @subpackage Twenty_Twelve

 * @since Twenty Twelve 1.0

 */

?>

	</div><!-- #main .wrapper -->



	<div class="setting-form modal fade" role="dialog" id="setting-modal">

		<div class="modal-dialog">

			<!-- Modal content-->

			<div class="modal-content">

				<div class="modal-header">

					<button type="button" class="close" data-dismiss="modal">&times;</button>

						<h4>Formatting</h4>

				</div>

				<div class="modal-body">

					<!--Font-Size-->

					<div class="col-xs-12 col-md-6">

						<?php $bible_font_size = ($_COOKIE['font_size']? $_COOKIE['font_size'] : "12px");?>

						<h3>Font Size</h3>

						<div class="font-control-buttons">

							<div class="radio">

								<label>

									<input type="radio" class="bible_radio radio-font-xs" name="size_options" id="option1" value="12px" <?php if($bible_font_size=="12px"){echo "checked";}?>>Extra Small

								</label>

							</div>

							<div class="radio">

								<label>

									<input type="radio" class="bible_radio radio-font-small" name="size_options" id="option2" value="14px" <?php if($bible_font_size=="14px"){echo "checked";}?>>Small

								</label>

							</div>

							<div class="radio">

								<label>

									<input type="radio" class="bible_radio radio-font-medium" name="size_options" id="option3" value="16px" <?php if($bible_font_size=="16px"){echo "checked";}?>>Medium

								</label>

							</div>

							<div class="radio">

								<label>

									<input type="radio" class="bible_radio radio-font-large" name="size_options" id="option4" value="18px" <?php if($bible_font_size=="18px"){echo "checked";}?>>Large

								</label>

							</div>

							<div class="radio">

								<label>

									<input type="radio" class="bible_radio radio-font-large" name="size_options" id="option5" value="22px" <?php if($bible_font_size=="22px"){echo "checked";}?>>Extra Large

								</label>

							</div>

						</div>

					</div>

					<!--#Font-Size-->

					   

					<!--Fonts-->

					<div class="col-xs-12 col-md-6">

						<h3>Font</h3>

						<div class="font-style-buttons">

							<?php $bible_font_style = ($_COOKIE['font_style']? $_COOKIE['font_style'] : "font-arial"); ?>

							<div class="radio">

								<label class="font-arial">

									<input type="radio" class="bible_radio radio-font-arial" name="style_options" id="option1" value="font-arial" <?php if($bible_font_style=="font-arial"){echo "checked";}?>>Arial

								</label>

							</div>

							<div class="radio">

								<label class="font-timesnewroman">

									<input type="radio" class="bible_radio radio-font-timesnewroman" name="style_options" id="option2" value="font-timesnewroman" <?php if($bible_font_style=="font-timesnewroman"){echo "checked";}?>>Times New Roman

								</label>

							</div>

							<div class="radio">

								<label class="font-merriweather">

									<input type="radio" class="bible_radio radio-font-merriweather" name="style_options" id="option3" value="font-merriweather" <?php if($bible_font_style=="font-merriweather"){echo "checked";}?>>Merriweather

								</label>

							</div>

						</div>

					</div>

					<div class="clearfix"></div>

					<!--#Fonts-->

						

					<!--Theme-Color-->

					<div class="col-xs-12">

						<h3>Theme Color </h3>

						<div class="verse-control-buttons">

							<?php $bible_theme_color = ($_COOKIE['theme_color'] ? $_COOKIE['theme_color']:"fire"); ?>

							<div class="radio">

								<label>

									<input type="radio" name="theme_color" class="bible_radio radio-theme-fire" value="fire" <?php if($bible_theme_color=="fire"){echo "checked";}?>>Fire

								</label>

							</div>

							<div class="radio">

								<label>

									<input type="radio" name="theme_color" class="bible_radio radio-theme-water" value="water" <?php if($bible_theme_color=="water"){echo "checked";}?> >Water

								</label>

							</div>

						</div>

					</div>

					<!--#Theme-Color-->

				</div>

				 <div class="clearfix"></div>

				<!--Footer-->

				<div class="modal-footer">

					<button type="button" class="btn btn-default" data-dismiss="modal" id="close-setting">Close</button>

				</div>

				<!--#Footer-->

			</div>

		</div>

	</div>

	

	

	<footer id="colophon" role="contentinfo">

		<div class="site-info">

        

        <?php dynamic_sidebar('footeraddress'); ?>

        <?php dynamic_sidebar('footerMenu'); ?>

        <div class="clear"></div>

			<?php //do_action( 'twentytwelve_credits' ); ?>

			<?php /*?><a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentytwelve' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentytwelve' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentytwelve' ), 'WordPress' ); ?></a><?php */?>

		</div><!-- .site-info -->

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

</div><!-- #page -->

<?php $category_id	= ( $_GET['cat'] ?$_GET['cat'] :5 );?>

<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

<script type="text/javascript">

jQuery(document).ready(function($){

	$('div.scroll ol').hide();

	var cat	=	<?php echo $category_id;?>;

	if(cat){

		$('div.scroll ol#chapter_selector_'+cat).show();

	}

	else

	{

		$('div.scroll ol:first').show();

	}

	

	$('ul#menu-main-menu li a').hover(function(){

		var target		 = $(this).attr('href');

		$('div.dynamic_menu').hide();

		$(target).show();

	});

	

	$(document).mouseover(function(e){

		var container = $('div.dynamic_menu,#site-navigation li');

		 if (!container.is(e.target) // if the target of the click isn't the container...

			 && container.has(e.target).length === 0) // ... nor a descendant of the container

		 {

			 $("div.dynamic_menu").hide();

		 }

	});



	

	

	$('ul.books li a').click(function(){

		var book	=	$(this).attr('data-book');

		$('ul.books li a').removeClass('active');

		$(this).addClass('active');

		$('div.scroll ol').hide();

		$('div.scroll ol#chapter_selector_'+book).show();

	});

	

	$(document).on('change','input[type="radio"].bible_radio',function(){

		var radio	= $(this);

		if(radio.is(':checked')){

			var name	=	radio.attr('name');

			var value	=	radio.val();

			$.ajax({

					type:'post',

					url:'<?php echo get_template_directory_uri();?>/bible-ajax.php',

					cache:false,

					data:name+"="+value

			}).success(function(response){

				if(name=='theme_color'){

					if(value=='water'){

						$('body').addClass('watertheme');

					}

					else

					{

						if($('body').hasClass('watertheme')){

							$('body').removeClass('watertheme');

						}

					}

				}

				else if(name=='style_options'){

					if(value == 'font-merriweather'){

						font_style="'Merriweather', serif";

					}

					else if(value == 'font-timesnewroman'){

						font_style="Times New Roman";

					}

					else{	

						font_style="Helvetica, Arial, sans-serif";

					}

					$('div#content').css('font-family',font_style);

					$('div.breadcrumbs').css('font-family',font_style);

			

				}

				else if(name=='size_options'){

					$('div#content').css('font-size',value);

					$('h1.entry-title a').css('font-size',value);

					$('h1.entry-title').css('font-size',value);

					$('h3.home-title').css('font-size',value);

					$('h3.page-title').css('font-size',value);

					if(value=='12px'){

						$('h1.entry-title').css('line-height','35px');

					}

					else if(value=='14px'){

						$('h1.entry-title').css('line-height','40px');

					}

					else if(value=='16px'){

						$('h1.entry-title').css('line-height','44px');

					}

					else if(value=='18px'){

						$('h1.entry-title').css('line-height','50px');

					}

					else if(value=='22px'){

						$('h1.entry-title').css('line-height','60px');

					}

					$('div.breadcrumbs').css('font-size',value);

                    var lineheight = 39;
                    console.log(value);

                    value = parseInt(value.replace("px", "")) + 10;
                    if(value == 32){
                        lineheight = 35;
                    }else if(value == 36){
                        lineheight = 38;
                    }

                    if($('article.greek').length){
                        console.log('greek');
                        $('article.greek div.strongsdef:first-child span:last-child').css({'font-size': value + "px !important", 'line-height': lineheight + "px"});
                    }else{
                        console.log('hebrew');
                        $('article.hebrew div.strongsdef:first-child span:last-child').css({'font-size': value + "px !important", 'line-height', lineheight + "px"});
                        $('article.hebrew div.strongsdef:nth-child(2) span:last-child').css({'font-size': value + "px !important", 'line-height', lineheight + "px"});
                    }

                    if($('div.strongsdef').length){
                        $('div.strongsdef:nth-child(4) .strongsbody').css('line-height', $('div.strongsdef:nth-child(5)').height()+'px');
                    }

				}

			});

		}

	});

	

	

});

</script>

<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

<script type="text/javascript">

	jQuery(document).ready(function($){

		    $( "#s" ).autocomplete({

			  source: "<?php echo get_template_directory_uri();?>/search-ajax.php",

			  minLength: 3,

			  select: function( event, ui ) {

			  	location.replace(ui.item.url);

				//$('form#searchform').submit();

			  }

			}).autocomplete( "instance" )._renderItem = function( ul, item ) {

			

			var htmlchar = item.label;

			var strPos	=	htmlchar.toLowerCase().indexOf(item.desc.toLowerCase());

			//alert(htmlchar);

			//alert(strPos);

			var title="";

			if(item.title!=""){

				title = "<span class='search-title'>"+ item.title+"</span>"

			}

		if(strPos>0){

			 return $( "<li>" )

			.append( htmlchar.substr(0,strPos) + "<b>" + htmlchar.substr(strPos, item.len) + "</b>" + htmlchar.substr(strPos+item.len) + " "+title )

			.appendTo( ul );

		}

		else if(strPos< 0){

			 return $( "<li>" )

			.append( htmlchar+ " "+title)

			.appendTo( ul );

		}

		else

		{

			 return $("<li>" )

			.append( "<b>" + htmlchar.substr(strPos, item.len) + "</b>" + htmlchar.substr(item.len) + " "+title )

			.appendTo( ul );

		}

    };

		

	});

	

	

</script>

<?php wp_footer(); ?>

</body>

</html>