$(document).ready(function(){$('#gallery-left').css('visibility','hidden')
$('#small-gallery-left').css('visibility','hidden')
$('#small-gallery-left').click(galleryTraverse);$('#small-gallery-right').click(galleryTraverse);$('#gallery-left').click(galleryTraverse);$('#gallery-right').click(galleryTraverse);var numChildren=$('#slide ul li').length;if($('#small-gallery-left').length>0){$('#slide').css('width',numChildren*66);};var clicks=Math.floor((numChildren-1)/5);var index=0;function galleryTraverse(e){var dir="+=0";if(e.target.name=="gallery-left"){dir="+="+String(124*5);index--;}
else if(e.target.name=="gallery-right"){dir="-="+String(124*5);index++;}
else if(e.target.name=="small-gallery-left"){dir="+="+String(66*5);index--;}
else if(e.target.name=="small-gallery-right"){dir="-="+String(66*5);index++;};if(index>=clicks){$('#gallery-right').css('visibility','hidden');$('#small-gallery-right').css('visibility','hidden')}
else{$('#gallery-right').css('visibility','visible');$('#small-gallery-right').css('visibility','visible')}
if(index<=0){$('#gallery-left').css('visibility','hidden');$('#small-gallery-left').css('visibility','hidden');}
else{$('#gallery-left').css('visibility','visible');$('#small-gallery-left').css('visibility','visible');};if(index>=0&&index<=clicks){$('#slide').animate({left:dir},200);}
else if(index>clicks){index=clicks;}
else if(index<0){index=0;};}
$('#small-gallery-right').mouseover(function(){$(this).attr('src','/images/assets/arr-right-small-hover.gif');});$('#small-gallery-left').mouseover(function(){$(this).attr('src','/images/assets/arr-left-small-hover.gif');});$('#small-gallery-right').mouseout(function(){$(this).attr('src','/images/assets/arr-right-small.gif');});$('#small-gallery-left').mouseout(function(){$(this).attr('src','/images/assets/arr-left-small.gif');});});
