Show Hide Div with Click and double click

Click this to display
Double click the above Div box to hide Me




HTML

<div id='my_page2' style="z-index: 2; position: relative; right: 0px; top: 10px; background-color: #cccc33; width: 180px; padding: 10px; color: white; border: #0000cc 2px  dashed;display: inline; " onClick="setVisibility('sub1', 'inline');"  ondblclick="setVisibility('sub1','none');">

Click this to display   

</div>
<div id="sub1" class='my_div'>Double click the above Div box to hide Me</div>

Style

<style>
.my_div {
position: absolute;
left: 400px;
top: 100px;
background-color: #306080;
width: 300px;
padding: 10px;
color: white;
border: #0000cc 2px dashed;
display: none;
}
</style>

JavaScript

<script language=\"JavaScript\">
function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}
</script>