$(document).ready(function(){
	if(!($.browser.msie && $.browser.version < 7)){
		$('#hide').hide();
		$('#search_submit').bind('click',function(){
			$("#hide").hide('drop',{direction:'down'},500,function(){
				document.search_form.submit();
			});
			return false;
		});
	
		$('#login_submit').bind('click',function(){
			$("#hide").hide('drop',{direction:'down'},500,function(){
				document.login_form.submit();
			});
			return false;
		});
		
		$('#close_link').bind('click',function(){
			$("#lightbox_panel").fadeIn(function(){
				$("#request_panel").fadeIn();
			});
			return false;
		});
		
		$('.close_button').bind('click',function(){
			$($(this)[0].parentNode).fadeOut(function(){
				$("#lightbox_panel").fadeOut();
			})
		});
		
		$('.show_button').bind('click',function(){
			var id = $(this)[0].id
			$("#lightbox_panel").fadeIn(function(){
				$('#' + id + '_panel').fadeIn();
			});
			return false;
		});
		
		setTimeout(function(){
			$("#hide").show('drop',{direction:'up'},500,function(){
				if(hasErrors)
					$("#error_container").show('drop',{direction:'up'},500);
				if(hasNotices)
					$("#notice_container").show('drop',{direction:'up'},500);
			})
		},300);
		
	}
});

function closeTopBars(){
	$("#error_container").hide('drop',{direction:'down'},500);
	$("#notice_container").hide('drop',{direction:'down'},500);
}