Determining if a block is visible

Determining if a block is visible


Hi All,
I have some code that will show or hide a div based on the AJAX result
it gets back. Here's the code:
if(responseData.valid == false && $
('#ConstituentID').val().length > 0){
$('#InvalidConstituentIdWarning').show
("blind",null,500);
} else {
$('#InvalidConstituentIdWarning').hide
("blind",null,500);
}
The idea is that, if they typed something in the ConstituentID box,
and validation failed, we show them a warning that the number they
typed in is wrong. Otherwise, we hide that warning.
The problem is that if the warning is already hidden, and the "hide"
function is called, the div is shown and then immediately hidden--not
what we want. We want it to just stay hidden.
So, how do I check to see if the "InvalidConstituentIdWarning" block
is hidden already or not? It's a div. Do I check the value of the CSS
"display" selector, with none being hidden, and block being shown? Or
is that not the "right" way to go about this?
-Josh