<?php
$fp_id = get_option( 'page_on_front' );
defined('ABSPATH') or die('this is the last candy you will eat...');
?>
	<div class="mini_overlay"></div>
	<div class="extra_overlay"></div>
	<div class="help_menu">
		<div class="icon"><i class="ac3-help-with-circle"></i><div class="menu_text"><?=__('Help','portfolio_madness');?></div>
		</div>
		<div class="help menu">
			<h3 align="center"><?=__('Help','portfolio_madness')?></h3>
			<div class="col-xs-12 col-md-8">
				<ul class="help">
					<li class="full-line help-tip"><i class="ac3-arrow-bold-left"></i> <?=__('Main Menu','portfolio_madness')?></li>
					<li class="full-line help-tip"><i class="ac3-arrow-bold-left"></i> <?=__('Social Networks','portfolio_madness')?></li>
					<li class="full-line help-tip"><i class="ac3-arrow-bold-left"></i> <?=__('Share','portfolio_madness')?></li>
					<li class="full-line help-tip"><i class="ac3-arrow-bold-left"></i> <?=__('Languages','portfolio_madness')?></li>
					<li class="full-line help-tip"><i class="ac3-arrow-bold-left"></i> <?=__('Current Background Image','portfolio_madness')?></li>
				</ul>
			</div>
			<div class="col-xs-12 col-md-4">
			</div>
		</div>
	</div>
	<div class="main_menu">
		<div class="icon"><i class="ac3-menu"></i><div class="menu_text"><?=__('Main Menu','portfolio_madness');?></div>
		</div>
		<div class="menu" id="the_real_deal">
			<h3 align="center"><?=__('Main Menu','portfolio_madness')?></h3>
			<?php 
			
			ob_start();
				wp_nav_menu( array( 'theme_location' => 'top','container' => false,'menu_class'=>'main_menu') );
			$menu=ob_get_clean();
			$menu=str_replace('href="'.site_url(),'data-action="ajax" href="',$menu);
			$menu=str_replace('href="/', 'href="', $menu);
			$menu=str_replace('/"', '"', $menu);
			echo $menu;
			?>
		</div>
	</div>
	<div class="social_networks">
		<div class="icon"><i class="ac3-share-alt"></i><div class="menu_text"><?=__('Social Networks','portfolio_madness');?></div>
		</div>
			<div class="menu">
			<h3 align="center"><?=__('Social Networks','portfolio_madness')?></h3>
				<ul class="header_menu_social">
					<?php 
					$socialicons=get_field('social',$fp_id);
					if(!empty($socialicons)):
						foreach($socialicons as $icon):?>
					<li><a href="<?=$icon['link']['url'];?>" target="<?=$icon['link']['target'];?>" class="social-<?=$icon['icon']?>"><i class="ac3-<?=$icon['icon'];?>"></i></a></li>
					<?php 
						endforeach;
						//print_r('<!--');
						//print_r($socialicons);
						//print_r('-->');
					endif;?>
				</ul>
			</div>
	</div>
	<div class="social_share">
		<div class="icon"><i class="ac3-paper-plane"></i><div class="menu_text"><?=__('Share','portfolio_madness');?></div>
		</div>
		<div class="menu">
			<h3 align="center"><?=__('Share','portfolio_madness')?></h3>
			<ul class="header_menu_social">
				<li><a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&amp;t=<?php the_title(); ?>" target="_BLANK" title="Share on Facebook." class="social-facebook"><i class="ac3-facebook"></i></a></li>
				<li><a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" target="_BLANK" title="Vote on Reddit" class="social-reddit"><i class="ac3-reddit"></i></a></li>
				<li><a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="Stumble it" target="_BLANK" class="social-stumbleupon"><i class="ac3-stumbleupon"></i></a></li>
				<li><a href="http://digg.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="Digg this!" target="_BLANK" class="social-digg"><i class="ac3-digg"></i></a></li>
				<li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;title=<?php the_title(); ?>&amp;url=<?php the_permalink(); ?>" title="Share on LinkedIn" target="_BLANK" class="social-linkedin"><i class="ac3-linkedin"></i></a></li>
				<li><a href="http://del.icio.us/post?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="Bookmark on del.icio.us" target="_BLANK" class="social-delicious"><i class="ac3-delicious"></i></a></li>
				<li><a href="https://plus.google.com/share?url=<?php the_permalink(); ?>" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" target="_BLANK" class="social-googleplus"><i class="ac3-googleplus"></i></a></li>
				<li><a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); echo $url; ?>" target="_BLANK" class="social-pinterest"><i class="ac3-pinterest"></i></a></li>
				<li><a href="http://twitter.com/home/?status=<?php the_title(); ?> - <?php the_permalink($post->ID) ?>" title="Tweet this!" target="_BLANK" class="social-twitter"><i class="ac3-twitter"></i></a></li>
			</ul>
		</div>
	</div>
	<div class="languages">
		<div class="icon"><i class="ac3-language"></i><div class="menu_text"><?=__('Language','portfolio_madness');?></div>
		</div>
		<div class="menu">
			<h3 align="Language"><?=__('Language','portfolio_madness')?></h3>
			<ul class="header_languages_menu">
				<?php
				$languages=icl_get_languages('skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str');
				if(!empty($languages)){
					foreach($languages as $lang){
						?><li><a href="<?=($lang['active']==1)?'#':$lang['url'];?>" class="<?=($lang['active']==1)?'active':'';?>"><?=substr(strtoupper($lang['language_code']),0,2);?></a></li><?php
					}
				} 
				?>
			</ul>
		</div>
	</div>
	<div class="image">
		<div class="icon"><i class="ac3-image"></i><div class="menu_text"><?=__('This Image','portfolio_madness')?></div>
		</div>
		<div class="menu">
			<h3 align="center"><?=__('This Image','portfolio_madness')?></h3>
			<div class="col-xs-12 col-md-8">
				<img class="menu_special_image" src="<?=background();?>"/>
			</div>
			<div class="col-xs-12 col-md-4">
				<ul>
					<li>
						<?php 
						$ext=explode('.',background());
						$ext=$ext[count($ext)-1];
						?>
						<a href="<?=background();?>" download="IMG<?=date('d').'.'.$ext;?>" target="_BLANK"><?=__('Download Image','portfolio_madness');?></a>
					</li>
				</ul>
			</div>
		</div>
	</div>