$(document).ready(function(){


	//Scrollable
	$("#sidebar_marques>div").scrollable({
		size: 1
		}).circular().autoscroll({
		steps: 1,
		interval: 3000
	});

    // Animate Hover
	$('ul#item_list li').hover(function(){
		$(this).find('.item_photo').animate({top:'-80px'},{queue:false,duration:200});
	}, function(){
		$(this).find('.item_photo').animate({top:'0px'},{queue:false,duration:400});
	});

    // Accordion Image Menu
	if ($('#accordion').length) { // implies *not* zero
	    $('#accordion').AccordionImageMenu({
        'border': 2,
        'color': '#fff',
        'height': 213,
        'openDim': 320,
        'closeDim': 81
	    });
	}
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		$('#accordion .item_list_item').css({
			backgroundPosition: "0 0"
				}).hover(function() {
				$(this).stop().animate({
				backgroundPosition: "-960px 0px"
				}, {
				duration: 500
			});
			}, function() {
				$(this).stop().animate({
				backgroundPosition: "0px 0px"
				}, {
				duration: 500
			});
		});
	}
	else
	{
		$('#accordion .item_list_item').css({
			backgroundPosition: "0 0"
				}).hover(function() {
				$(this).stop().animate({
				backgroundPosition: "-640px 0px"
				}, {
				duration: 500
			});
			}, function() {
				$(this).stop().animate({
				backgroundPosition: "0px 0px"
				}, {
				duration: 500
			});
		});
	}


	//LightBox
	$.Lightbox.construct({
		"show_linkback": true,
		"download_link": true,
		"keys": {
			"close":	'f',
			"prev":		'p',
			"next":		's'
		},
		"text": {
			// For translating
			"image":		"Photo",
			"of":			"de",
			"close":		"Fermer",
			"closeInfo":	"Vous pouvez cliquer à côté pour fermer.",
			"download":		"Télécharger.",
			"help": {
				"close":	"Clickez pour fermer",
				"interact":	"Survol pour intéragir"
			},
			"about": {
				"text": 	"jQuery Lightbox Plugin (balupton edition)",
				"title":	"Licenced under the GNU Affero General Public License.",
				"link":		"http://www.balupton.com/projects/jquery-lightbox"
			}
		}
	});

	//AviaSlider
	$('#direction-fade-slider').aviaSlider({
		blockSize: {height: 3, width:'full'},
		autorotationSpeed:4,
		display: 'topleft',
		transition: 'fade',
		betweenBlockDelay:10,
		animationSpeed: 1200,
		showText: false,
		switchMovement: true
	});
	$('#fullwidth-fade-slider').aviaSlider({
		autorotationSpeed:4,
		animationSpeed: 1200,
		showText: false
	});
	$('#winding-blocks').aviaSlider({
		animationSpeed: 1000,
		betweenBlockDelay: 20,
		blockSize: {
			height: 25,
			width: 25
		},
		transition: 'slide',
		display: 'topleft',
		switchMovement: false
	});								

	//Cufon
/*	Cufon.replace('#content h1', {
		color: '-linear-gradient(#999, 0.45=#666, 0.45=#000, #999)',
		textShadow: '1px 1px rgba(0,0,0,.75), -1px -1px rgba(0,0,0,.75), 1px -1px rgba(0,0,0,.75), -1px 1px rgba(0,0,0,.75)'
	});*/
	Cufon.replace('#content h1, #sidebar_infos h2, #category_item_level1_list ul#item_list li .item_list_item h3', {
		color: '-linear-gradient(#999, 0.45=#666, 0.45=#000, #999)',
		textShadow: '1px 1px rgba(255,255,255,.75), -1px -1px rgba(255,255,255,.75), 1px -1px rgba(255,255,255,.75), -1px 1px rgba(255,255,255,.75)'
	});


	/* ouvre nouvelle fenêtre pour lien avec http */
    $('a[href^=http]').click( function() {
        window.open(this.href);
        return false;
    });
});

