function GalleryControl(a){this.Y=a;if(a){a.use("node","cookie","anim-base",function(b){});}}GalleryControl.prototype.display=function(){var c,b=this.Y.Cookie.get("layout"),d=new this.Y.Anim({node:"#gallery_items",duration:2,to:{opacity:0},from:{opacity:100}}),a=new this.Y.Anim({node:"#gallery_items",duration:2,to:{opacity:100},from:{opacity:0}}),f=f=this.Y.get("#gallery_items"),e=this.Y;if(f){if(b===null){c=new Date();c.setDate(c.getDate()+365);e.Cookie.set("layout","gridView",{expires:c});}if(b==="listView"){e.all("#switch_button").addClass("swap");d.run();f.removeClass("thumb_view");f.addClass("display");a.run();}else{e.all("#switch_button").removeClass("swap");d.run();f.removeClass("display");f.addClass("thumb_view");a.run();}}};GalleryControl.prototype.toggleView=function(){var a=new Date(),b=this.Y;a.setDate(a.getDate()+365);if(b.Cookie.get("layout")==="gridView"){b.Cookie.set("layout","listView",a);this.display();}else{b.Cookie.set("layout","gridView",a);this.display();}};GalleryControl.prototype.toString=function(){return"[object GalleryControl ("+this.valueOf()+")]";};GalleryControl.prototype.valueOf=function(){var a=parseInt("-1");if(this.Y){a=this.Y.all("#gallery_items li").size();}return a;};GalleryControl.TOGGLE_DELAY_MICROSECONDS=200;