/*
 *
 *	@titre: layout.
 *	@description: javascript layout - Moniteur Archizz.
 *	@auteur: neov - http://www.neov.net.
 *	@creation: 20090602.
 *	@modification: -.
 *	@requires: jquery 1.3.2
 *
*/

$(
	function()
	{
		// simulation target blank.
		$('.target-blank').click(
			function()
			{
				window.open($(this).attr('href'));			
				return false;
			}
		);
		
		// affichage aide.
		$('.aide').each(
			function()
			{
				var $this = $(this);
				var time = 100;			
				$this.find('a.aide-btn').click(
					function()
					{
						$this.find('.aide-content').toggle(time);			
						$this.find('.aide-content').queue(
							function()
							{
								if ($(this).is(':visible')) {
									$this.find('a.aide-btn').attr({title: 'Cacher l\'aide'});
								} else {
									$this.find('a.aide-btn').attr({title: 'Afficher l\'aide'});
								}								
								$(this).dequeue();
							}
						);					
						return false;
					}
				);
				
				$this.find('a.aide-fermer').click(
					function()
					{
						$this.find('.aide-content').slideUp(time);
						$this.find('a.aide-btn').attr({title: 'Afficher l\'aide'});						
						return false;
					}
				);
			}
		);
		
		// impression.
		$('.print').click(
			function()
			{
				window.print();
				return false;
			}
		);
		
		// scrollpane.
		$('.scrollpane').jScrollPane({
			showArrows:			true, 
			scrollbarWidth: 	19, 
			arrowSize: 			11, 
			scrollbarMargin:	5,
			dragWidth:			9
		});
		
		$('.rjnt-liste').jScrollPane({
			showArrows:			true, 
			scrollbarWidth: 	19, 
			arrowSize: 			11, 
			scrollbarMargin:	5,
			dragWidth:			9
		});

		$('.list-inner ul').jScrollPane({
			showArrows:			true, 
			scrollbarWidth: 	19, 
			arrowSize: 			11, 
			scrollbarMargin:	5,
			dragWidth:			7
		});
		
		
		$('.bloc-list-inner ul').jScrollPane({
			showArrows:			true, 
			scrollbarWidth: 	19, 
			arrowSize: 			11, 
			scrollbarMargin:	5,
			dragWidth:			7
		});
		
		
	}
);