$(document).ready(function(){	
		$('a[href^=mailto:]').addClass('mail');
				$('a[href$=.pdf]').addClass('pdf');
				
				
				$("#header").click(
					function(){    window.location = $(this).attr("url");
					});
				
				$('#menu1').ptMenu();	
				$('#left_nav').fadeIn("slow");
				
				$('.potato-menu-has-holizontal>a').removeAttr("href");

	$("#left_bot").click(function() {
	 if ($("#container").is(":hidden")) {
		  $("#left_bot").css("background-image","url(/fr/wp-content/themes/BB/img/hide.jpg)"); 
        $("#container").fadeIn("slow");
		$("#back_nav").fadeOut("slow");
      } else {
		 $("#left_bot").css("background-image","url(/fr/wp-content/themes/BB/img/show.jpg)"); 
        $("#container").fadeOut("slow");
		$("#back_nav").fadeIn("slow");
      }
    });
	
	

	
	
$(function () {
        var img = new Image();		
        $(img).load(function () { 
            $(this).hide();
            $('#bg_fix').removeClass('loading').append(this);
            $(this).fadeIn();
        }).error(function () {
            // notify the user that the image could not be loaded
        }).attr({'src':'/fr/wp-content/themes/BB/img/bg_1.jpg',
					'class':'source-image'
		});
    });

$('#back_nav ul li a').click(function(){
							var txt = $(this).text();
							$('#back_nav ul li a').removeClass('current');
							$(this).addClass('current');
							$("#bg_fix .source-image").remove();
							var img = new Image();
						
        $(img).load(function () {
            //$(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already
            $(this).hide();
            $('#bg_fix').removeClass('loading').append(this);
            $(this).fadeIn();
        }).error(function () {
            // notify the user that the image could not be loaded
        }).attr({'src':'/fr/wp-content/themes/BB/img/bg_'+ txt +'.jpg',
					'class':'source-image'
		});
							  return false;
		 })

$(function() {
		$("#tabs").tabs();});


$("#myList").listnav({		
					 					initLetter: '', 
										includeAll: false, 
										includeOther: true, 
										flagDisabled: true, 
										noMatchText: 'Nothing matched your filter, please click another letter.', 
										showCounts: false, 
										prefixes: ['the','a'] 
									  });
$("#myList1").listnav({		
					 					initLetter: '', 
										includeAll: false, 
										includeOther: true, 
										flagDisabled: true, 
										noMatchText: 'Nothing matched your filter, please click another letter.', 
										showCounts: false, 
										prefixes: ['the','a'] 
									  });

$("#myList2").listnav({
									 
									 	initLetter: '', 
										includeAll: false, 
										includeOther: true, 
										flagDisabled: true, 
										noMatchText: '--------', 
										showCounts: false, 
										prefixes: ['the','a'] 
									  });




$(".ch").click(function(){
						$("#film_cont,#film_cont > *").fadeOut("fast");
						$("#mes_cont").fadeOut("fast");
						$("#livre_cont,#livre_cont >*").fadeOut("fast");
						$("#ch_cont").fadeIn("slow");
						
						})
$(".film").click(function(){
						$("#film_cont,#film_cont > *").fadeIn("slow");
						$("#mes_cont").fadeOut("fast");
						$("#livre_cont,#livre_cont >*").fadeOut("fast");
						$("#ch_cont").fadeOut("fast");
						
						})
$(".livre").click(function(){
						$("#film_cont,#film_cont > *").fadeOut("fast");
						$("#mes_cont").fadeOut("fast");
						$("#livre_cont,#livre_cont >*").fadeIn("slow");
						$("#ch_cont").fadeOut("fast");
						
						})
$(".mes").click(function(){
						$("#film_cont,#film_cont > *").fadeOut("fast");
						$("#mes_cont").fadeIn("slow");
						$("#livre_cont,#livre_cont >*").fadeOut("fast");
						$("#ch_cont").fadeOut("fast");
						
						})







})




