// JavaScript Document

$(document).ready(function() { 
						   
	// DISCLAIMER
	
    doc = jQuery(document).height(); 
	$('#disclaimer').css('height', doc);
	
	$("#disclaimer .entre").click( function(e) { 
	 	e.preventDefault();
		$('#disclaimer').css('display', 'none');
	});	

	
						   
	// NEWSLETTER + RECHERCHE				   

	$('#mail').focus(function () {
		$(this).val('');
	});
	
	$('#moteur').focus(function () {
		$(this).val('');
	});
	
	
	// DEFILEMENT GALERIES
	
	$("#scroller").scrollable({circular: true}).autoscroll({autoplay:true, autopause:true });
	
	
	$('.item').click(function() {
		url=$(this).find('a').attr("href");
		window.location.href = url;
	});
	
	$('.item').hover(function() {  
		$(this).find('.info').css('display', 'block'); 
	},  
	function() { 
		$(this).find('.info').css('display', 'none'); 
	}); 
	
	
	// LISTE ACTU

	
	$('.liste li.bloc').click(function() {
		url=$(this).find('a').attr("href");
		window.location.href = url;
	});
	
	
	// SCROLL DEPECHES  / AGENDA LGBT	
	
	var pane = $('#depeches .scroll');
	pane.jScrollPane({animateScroll: true});
	var api = pane.data('jsp');


	$('#depeches .up').bind('click',function(){
		pas=$('#depeches .scroll').css("height");
		position= pas.indexOf('px'),
		pas= pas.substring(0,position);
		api.scrollByY(-pas);
		return false;
		}
	);
	
	$('#depeches .down').bind('click',function(){
		pas=$('#depeches .scroll').css("height");
		position= pas.indexOf('px'),
		pas= pas.substring(0,position);
		api.scrollByY(pas);
		return false;
		}
	);
	
	
	
	
	var pane3 = $('#agenda .scroll');
	pane3.jScrollPane({animateScroll: true});
	var api3 = pane3.data('jsp');


	$('#agenda .up').bind('click',function(){
		pas=$('#agenda .scroll').css("height");
		position= pas.indexOf('px'),
		pas= pas.substring(0,position);
		api3.scrollByY(-pas);
		return false;
		}
	);
	
	$('#agenda .down').bind('click',function(){
		pas=$('#agenda .scroll').css("height");
		position= pas.indexOf('px'),
		pas= pas.substring(0,position);
		api3.scrollByY(pas);
		return false;
		}
	);
	
	
	
	
	
	// LISTE MEME SUJET
	
	$('#article .article .outils .sujet').click(function() {
		url=$(this).find('a').attr("href");
		window.location.href = url;
	});


});
