/* 
 * les fonctions jquery qui g�re les hover
 */

function survoleImageTitre() 
{
    /************* hover des images *******************************************/
    $(".conteneur_photo").each(function(index)
    {
        $(this).hover(
            function()
            {
                //$(this).addClass('photoHover');
                //showTour($(this), donnees);
                $(".onglet").eq(index).hide();
                $(".tour").eq(index).show();
                $(".titres li").eq(index).addClass('titreHover');
            },
            function()
            {
                //$(this).removeClass('photoHover');
                $(".onglet").eq(index).show();
                $(".tour").eq(index).hide();
                $(".titres li").eq(index).removeClass('titreHover');
            }
        );
    });
    /********************* hover des titres ***********************************/
    $(".titres li").each(function(index)
    {
        $(this).hover(
            function()
            {
                $(this).addClass('titreHover');
                //$(".conteneur_photo").eq(index).addClass('photoHover');
                $(".onglet").eq(index).hide();
                $(".tour").eq(index).show();
            },
            function()
            {
                $(this).removeClass('titreHover');
                //$(".conteneur_photo").eq(index).removeClass('photoHover');
                $(".onglet").eq(index).show();
                $(".tour").eq(index).hide();
            }
        );
        $(this).click(function ()
        {
            var $ancre= $(".conteneur_photo").eq(index).find("a");
            //alert($ancre.attr('href'));
            $(this).colorbox({
                    href: function (){
                        return ""+$ancre.attr('href');
                    },
                    transition:"elastic",
                    innerWidth:600
            });
            /*$ancre.colorbox({title: function(){
                var url = $(this).attr('href');
                return '<a href="'+url+'" target="_blank">Open In New Window</a>';
            }})*/
            /*$ancre.colorbox({
                    href: function (){
                        return $(this).attr('href');
                    },
                    transition:"elastic",
                    innerWidth:550,
                    innerHeight:320
            }); */   
        });      
    });
}
