$(document).ready( function(){
/**
* Most jQuery.localScroll's settings, actually belong to jQuery.ScrollTo, check its demo for an example of each option.
* @see http://flesler.demos.com/jquery/scrollTo/
* You can use EVERY single setting of jQuery.ScrollTo, in the settings hash you send to jQuery.LocalScroll.
*/
	
/**
* Restart the scroll position to ( 0, 0 ) (Firefox doesn't reset it)
* could use $(target).scrollTo( 0, {axis:'xy'));
* but this needs to be quick(synchronous), to reset before $.localScroll.hash() begins
*/

$("#gallerystationery").attr({scrollTop:0,scrollLeft:0
});

$("#gallerygraphic").attr({scrollTop:0,scrollLeft:0
});

$("#galleryweb").attr({scrollTop:0,scrollLeft:0
});

$("#galleryjewelry").attr({scrollTop:0,scrollLeft:0
});

// Scroll initially if there's a hash (#something) in the url 
$.localScroll.hash({
target: "#gallerystationery", //could be a selector or a jQuery object too.
axis:"xy",//the default is 'y'
queue:true,
duration:1500
});

$.localScroll.hash({
target: "#gallerygraphic", //could be a selector or a jQuery object too.
axis:"xy",//the default is 'y'
queue:true,
duration:1500
});

$.localScroll.hash({
target: "#galleryweb", //could be a selector or a jQuery object too.
axis:"xy",//the default is 'y'
queue:true,
duration:1500
});

$.localScroll.hash({
target: "#galleryjewelry", //could be a selector or a jQuery object too.
axis:"xy",//the default is 'y'
queue:true,
duration:1500
});

var $last = $([]);//save the last link

/**
* NOTE: I use $.localScroll instead of $('#navigation').localScroll() so I
* also affect the >> and << links. I want every link in the page to scroll.
*/
$.localScroll({
target: "#gallery", //could be a selector or a jQuery object too.
axis:"xy", //the default is 'y'
queue:true,
duration:1000,
hash:true,
onBefore:function( e, anchor, $target ){//'this' is the clicked link
$last.removeClass("scrolling");
$last = $(this).addClass("scrolling");
if( this.blur )
this.blur();//remove the awful outline
},
onAfter:function( anchor ){
$last.removeClass("scrolling");
}
});

$.localScroll({
target: "#gallerydesign", //could be a selector or a jQuery object too.
axis:"xy", //the default is 'y'
queue:true,
duration:1000,
hash:true,
onBefore:function( e, anchor, $target ){//'this' is the clicked link
$last.removeClass("scrolling");
$last = $(this).addClass("scrolling");
if( this.blur )
this.blur();//remove the awful outline
},
onAfter:function( anchor ){
$last.removeClass("scrolling");
}
});

$.localScroll({
target: "#gallerystationery", //could be a selector or a jQuery object too.
axis:"xy", //the default is 'y'
queue:true,
duration:1000,
hash:true,
onBefore:function( e, anchor, $target ){//'this' is the clicked link
$last.removeClass("scrolling");
$last = $(this).addClass("scrolling");
if( this.blur )
this.blur();//remove the awful outline
},
onAfter:function( anchor ){
$last.removeClass("scrolling");
}
});

$.localScroll({
target: "#gallerygraphic", //could be a selector or a jQuery object too.
axis:"xy", //the default is 'y'
queue:true,
duration:1000,
hash:true,
onBefore:function( e, anchor, $target ){//'this' is the clicked link
$last.removeClass("scrolling");
$last = $(this).addClass("scrolling");
if( this.blur )
this.blur();//remove the awful outline
},
onAfter:function( anchor ){
$last.removeClass("scrolling");
}
});

$.localScroll({
target: "#galleryweb", //could be a selector or a jQuery object too.
axis:"xy", //the default is 'y'
queue:true,
duration:1000,
hash:true,
onBefore:function( e, anchor, $target ){//'this' is the clicked link
$last.removeClass("scrolling");
$last = $(this).addClass("scrolling");
if( this.blur )
this.blur();//remove the awful outline
},
onAfter:function( anchor ){
$last.removeClass("scrolling");
}
});

$.localScroll({
target: "#galleryjewelry", //could be a selector or a jQuery object too.
axis:"xy", //the default is 'y'
queue:true,
duration:1000,
hash:true,
onBefore:function( e, anchor, $target ){//'this' is the clicked link
$last.removeClass("scrolling");
$last = $(this).addClass("scrolling");
if( this.blur )
this.blur();//remove the awful outline
},
onAfter:function( anchor ){
$last.removeClass("scrolling");
}
});

});


