function rep(str) { re = /[^0123456789A-z]/gi; nm = str.replace(re, ''); return nm; } function bigphoto(url, width, height) { if (url.indexOf('/')==0) { } else if (url.indexOf('http://')==0) { } else { url = '/' + url; } nm = rep(url); popupWin = window.open(url, nm, 'width='+width+',height='+height+',top=10,left=80,location=no,toolbar=no,status=no,scrollbars=auto'); popupWin.focus(); }