I'm attempting to make a picture do two separate occasions inside a wordpress publish. The very first, reveals an inpage popup utilizing a wordpress plugin known as Thickbox Quite happy with a facebook share button. Simultaneously, a brand new window reveals and would go to my ad site. Can anybody assist me to fix this script? Thanks!

<script type="text/javascript">
function open_win() 
[thkBC height="225" width="490" anchortext="mysite" title="Share Us With Your Friends!"  url="http://mysite.com/share.php" type="iframe" html_wrap="p"];

window.open("http://mysite.com/ad.php" ta);

<a onclick="open_win()"><img src="http://mysite.com/myadpic"></a>