<?php

if(get_theme_mod('contact_area_disable') != 'on' ){
	?>
	<!-- contact Area Start -->
	<?php 
		if( get_theme_mod('contact_areaTpadding',true) ) {
			$contact_areaTpadding = 'padding-top:'.esc_attr(get_theme_mod('contact_areaTpadding')).';';
		}
		if( get_theme_mod('contact_areaBpadding',true) ) {
			$contact_areaBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('contact_areaBpadding')).';';
		}	

		if( get_theme_mod('contact_areaOpacity',true) ) {
			$contact_areaOpacity = 'opacity:'.esc_attr(get_theme_mod('contact_areaOpacity')).';';
		}
	?>		
	<div class="contact-area" id="contact">
		<div class="contact_gradiant "></div>
		<?php
			$showStatic = true;
			for( $i = 1; $i < 3; $i++ ){
				$url = get_theme_mod('contact_page_url_'.$i, '#');
				$link = get_theme_mod('contact_page_link'.$i);
				$contact_page_id = get_theme_mod('contact_page_icon'.$i); 
				if(!empty($contact_page_id)){
					$showStatic = false;
					break;
				}
			}
		?>
		<div class="container">  
			<div class="row">
				<div class="col-md-4 col-sm-4 col-xs-12 wow zoom"></div>
				<div class="col-md-2 col-sm-2 col-xs-12 wow zoom">
				<?php
					$contact_number = get_theme_mod('contact_number', '24/7');
					$contact_text = get_theme_mod('contact_text', 'emergancy service');

					$contact_page_maintitle = get_theme_mod('contact_page_maintitle', 'Contact With Us?');
					$contact_address = get_theme_mod('contact_address', 'Address: <span>C42 - Downtown Los Angeles ,USA</span>');
					$contact_mobile = get_theme_mod('contact_mobile', 'Mobile: +012 (3456) 7788');
					$contact_mail = get_theme_mod('contact_mail', 'Mail: info@gentechtree.com');
				?>
					<?php if($contact_number || $contact_text){ ?>
					<div class="emergencybx">
						<div class="emergencybxinn">
							<div class="number"><?php echo ($contact_number);  ?></div>
							<p><?php echo ($contact_text);  ?></p>
						</div>
					</div>
					<?php }?>
				</div>
				<div class="col-md-6 col-sm-6 col-xs-12 wow zoom">
					<div class="contact-detail">
						<?php if($contact_page_maintitle){ ?>
						<div class="section-title">
							<h2><?php echo ($contact_page_maintitle);  ?></h2>
						</div>
						<?php }?>
						<!-- <div class="section-area-text"> -->
							<p><?php echo ($contact_address);  ?></p>
							<p><a href="tel:<?php echo $contact_mobile;?>"><?php echo ($contact_mobile);  ?></a></p>
							<p><a href="mailto:<?php echo $contact_mail;?>"><?php echo ($contact_mail);  ?></a></p>
						<!-- </div> -->
						<div class="clearfix"></div>

					<?php
				      $contactbutton = get_theme_mod('contact_btn_txt', 'CALL NOW'); 
				      $contactbtnlink = get_theme_mod('contact_btnlink', '#');
				    ?> 

				      <?php if( get_theme_mod('contact_button_display','show' ) == 'show') :
				        ?>  
				        <div class="contact-btn">
				          <a href="<?php echo $contactbtnlink;?>">      
				            <?php echo ($contactbutton );  ?>
				          </a></div>
				        <?php endif ?>
					</div>

				</div>
			</div>
	<div class="clearfix"></div>
		</div>
	</div> 
	<!-- contact Area Start -->
<script>
	var matchHeight = function () {
	
	function init() {
		eventListeners();
		matchHeight();
	}
	
	function eventListeners(){
		$(window).on('resize', function() {
			matchHeight();
		});
	}
	
	function matchHeight(){
		var groupName = $('[feature-match-height]');
		var groupHeights = [];
		
		groupName.css('min-height', 'auto');
		
		groupName.each(function() {
			groupHeights.push($(this).outerHeight());
		});
		
		var maxHeight = Math.max.apply(null, groupHeights);
		groupName.css('min-height', maxHeight);
	};
	
	return {
		init: init
	};
	
} ();

$(document).ready(function() {
	matchHeight.init();
});
</script>
	
<?php } 