var popwindow var tisurl var tiswidth var tisheight var tistopposition var tisleftposition var pause=20 var step=10 var marginright var endposition var timer function openpopup(thisurl,thiswidth,thisheight,thistopposition) { tisurl=thisurl tiswidth=thiswidth tisheight=thisheight tistopposition=thistopposition tisleftposition=-tiswidth popwindow=window.open(tisurl, "newwindow", "toolbar=no,width="+tiswidth+",height="+tisheight+",top="+tistopposition+",left="+(tisleftposition)+""); if (document.all) { marginright=screen.width endposition=(marginright-thiswidth-10)/2 movewindow() } if (document.layers) { marginright=window.innerWidth-10 endposition=marginright-thiswidth movewindow() } } function movewindow() { if (tisleftposition<=endposition) { popwindow.moveTo(tisleftposition,tistopposition) tisleftposition+=step timer= setTimeout("movewindow()",pause) } else { clearTimeout(timer) } }