Webpage for SDL

I’m having a problem with catching the Mouse state for a button release
(SDL_MOUSEBUTTONUP). For some reason it only catches it when I scroll the
mouse, not when I release any actual buttons. Why is this happening?

switch(Event->type) {
case SDL_MOUSEBUTTONDOWN: {
switch(Event->button.button) {
case SDL_BUTTON_LEFT: {
MouseLButtonDown = true;

			OnLButtonDown(Event->button.x,Event->button.y);
			break;
		}
		case SDL_BUTTON_RIGHT: {
			MouseRButtonDown = true;

			OnRButtonDown(Event->button.x,Event->button.y);
			break;
		}
		case SDL_BUTTON_MIDDLE: {
			MouseMButtonDown = true;

			OnMButtonDown(Event->button.x,Event->button.y);
			break;
		}
	}
	break;
}

}

switch(Event->type) {
case SDL_MOUSEBUTTONUP: {
if(MouseLButtonDown) {
OnLButtonUp(Event->button.x,Event->button.y);
MouseLButtonDown = false;
}else
if(MouseRButtonDown) {
OnRButtonUp(Event->button.x,Event->button.y);
MouseRButtonDown = false;
}else
if(MouseMButtonDown) {
OnMButtonUp(Event->button.x,Event->button.y);
MouseMButtonDown = false;
}
break;
}
}_________________________________________________________________
Working moms: Find helpful tips here on managing kids, home, work ? and
yourself. http://special.msn.com/msnbc/workingmom.armx