Piu' semplicemente correggi:

win=window.open(url, "_blank", str);

ciao