Haulting link href with javascript
===

I have the following link element:

    <a href="javascript:;" onclick="check_show('http://www.test.com')">Test</a>
    
    <script>
    function check_show(link){
    	if($('#testelement).css('display') == 'block'){
    		window.location.href = link;
    	}
    }
    </script>

The problem with this is if I was to click to open in a new window (or ctrl-click), it will open a new windows for 'javascript:;'. So, I need to ad the link in the the href. This is fine, but I would like to still check #testelement is visible first.


