$(document).ready(
			function(){
			$(".toggle #titre_1").click(function () { $("#div_1").slideToggle("slow"); });
			$(".toggle #titre_2").click(function () { $("#div_2").slideToggle("slow"); });
			$(".toggle #titre_3").click(function () { $("#div_3").slideToggle("slow"); });
			$(".toggle #titre_4").click(function () { $("#div_4").slideToggle("slow"); });
			$(".toggle #titre_5").click(function () { $("#div_5").slideToggle("slow"); });

			if ( $("#msg_highlight").html() != '' ) { setInterval("jQuery('#msg_highlight').fadeOut(500); jQuery('#msg_highlight').fadeIn(500);",2000); }

			$(".toggle #titre_1, .toggle #titre_2, .toggle #titre_3, .toggle #titre_4, .toggle #titre_5").click(function () {
				var src = $("#"+this.id).parent('p').css('background-image');
				var etat = src.substr(src.length-7, 1);

				if ( etat == '-' ) { var etat = src.substr(src.length-6, 1); }

				if ( etat == 1 ) { $("#"+this.id).parent('p').css('background-image', "url('https://clients.wistee.fr/images/toggle-2.png')"); }
				else { $("#"+this.id).parent('p').css('background-image', "url('https://clients.wistee.fr/images/toggle-1.png')"); }
				return false;
			});

			setTimeout(function(){
				$('#header-serveursdedie').click(function () { return false; });
				$('#header-serveursdedie').animate({ opacity: 0.5 }, 1000);
				$('#header-serveurvirtuel').click(function () { return false; });
				$('#header-serveurvirtuel').animate({ opacity: 0.5 }, 1000);

				$('.cache').animate({ opacity: 0.6 }, 1000);
				/*if ($(window).height() < 700) {
					$(".header2").animate( { height:"15px" } , 1000 );
					$('.header2 p, .header2 li').fadeOut(1000);
				}*/
			}, 1500);
			
			$('.header-logo').html('<a href="http://www.wistee.fr/" title="Retour à l\'accueil"><span>Retour à l\'accueil</span></a>');
			
			$('.header2').toggle(
				function() {
					$(".header2").animate( { height:"15px" } , 1000 );
					$('.header2 p, .header2 li').fadeOut(1000);
				},

				function() {
					$(".header2").animate( { height:"135px" } , 1000 );
					$('.header2 p, .header2 li').fadeIn(1000);
				}
			);
			
			$("#n02").click(function () {
				if ( $("#n02 img").hasClass('logout') == true ) {
					bodyContent = $.ajax({
						url: "/ajax/identification.php?logout",
						global: false,
						type: "POST",
						data: '',
						dataType: "json",
						async: true,
						success: function(){
							$('#n01').html('<img src="/images/nr-01.png" alt="Retour à l\'accueil" />');
							$('#n01').attr('title', 'Retour à l\'accueil');
							$('#n01').attr('href', 'http://www.wistee.fr/');

							$('#n02').html('<img src="/images/nr-02.png" alt="Accès à l\'espace client" />');
							$('#n02').attr('title', 'Accès à l\'espace client');
							$('#n02').attr('href', 'https://clients.wistee.fr/');
							$("#n02 img").removeClass('logout');
						}
					}).responseText;
					return false;
				}
			});

			$('.navigation a[title], .qtip2[title]').qtip({
				style: {
					classes: 'ui-tooltip-youtube'
				}
			});
		}
);

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-10195818-3']);
_gaq.push(['_setDomainName', 'wistee.fr']);
_gaq.push(['_trackPageview']);

(function() {
	var ga = document.createElement('script');
	ga.type = 'text/javascript';
	ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0];
	s.parentNode.insertBefore(ga, s);
})();

