/*
   _____   ____   _____ ______ _      
  |  __ \ / __ \ / ____|  ____| |     
  | |__) | |  | | (___ | |__  | |     
  |  _  /| |  | |\___ \|  __| | |     
  | | \ \| |__| |____) | |____| |____ 
  |_|  \_\\____/|_____/|______|______| v1.0
  
  Filename:		init_spectacles.js
  Created: 		March-21-2009 4:58AM
  Modified:	 	March-21-2009 4:58AM
  Authors: 		Julien Iafrancesco
  Description:
  				Javascript for spectacles.php
*/
var curAnchor; // Accessible in html
$(document).ready(function(){

	var defaultAnchor = $('.scrollAnchor:first');
	curAnchor = defaultAnchor
	
	$("#scrollZone").scrollTo(curAnchor,0);
	$('#fleche2').click(function(){
		if(curAnchor.length == 0)
			curAnchor = defaultAnchor;
		var prev = curAnchor.prevAll('.scrollAnchor:first');
		if ( prev.length > 0)
			curAnchor = prev;
		$("#scrollZone").stop().scrollTo(curAnchor,500);
	});
	
	$('#fleche3').click(function(){
		if(curAnchor.length == 0)
			curAnchor = defaultAnchor;
		var next = curAnchor.nextAll('.scrollAnchor:first');
		if ( next.length > 0)
			curAnchor = next;
		$("#scrollZone").stop().scrollTo(curAnchor,500);
	});
});