Need a JQUERY script that can Detect UPC Scan in from handheld scanner. If a scan is detected I need to to choose a function to run based on if a certain JQUERY dialog is open (visible ) or not. If it isnt visible do function A, if it is visible (open) do function B.