$(document).ready(function(){ $(".first_slide"). click(); $( ".filter" ) . change( function( e ){ e.preventDefault(); var fl = $( this ) . attr( "checked" ); var n = $( this ) . attr( "name" ); $( ".filter" ) . each ( function(id,val){ if ($(val).attr("name") != n) $( val ) . removeAttr( "checked" ); }); $(".bxslider") . html( "" ); $.post( "?act=gall_load_img", { key: n }, function(ret) { if (!ret.success) alert (ret.message ); else $( ".bxslider") . html( ret.html ); slider.reloadSlider(); bxslider_init_images(); $(".first_slide"). click(); }, 'json' ); return false; }); var _selected; $(".view_main label").each(function(index,val){ $this = $(this); if(index==0) { $this.addClass("selected"); _selected = $this; } $this.bind ({ "mouseenter": function() { $(this).addClass("hovered"); }, "mouseleave": function() { $(this).removeClass("hovered"); }, "click": function() { _selected.removeClass("selected"); _selected = $(this); $(this).addClass("selected"); } }); }) });