jQuery.extend( jQuery.easing, {
	easeOutBack: function (x, t, b, c, d, s) {
		if(s==undefined) s=1.70158;
		return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;
	}
});
$(window).resize(function(){
    resizeFrame('browsebar');
});
$(document).ready(function(){
	a=$('#albums'); aw=$('#albumswrap'); s=$('#search'); sb=$('#search-btn'); bb=$('#browse-btn');
	pos=0; tw=$('#albums img').size()*40; mtw=$('#moretxt').outerWidth();
	$('#scroll-right').click(function() {
		var ww=aw.width()-mtw;
		if(pos > (ww-tw)) {
			if((pos-=ww-20) < (ww-tw)) pos=ww-tw;
			a.animate({left:pos+'px'},800,'easeOutBack');}
	})
	$('#scroll-left').click(function() {
		var ww=aw.width()-mtw;
		if((pos+=ww-20) > 0) pos=0;
		a.animate({left:pos+'px'},800,'easeOutBack');
	})
	sb.click(function() {
		s.fadeIn(); sb.fadeOut(); bb.fadeIn();
	})
	bb.click(function() {
		s.fadeOut(); sb.fadeIn(); bb.fadeOut();
	})
	$('.sbox').each(function() {
		this._defval = $(this).val();
		$(this).click(function(){
			$(this).addClass('active');
			if($(this).val()==this._defval) $(this).val('');
		}).blur(function(){
			$(this).removeClass('active');
			if($(this).val()=='') $(this).val(this._defval);
		});
	})
});
