$(document).ready(function() {
  // TABS
      $('#ui-tabs-general').tabs({ fx: { opacity: 'toggle' } });
      $('#ui-tabs').tabs({ fx: { opacity: 'toggle' } });
      $('#prodpresta').tabs({ fx: { opacity: 'toggle' } });
      $('#cpart').tabs({ fx: { opacity: 'toggle' } });
	// BOUTIQUE
      $('.boxgrid.captionfull').hover(function(){$(".cover", this).stop().animate({opacity:0.8}, "fast");}, function() {$(".cover", this).stop().animate({opacity:0}, "slow");});
  // COLORBOX
        $.fn.colorbox.settings.bgOpacity = "0.8";
				$.fn.colorbox.settings.current = "{current}";
        $("a[rel='cats']").colorbox();
				$("a[rel='dogs']").colorbox({transition:"fade", current:"{current} sur {total}"});
				$("a.bebert").colorbox({transition:"fade"});
				$(".produitsboutique").colorbox({transition:"fade"});
				$("a[rel='fichesjoueurs']").colorbox({transition:"fade", fixedWidth:"90%", fixedHeight:"90%", iframe: true});
				$(".gallery-item a").colorbox({transition:"fade"});
  //ACCORDEONS
 				$("#menu_accordeon").accordion({ autoHeight: false, header: "h4.poignee" });  				
 				$("#menu_mobile").accordion({ header: ".mobile" });  				
 				// $("#chouettepartenaire").accordion({ active: false, autoHeight: false, header: ".chouettep" });
        // $("div#sabbath").accordion({ header: ".ozzy", autoHeight: true});
  // LISTE DE NEWS (index, archives, etc.)
      	$("ul.newslistqb li a").hover(
            function() {
              $(this).find("span").stop()
              .css("display","block")
              .css("z-index","999")
              $(this).find("img").stop()
              .animate({opacity:"1"}, "slow")
            },
            function() {
              $(this).find("span").stop()
              .css("z-index","4")
              .css("display","none")	
              $(this).find("img").stop()
              .animate({opacity:"0.75"}, "slow")
            }
				);
  // FIL INFOS
      	$(".paintitblack ul li a").hover(
            function() {
              $(this).find("img").stop()
              .animate({opacity:"1"}, "slow")
            },
            function() {
              $(this).find("img").stop()
              .animate({opacity:"0.50"}, "slow")
            }
				);
  // FIL INFOS
      	$("ul.keinelust li a").hover(
            function() {
              $(this).find("img").stop()
              .animate({opacity:"1"}, "fast")
            },
            function() {
              $(this).find("img").stop()
              .animate({opacity:"0.75"}, "fast")
            }
				);								
	// BILLETTERIE (anim billet)
        $("#nextgamedom a").hover(
          function() {
            $(this).find("img.billett").animate({ left: 1, opacity: 'show' }, 500);
          },
          function() {
            $(this).find("img.billett").animate({ left: -150, opacity: 'hide' }, 500);
          }			
        );	
  // ORGANIGRAMME CHOUETTPARTENAIRES
				/*
				$("ul.orgacplist li div").hover(
            function() {
              $(this).parent("li").stop()
              .animate({height:"172px"}, "slow")
              $(this).find("img.orga-portrait").stop()
              .css("display","block")
              .animate({opacity:"1"}, "slow")
            },
            function() {
              $(this).find("img.orga-portrait").stop()
              .animate({opacity:"0"}, "fast")
              .css("display","none")
              $(this).parent("li").stop()
              .animate({height:"36px"}, "fast")
            }
				);
				*/
  // 3 RESEAUX SOCIAUX
      lastBlock = $("ul.socialnetwork li.el a#a1");
      maxWidth = 118;
      minWidth = 50;	
      $("ul.socialnetwork li.el a").hover(
        function(){
          $(lastBlock).css("background","#cccccc").css("color","#666666").animate({width: minWidth+"px"}, { queue:false, duration:400 });
          $(this).css("background","#d40028").css("color","#ffffff").animate({width: maxWidth+"px"}, { queue:false, duration:400});
          lastBlock = this;
        }
      );
  // TABLEAUX alternance
      $("ul#nav1 li ul li:even").addClass("alt");
      $("ul.learntofly li:even").addClass("grohl");
      $("ul.bigme li:even").addClass("grohl");
      $("ul.newslistqb li:even").addClass("grohl");
      $(".keinelust ul li:even").addClass("grohl");
      $(".sidebox.paintitblack ul li:even").addClass("grohl");
         
  // DOWNLOADS
      $('#pDL').click(function () {$('#pDLdev').slideToggle('medium');});
      $('#pDLIcos').click(function () {$('#pDLdevIcos').slideToggle('medium');});
  // TOOLTIPS
      /*
      $('body *').tooltip({ 
          delay: 2500, 
          showURL: false,
          fade: 250
      });
      */
      $('.commx').tooltip({ 
          delay: 200, 
          showURL: false,
          fade: 100
      });
              
   // COOKIE
      function setCookie(name, value, expires, path, domain, secure) {
        document.cookie = name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
      }

      function setIntro() {
        setCookie("dfcointro", "1", "", "/");
      }
 
});
