<?php
?>
<!DOCTYPE html>
<?php
define('ME_URL', plugins_url('/', __FILE__));
?>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8)  ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->

<head>
    <meta charset="<?php bloginfo('charset'); ?>" />
    <meta name="viewport" content="width=1000" />
    <meta name="google-site-verification" content="sD8YH81_a0pMpqbAAn739ONWV99Wiu73DRbmgZwGWeY" />

    <title><?php wp_title('|', true, 'right'); ?></title>

    <link rel="profile" href="http://gmpg.org/xfn/11">
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
    <link href='https://fonts.googleapis.com/css?family=PT+Sans:400,700' rel='stylesheet' type='text/css'>

    <!--[if lt IE 9]>
	<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
	<![endif]-->
    <?php wp_head(); ?>

    <link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/print.css" media="print" />

    <!--<script type="text/javascript" src="/js/GAstatmediateur.js"></script>-->
    <script type="text/javascript" src="https://code.jquery.com/jquery-migrate-1.4.1.min.js"></script>
    <script type="text/javascript">
        jQuery('.nav-mobile select').live('change', function() {
            location.href = jQuery(this).val();
        });
    </script>
</head>

<body <?php body_class(); ?>>
    <div id="acces-direct" style="display:none">
        Accès direct au :
        <ul>
            <li><a href="#menu" tabindex="0">Menu</a></li>
            <li><a href="#search" tabindex="0">Recherche</a></li>
            <li><a href="#contenu" tabindex="0">Contenu</a></li>
            <li><a href="#footer" tabindex="0">Pied de page</a></li>
        </ul>
    </div>
    <div id="page" class="hfeed site">
        <div id="bg-header" class="hfeed site">
            <header id="masthead" class="site-header" role="banner">
                <div class="contenu_header">
                    <div class="wrapper">
                        <ul class="tools">
                            <li><button id="bt-police-moins" value="moins" onclick="tailleTexte(this);" style="padding: 1px 8px 8px 8px" disabled="disabled">A-</button><button style="padding: 1px 8px 0 8px; line-height: 15px;" value="plus" onclick="tailleTexte(this);" id="bt-police-plus" disabled="disabled">A+</button></li>
                            <!-- <li><button id="print" onclick="window.print();" disabled="disabled"  style="padding: 1px 8px 0 8px"><img src="<?php echo get_template_directory_uri(); ?>/images/print.png" alt="Imprimer" /></button></li> -->
                        </ul>
                        <h1 class="header"><a href="<?php echo esc_url(home_url('/')); ?>">
                                <span class="mediateur-titre">Le médiateur</span> <span style="font-size: 0.6em;"><span class="mediateur-titre2">de la consommation auprès de la Caisse Régionale de Crédit Agricole Mutuel de Paris et d'Ile-de-France</span> <img src="<?php echo get_template_directory_uri(); ?>/images/logoCAIDF.svg" alt="Crédit Agricole d'Ile de France" title="Crédit Agricole d'Ile de France" /></span>
                            </a></h1>
                        <!--h2 class="site-description"><?php bloginfo('description'); ?></h2-->
                    </div>
                </div>
                <!--</a>-->
                <div class="action_zoom">
                    <?php if (function_exists('dynamic_sidebar')) dynamic_sidebar('Emplacement pour les bouttons zoom et print'); ?>
                </div>
            </header><!-- #masthead -->
            <a id="menu"></a>
            <div id="navbar" class="navbar">
                <div class="wrapper">
                    <div class="menu">Menu</div>
                    <nav id="site-navigation" class="navigation main-navigation" role="navigation">
                        <?php
                        $menu_items = wp_get_nav_menu_items("menu_home");
                        $menu_list = '<ul class="nav-menu">';
                        $menu_mobile = '<div class="nav-mobile"><select>';

                        foreach ((array) $menu_items as $key => $menu_item) {
                            $title = trim($menu_item->title);
                            $url = $menu_item->url;
                            $className = "";
                            $selected = "";
                            if ($key == 0) {
                                $className = "accueil";
                            }
                            if ((is_home() && $className == "accueil") || (isset($post->post_parent) && $post->post_parent == $menu_item->object_id) || (isset($post->ID) && $post->ID == 4 && strtolower($title) == "votre réclamation")) {
                                $className .= ' active';
                                $selected = ' selected="selected"';
                            }

                            $menu_list .= '<li class="item-' . $key . ' ' . $className . '"><a href="' . $url . '">' . $title . '</a></li>';
                            $menu_mobile .= '<option' . $selected . ' value="' . $url . '">' . $title . '</option>';
                        }

                        $menu_list .= '</ul>';
                        $menu_mobile .= '</select></div>';
                        echo $menu_list;
                        echo $menu_mobile;
                        ?>

                        <div class="bloc_recherche">
                            <a id="search"></a>
                            <?php get_search_form(); ?>
                            <div style="clear:both"></div>
                        </div>
                        <div style="clear:both"></div>
                    </nav><!-- #site-navigation -->
                </div><!-- .wrapper -->
            </div><!-- #navbar -->
            <div style="clear:both"></div>
        </div><!-- #bg-header -->
        <div class="contenu fil">
            <div class="wrapper">
                <?php // Breadcrumb navigation
                if (!is_home()) {
                    if (is_page() && !is_front_page() || is_single() || is_category()) {
                        echo '<ul>';
                        echo '<li><a title="Accueil" rel="nofollow" href="/">Accueil</a>&nbsp;/</li>';

                        if (is_page()) {
                            $ancestors = get_post_ancestors($post);

                            if ($ancestors) {
                                $ancestors = array_reverse($ancestors);

                                foreach ($ancestors as $crumb) {
                                    echo '<li>&nbsp;<a href="' . get_permalink($crumb) . '">' . get_the_title($crumb) . '</a> / </li>';
                                }
                            }
                        }

                        if (is_single()) {
                            $category = get_the_category();
                            //echo '<li>&nbsp;<a href="'.get_category_link($category[0]->cat_ID).'">'.$category[0]->cat_name.'</a> &nbsp;/ </li>';
                        }

                        if (is_category()) {
                            $category = get_the_category();
                            echo '<li>&nbsp; ' . $category[0]->cat_name . '</li>';
                        }

                        // Current page
                        if (is_page() || is_single()) {
                            echo '<li>&nbsp;' . get_the_title() . '</li>';
                        }
                        echo '</ul>';
                    } elseif (is_front_page()) {
                        // Front page
                        echo '<ul>';
                        echo '<li><a title="Accueil" rel="nofollow" href="/">Accueil</a> / </li>';
                        echo '</ul>';
                    }
                }
                ?>
            </div>
        </div>
        <div style="clear:both"></div>
        <a id="contenu"></a>
        <div id="main" class="site-main">
            <div class="wrapper">