
var o=jQuery.fn.gallery=function(settings)
{settings=jQuery.extend({selectedSelector:"#body img.selected",selected:null},settings);var hash="";hash=location.hash;if(hash.indexOf("#")==-1){hash="#"+hash;}
if(hash!="#"){jQuery(settings.selectedSelector).removeClass("selected");jQuery(hash).addClass("selected");}
settings.selected=jQuery(settings.selectedSelector);update=function(selected,a)
{jQuery("#body li.selected").removeClass("selected");a.parent().addClass("selected");var src="url("+selected.attr("src")+")";jQuery("#wrapper").css("backgroundImage",src);};update(settings.selected,jQuery("a[href="+hash+"]"));jQuery("#body .nav").css("display","block");jQuery("#body .nav li a",this).bind("click",function(e)
{var href=jQuery(this).attr("href");var img=jQuery(href);settings.selected=img;update(settings.selected,jQuery(this));});jQuery("#left",this).bind("click",function(e)
{e.preventDefault();var href=jQuery(this).attr("href");var id=new Number(settings.selected.attr("id").substr(1));id=(id-1);if(id==-1){id=17;}
var hash="#_"+id;location.hash=hash;jQuery("a[href="+hash+"]").click();});jQuery("#right",this).bind("click",function(e)
{e.preventDefault();var href=jQuery(this).attr("href");var id=new Number(settings.selected.attr("id").substr(1));id++;if(id==18){id=0;}
var hash="#_"+id;location.hash=hash;jQuery("a[href="+hash+"]").click();});return;};